torque Torque Game Engine Documentation
CVS Revision Label 1.3.x

Camera Class Reference

#include <camera.h>

Inheritance diagram for Camera:

ShapeBase GameBase SceneObject NetObject Container::Link SimObject ConsoleObject

Detailed Description

Implements a basic camera object.


Public Member Functions

 DECLARE_CONOBJECT (Camera)
 Camera ()
 ~Camera ()
void onEditorEnable ()
 Called when the editor is activated.
void onEditorDisable ()
 Called when the editor is deactivated.
bool onAdd ()
 Called when the object is added to the sim.
void onRemove ()
 Called when the object is removed from the sim.
void renderImage (SceneState *state, SceneRenderImage *image)
void processTick (const Move *move)
 Processes a move event and updates object state once every 32 milliseconds.
void interpolateTick (F32 delta)
 Interpolates between tick events.
void getCameraTransform (F32 *pos, MatrixF *mat)
 Gets the camera transform.
void writePacketData (GameConnection *conn, BitStream *stream)
 Write state information necessary to perform client side prediction of an object.
void readPacketData (GameConnection *conn, BitStream *stream)
 Read data written with writePacketData() and update the object state.
U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream)
 Instructs this object to pack its state for transfer over the network.
void unpackUpdate (NetConnection *conn, BitStream *stream)
 Instructs this object to read state data previously packed with packUpdate.
Point3FgetPosition ()
void setFlyMode ()
void setOrbitMode (GameBase *obj, Point3F &pos, AngAxisF &rot, F32 minDist, F32 maxDist, F32 curDist, bool ownClientObject)
void validateEyePoint (F32 pos, MatrixF *mat)
void onDeleteNotify (SimObject *obj)
 Called when a SimObject is deleted.
GameBasegetOrbitObject ()
bool isObservingClientObject ()

Static Public Member Functions

static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.
static void consoleInit ()
 Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.

Private Types

typedef ShapeBase Parent
enum  MaskBits {
  MoveMask = Parent::NextFreeMask,
  NextFreeMask = Parent::NextFreeMask << 1
}
enum  {
  StationaryMode = 0,
  FreeRotateMode = 1,
  FlyMode = 2,
  OrbitObjectMode = 3,
  OrbitPointMode = 4,
  CameraFirstMode = 0,
  CameraLastMode = 4
}

Private Member Functions

void setPosition (const Point3F &pos, const Point3F &viewRot)
void setPosition (const Point3F &pos, const Point3F &viewRot, MatrixF *mat)
void setTransform (const MatrixF &mat)
 Sets the Object -> World transform.
F32 getCameraFov ()
 Returns the Field of Vision for this object if used as a camera.
F32 getDefaultCameraFov ()
 Returns the default FOV if this object is used as a camera.
bool isValidCameraFov (F32 fov)
 Returns true if the FOV supplied is within allowable parameters.
void setCameraFov (F32 fov)
 Sets the FOV for this object if used as a camera.
F32 getDamageFlash () const
 Returns the level of screenflash that should be used.
F32 getWhiteOut () const
 White out is the flash-grenade blindness effect This returns the level of flash to create.

Private Attributes

Point3F mRot
StateDelta delta
SimObjectPtr< GameBasemOrbitObject
F32 mMinOrbitDist
F32 mMaxOrbitDist
F32 mCurOrbitDist
Point3F mPosition
bool mObservingClientObject
int mode

Static Private Attributes

static F32 mMovementSpeed

Data Structures

struct  StateDelta


Member Typedef Documentation

typedef ShapeBase Camera::Parent [private]
 

Reimplemented from ShapeBase.


Member Enumeration Documentation

enum Camera::MaskBits [private]
 

Enumeration values:
MoveMask 
NextFreeMask 

anonymous enum [private]
 

Enumeration values:
StationaryMode 
FreeRotateMode 
FlyMode 
OrbitObjectMode 
OrbitPointMode 
CameraFirstMode 
CameraLastMode 


Constructor & Destructor Documentation

Camera::Camera  ) 
 

Camera::~Camera  ) 
 


Member Function Documentation

void Camera::setPosition const Point3F pos,
const Point3F viewRot
[private]
 

void Camera::setPosition const Point3F pos,
const Point3F viewRot,
MatrixF mat
[private]
 

void Camera::setTransform const MatrixF mat  )  [private, virtual]
 

Sets the Object -> World transform.

Parameters:
mat New transform matrix

Reimplemented from SceneObject.

F32 Camera::getCameraFov  )  [private, virtual]
 

Returns the Field of Vision for this object if used as a camera.

Reimplemented from ShapeBase.

F32 Camera::getDefaultCameraFov  )  [private, virtual]
 

Returns the default FOV if this object is used as a camera.

Reimplemented from ShapeBase.

bool Camera::isValidCameraFov F32  fov  )  [private, virtual]
 

Returns true if the FOV supplied is within allowable parameters.

Parameters:
fov FOV to test

Reimplemented from ShapeBase.

void Camera::setCameraFov F32  fov  )  [private, virtual]
 

Sets the FOV for this object if used as a camera.

Reimplemented from ShapeBase.

F32 Camera::getDamageFlash  )  const [private, virtual]
 

Returns the level of screenflash that should be used.

Reimplemented from ShapeBase.

F32 Camera::getWhiteOut  )  const [private, virtual]
 

White out is the flash-grenade blindness effect This returns the level of flash to create.

Reimplemented from ShapeBase.

Camera::DECLARE_CONOBJECT Camera   ) 
 

static void Camera::initPersistFields  )  [static]
 

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDepricatedField(), addGroup(), endGroup()

Reimplemented from GameBase.

static void Camera::consoleInit  )  [static]
 

Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.

Deprecated:
You should use ConsoleMethod and ConsoleFunction, not this, to register methods or commands.
See also:
console

Reimplemented from ShapeBase.

void Camera::onEditorEnable  )  [virtual]
 

Called when the editor is activated.

Reimplemented from SimObject.

void Camera::onEditorDisable  )  [virtual]
 

Called when the editor is deactivated.

Reimplemented from SimObject.

bool Camera::onAdd  )  [virtual]
 

Called when the object is added to the sim.

Reimplemented from ShapeBase.

void Camera::onRemove  )  [virtual]
 

Called when the object is removed from the sim.

Reimplemented from ShapeBase.

void Camera::renderImage SceneState state,
SceneRenderImage image
[virtual]
 

Reimplemented from ShapeBase.

void Camera::processTick const Move move  )  [virtual]
 

Processes a move event and updates object state once every 32 milliseconds.

This takes place both on the client and server, every 32 milliseconds (1 tick).

See also:
ProcessList
Parameters:
move Move event corresponding to this tick, or NULL.

Reimplemented from ShapeBase.

void Camera::interpolateTick F32  delta  )  [virtual]
 

Interpolates between tick events.

This takes place on the CLIENT ONLY.

Parameters:
delta Time since last call to interpolate

Reimplemented from GameBase.

void Camera::getCameraTransform F32 pos,
MatrixF mat
[virtual]
 

Gets the camera transform.

Todo:
Find out what pos does
Parameters:
pos TODO: Find out what this does
mat Camera transform (out)

Reimplemented from ShapeBase.

void Camera::writePacketData GameConnection conn,
BitStream stream
[virtual]
 

Write state information necessary to perform client side prediction of an object.

This information is sent only to the controling object. For example, if you are a client controlling a Player, the server uses writePacketData() instead of packUpdate() to generate the data you receive.

Parameters:
conn Connection for which we're generating this data.
stream Bitstream for output.

Reimplemented from ShapeBase.

void Camera::readPacketData GameConnection conn,
BitStream stream
[virtual]
 

Read data written with writePacketData() and update the object state.

Parameters:
conn Connection for which we're generating this data.
stream Bitstream to read.

Reimplemented from ShapeBase.

U32 Camera::packUpdate NetConnection conn,
U32  mask,
BitStream stream
[virtual]
 

Instructs this object to pack its state for transfer over the network.

Parameters:
conn Net connection being used
mask Mask indicating fields to transmit.
stream Bitstream to pack data to
Returns:
Any bits which were not dealt with. The value is stored by the networking system. Don't set bits you weren't passed.

Reimplemented from ShapeBase.

void Camera::unpackUpdate NetConnection conn,
BitStream stream
[virtual]
 

Instructs this object to read state data previously packed with packUpdate.

Parameters:
conn Net connection being used
stream stream to read from

Reimplemented from ShapeBase.

Point3F& Camera::getPosition  ) 
 

void Camera::setFlyMode  ) 
 

void Camera::setOrbitMode GameBase obj,
Point3F pos,
AngAxisF rot,
F32  minDist,
F32  maxDist,
F32  curDist,
bool  ownClientObject
 

void Camera::validateEyePoint F32  pos,
MatrixF mat
 

void Camera::onDeleteNotify SimObject obj  )  [virtual]
 

Called when a SimObject is deleted.

When you are on the notification list for another object and it is deleted, this method is called.

Reimplemented from ShapeBase.

GameBase* Camera::getOrbitObject  )  [inline]
 

bool Camera::isObservingClientObject  )  [inline]
 


Field Documentation

Point3F Camera::mRot [private]
 

StateDelta Camera::delta [private]
 

F32 Camera::mMovementSpeed [static, private]
 

SimObjectPtr<GameBase> Camera::mOrbitObject [private]
 

F32 Camera::mMinOrbitDist [private]
 

F32 Camera::mMaxOrbitDist [private]
 

F32 Camera::mCurOrbitDist [private]
 

Point3F Camera::mPosition [private]
 

bool Camera::mObservingClientObject [private]
 

int Camera::mode [private]
 




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen