Camera Class Reference

#include <Camera.h>

Inheritance diagram for Camera:
ListenerObject

# Public Member Functions

void reset ()
 Reset the camera's state.
void setup (PixelOptical pixelOptical, CameraFrustum cameraFrustum)
void setCameraMovementManager (CameraMovementManager cameraMovementManager)
CameraMovementManager getCameraMovementManager ()
void setCameraEffectManager (CameraEffectManager cameraEffectManager)
CameraEffectManager getCameraEffectManager ()
void setStageSize (Size size)
Size getStageSize ()
void setFocusActor (Actor focusActor)
Actor getFocusActor ()
void unsetFocusActor ()
 Stop following any actor.
void setFocusActorPositionDisplacement (Vector3D focusActorPositionDisplacement)
Vector3D getFocusActorPositionDisplacement ()
void setDisplacement (Vector3D)
Vector3D geDisplacement ()
void setOptical (Optical optical)
Optical getOptical ()
void setTransformation (Transformation transformation, bool cap)
Transformation getTransformation ()
void setPosition (Vector3D position, bool cap)
void translate (Vector3D displacement, int32 cap)
Vector3D getPosition ()
void setRotation (Rotation rotation)
void rotate (Rotation rotation)
Rotation getRotation ()
CameraFrustum getCameraFrustum ()
Vector3D getLastDisplacement ()
uint8 getTransformationFlags ()
void focus ()
 Focus the camera on the focus actor if any.
void startEffect (int32 effect,...)
void stopEffect (int32 effect)
void print (int32 x, int32 y, bool inPixels)

# Private Attributes

Optical optical
 Optical configuration values used for projections.
Transformation transformation
 Camera's transformation.
Vector3D displacement
 Displacement applied to the position when it changes.
Vector3D lastDisplacement
 Saves the camera's change of position in the last game cycle.
Rotation invertedRotation
 Camera's rotation's complement.
CameraMovementManager cameraMovementManager
 Camera's movement manager.
CameraEffectManager cameraEffectManager
 Camera's special effects manager.
Size stageSize
 Cached stage's size used to optionally limit the camera's movement.
CameraFrustum cameraFrustum
 Camera's frustum configuration.
uint8 transformationFlags
- Private Attributes inherited from ListenerObject
VirtualList events
 List of registered events.
int8 eventFirings
 Counter that keeps track of the number of fired events to prevent race conditions in nested firings.

# Additional Inherited Members

- Private Member Functions inherited from ListenerObject
void constructor ()
 Class' constructor.
void destructor ()
 Class' destructor.
void addEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListeners (uint16 eventCode)
void removeAllEventListeners ()
 Remove all listener objects.
bool hasActiveEventListeners ()
void fireEvent (uint16 eventCode)
void sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay)
void sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay)
void discardAllMessages ()
 Discard all messages, both to be sent and to be received.
void discardMessages (uint32 message)
virtual bool onEvent (ListenerObject eventFirer, uint16 eventCode)
virtual bool handleMessage (Telegram telegram)

# Detailed Description

Class Camera

Inherits from ListenerObject

Represents the player's view point.

Definition at line 49 of file Camera.h.

# Member Function Documentation

# focus()

void Camera::focus ( )

Focus the camera on the focus actor if any.

Definition at line 326 of file Camera.c.

# geDisplacement()

Vector3D Camera::geDisplacement ( )

Retrieve the constant displacement that is added to the camera's position.

Returns
Displacement vector

Definition at line 200 of file Camera.c.

# getCameraEffectManager()

CameraEffectManager Camera::getCameraEffectManager ( )

Retrieve the camera's current special effects manager

Returns
Camera's current special effects manager

Definition at line 114 of file Camera.c.

# getCameraFrustum()

CameraFrustum Camera::getCameraFrustum ( )

Retrieve the camera's frustum configuration.

Returns
Camera's frustum configuration

Definition at line 305 of file Camera.c.

# getCameraMovementManager()

CameraMovementManager Camera::getCameraMovementManager ( )

Retrieve the camera's current movement manager

Returns
Camera's current movement manager

Definition at line 92 of file Camera.c.

# getFocusActor()

Actor Camera::getFocusActor ( )

Retrieve the actor that the camera is following.

Returns
focusActor: Actor being followed

Definition at line 149 of file Camera.c.

# getFocusActorPositionDisplacement()

Vector3D Camera::getFocusActorPositionDisplacement ( )

Retrieve the displacement that is added to the camera's position relative to the focus actor's position.

Returns
Displacement vector

Definition at line 181 of file Camera.c.

# getLastDisplacement()

Vector3D Camera::getLastDisplacement ( )

Retrieve the camera's change of position in the last game cycle

Returns
Camera's change of position in the last game cycle

Definition at line 312 of file Camera.c.

# getOptical()

Optical Camera::getOptical ( )

Retrieve the optical configuration values used for projections.

Returns
Optical struct with the configuration values used for projections

Definition at line 216 of file Camera.c.

# getPosition()

Vector3D Camera::getPosition ( )

Retrieve the camera's position.

Returns
Camera's position

Definition at line 268 of file Camera.c.

# getRotation()

Rotation Camera::getRotation ( )

Retrieve the camera's rotation.

Returns
Camera's rotation

Definition at line 298 of file Camera.c.

# getStageSize()

Size Camera::getStageSize ( )

Retrieve the stage's cached size.

Returns
Stage's size

Definition at line 121 of file Camera.c.

# getTransformation()

Transformation Camera::getTransformation ( )

Retrieve the camera's transformation.

Returns
Camera's transformation

Definition at line 231 of file Camera.c.

# getTransformationFlags()

uint8 Camera::getTransformationFlags ( )

Retrieve the transformation flags that keep track of changes in the camera's position and rotation during the current game cycle.

Returns
Transformation flags

Definition at line 319 of file Camera.c.

# print()

void Camera::print ( int32 x,
int32 y,
bool inPixels )

Print the camera's status.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print
inPixelsIf true, the spatial data is printed in pixel units; in meter, otherwise

Definition at line 382 of file Camera.c.

# reset()

void Camera::reset ( )

Reset the camera's state.

Definition at line 41 of file Camera.c.

# rotate()

void Camera::rotate ( Rotation rotation)

Add a rotation the camera's current rotation.

Parameters
rotationRotation delta

Definition at line 287 of file Camera.c.

# setCameraEffectManager()

void Camera::setCameraEffectManager ( CameraEffectManager cameraEffectManager)

Set the manager of the camera's special effects.

Parameters
cameraEffectManagerSpecial effects manager

Definition at line 99 of file Camera.c.

# setCameraMovementManager()

void Camera::setCameraMovementManager ( CameraMovementManager cameraMovementManager)

Set the manager of the camera's properties.

Parameters
cameraMovementManagerMovement manager

Definition at line 77 of file Camera.c.

# setDisplacement()

void Camera::setDisplacement ( Vector3D displacement)

Set a constant displacement to be added to the camera's position.

Parameters
displacementDisplacement vector

Definition at line 193 of file Camera.c.

# setFocusActor()

void Camera::setFocusActor ( Actor focusActor)

Register the actor that the camera must follow.

Parameters
focusActorActor to follow

Definition at line 135 of file Camera.c.

# setFocusActorPositionDisplacement()

void Camera::setFocusActorPositionDisplacement ( Vector3D focusActorPositionDisplacement)

Register a displacement to be added to the camera's position relative to the focus actor's position.

Parameters
focusActorPositionDisplacementDisplacement vector

Definition at line 171 of file Camera.c.

# setOptical()

void Camera::setOptical ( Optical optical)

Set the optical configuration values used for projections.

Parameters
opticalconfiguration struct with the values used for projections

Definition at line 207 of file Camera.c.

# setPosition()

void Camera::setPosition ( Vector3D position,
bool cap )

Set the camera's position.

Parameters
position3D vector
capCap the camera's position within the stage's size if true

Definition at line 238 of file Camera.c.

# setRotation()

void Camera::setRotation ( Rotation rotation)

Set the camera's rotation.

Parameters
rotationRotation to assign to the camera

Definition at line 275 of file Camera.c.

# setStageSize()

void Camera::setStageSize ( Size size)

Save the stage's size.

Parameters
sizeStage's size

Definition at line 128 of file Camera.c.

# setTransformation()

void Camera::setTransformation ( Transformation transformation,
bool cap )

Set the camera's transformation.

Parameters
transformationNew transformation

Definition at line 223 of file Camera.c.

# setup()

void Camera::setup ( PixelOptical pixelOptical,
CameraFrustum cameraFrustum )

Setup the camera's optical and frustum configuration that determine the results from 3D to 2D projection.

Parameters
pixelOpticalConfiguration struct for the projection functions
cameraFrustumPlayer's point of view configuration

Definition at line 66 of file Camera.c.

# startEffect()

void Camera::startEffect ( int32 effect,
... )

Start a camera effect.

Parameters
effectCode of the effect to start
...Variable arguments list depending on the effect to start

Definition at line 364 of file Camera.c.

# stopEffect()

void Camera::stopEffect ( int32 effect)

Stop a camera effect.

Parameters
effectCode of the effect to stop

Definition at line 374 of file Camera.c.

# translate()

void Camera::translate ( Vector3D displacement,
int32 cap )

Add a displacement the camera's current position.

Parameters
displacementDisplacement vector
capCap the camera's position within the stage's size if true

Definition at line 253 of file Camera.c.

# unsetFocusActor()

void Camera::unsetFocusActor ( )

Stop following any actor.

Definition at line 161 of file Camera.c.

# Member Data Documentation

# cameraEffectManager

CameraEffectManager Camera::cameraEffectManager
private

Camera's special effects manager.

Definition at line 70 of file Camera.h.

# cameraFrustum

CameraFrustum Camera::cameraFrustum
private

Camera's frustum configuration.

Definition at line 76 of file Camera.h.

# cameraMovementManager

CameraMovementManager Camera::cameraMovementManager
private

Camera's movement manager.

Definition at line 67 of file Camera.h.

# displacement

Vector3D Camera::displacement
private

Displacement applied to the position when it changes.

Definition at line 58 of file Camera.h.

# invertedRotation

Rotation Camera::invertedRotation
private

Camera's rotation's complement.

Definition at line 64 of file Camera.h.

# lastDisplacement

Vector3D Camera::lastDisplacement
private

Saves the camera's change of position in the last game cycle.

Definition at line 61 of file Camera.h.

# optical

Optical Camera::optical
private

Optical configuration values used for projections.

Definition at line 52 of file Camera.h.

# stageSize

Size Camera::stageSize
private

Cached stage's size used to optionally limit the camera's movement.

Definition at line 73 of file Camera.h.

# transformation

Transformation Camera::transformation
private

Camera's transformation.

Definition at line 55 of file Camera.h.

# transformationFlags

uint8 Camera::transformationFlags
private

Transformation flags to keep track of changes in the camera's position and rotation during the current game cycle

Definition at line 80 of file Camera.h.


The documentation for this class was generated from the following files: