Camera
Implements a basic camera object.
Classes:
NewtonFlyMode
Gets the velocity of the object.
setVelocity(const VectorF & vel)
Sets the velocity of this object.
setAngularVelocity(const VectorF & vel)
bool
setAngularForce(F32 force)
setAngularDrag(F32 drag)
setFlyForce(F32 force)
setSpeedMultiplier(F32 mul)
setBrakeMultiplier(F32 mul)
EditOrbitMode
bool
bool
setValidEditOrbitPoint(bool state)
setEditOrbitPoint(const Point3F & pnt)
autoFitRadius(F32 radius)
Orient the camera to view the given radius.
Public Types
CameraMotionMode { StationaryMode = 0 FreeRotateMode FlyMode OrbitObjectMode OrbitPointMode TrackObjectMode OverheadMode EditOrbitMode CameraFirstMode = 0 CameraLastMode = EditOrbitMode }
Movement behavior type for camera.
Parent
Protected Types
MaskBits { MoveMask = Parent::NextFreeMask UpdateMask = Parent::NextFreeMask << 1 NewtonCameraMask = Parent::NextFreeMask << 2 EditOrbitMask = Parent::NextFreeMask << 3 NextFreeMask = Parent::NextFreeMask << 4 }
Public Static Attributes
The ExtendedMove position/rotation index used for camera movements.
Protected Attributes
Stores that last absolute pitch value as passed in by ExtendedMove.
Stores that last absolute roll value as passed in by ExtendedMove.
Stores that last absolute yaw value as passed in by ExtendedMove.
bool
Protected Static Attributes
Protected Functions
_calcEditOrbitPoint(MatrixF * mat, const Point3F & rot)
_calcOrbitPoint(MatrixF * mat, const Point3F & rot)
_validateEyePoint(F32 pos, MatrixF * mat)
Returns the vertical field of view in degrees for this object if used as a camera.
Returns the level of screenflash that should be used.
Returns the default vertical field of view in degrees if this object is used as a camera.
White out is the flash-grenade blindness effect This returns the level of flash to create.
bool
isValidCameraFov(F32 fov)
Returns true if the vertical FOV in degrees is within allowable parameters of the datablock.
setCameraFov(F32 fov)
Sets the vertical field of view in degrees for this object if used as a camera.
setRenderTransform(const MatrixF & mat)
This sets the render transform for this object.
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
Protected Static Functions
bool
_setModeField(void * object, const char * index, const char * data)
bool
_setNewtonField(void * object, const char * index, const char * data)
Public Functions
Camera()
~Camera()
DECLARE_CATEGORY("Game" )
DECLARE_DESCRIPTION("Represents <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> position, direction and field of view <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> scene from." )
getCameraTransform(F32 * pos, MatrixF * mat)
Gets the camera to world space transform matrix.
getEyeCameraTransform(IDisplayDevice * display, U32 eyeId, MatrixF * outMat)
Gets the view transform for a particular eye, taking into account the current absolute orient and position values of the display device.
interpolateTick(F32 delta)
Interpolates between tick events.
bool
isCamera()
bool
bool
onAdd()
Called when the object is added to the sim.
onDeleteNotify(SimObject * object)
Called when a SimObject is deleted.
Called when the editor is deactivated.
Called when the editor is activated.
bool
onNewDataBlock(GameBaseData * dptr, bool reload)
Called when a new datablock is set.
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Instructs this object to pack its state for transfer over the network.
processTick(const Move * move)
Processes a move event and updates object state once every 32 milliseconds.
readPacketData(GameConnection * conn, BitStream * stream)
Read data written with writePacketData() and update the object state.
setRotation(const Point3F & viewRot)
setTrackObject(GameBase * obj, const Point3F & offset)
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
writePacketData(GameConnection * conn, BitStream * stream)
Write state information necessary to perform client side prediction of an object.
Public Static Functions
Detailed Description
Implements a basic camera object.
NewtonFlyMode
setNewtonFlyMode()
getVelocity()
Reimplemented from: SceneObject
setVelocity(const VectorF & vel)
Reimplemented from: ShapeBase
getAngularVelocity()
setAngularVelocity(const VectorF & vel)
isRotationDamped()
setAngularForce(F32 force)
setAngularDrag(F32 drag)
setMass(F32 mass)
setDrag(F32 drag)
setFlyForce(F32 force)
setSpeedMultiplier(F32 mul)
setBrakeMultiplier(F32 mul)
VectorF mAngularVelocity
F32 mAngularForce
F32 mAngularDrag
VectorF mVelocity
bool mNewtonMode
bool mNewtonRotation
F32 mMass
F32 mDrag
F32 mFlyForce
F32 mSpeedMultiplier
F32 mBrakeMultiplier
EditOrbitMode
setEditOrbitMode()
isEditOrbitMode()
getValidEditOrbitPoint()
setValidEditOrbitPoint(bool state)
getEditOrbitPoint()
setEditOrbitPoint(const Point3F & pnt)
autoFitRadius(F32 radius)
Orient the camera to view the given radius.
Requires that an edit orbit point has been set.
bool mValidEditOrbitPoint
Point3F mEditOrbitPoint
F32 mCurrentEditOrbitDist
Public Types
CameraMotionMode
Enumerator
- StationaryMode = 0
- FreeRotateMode
- FlyMode
- OrbitObjectMode
- OrbitPointMode
- TrackObjectMode
- OverheadMode
- EditOrbitMode
Used by the World Editor.
- CameraFirstMode = 0
- CameraLastMode = EditOrbitMode
Movement behavior type for camera.
typedef ShapeBase Parent
Protected Types
MaskBits
Enumerator
- MoveMask = Parent::NextFreeMask
- UpdateMask = Parent::NextFreeMask << 1
- NewtonCameraMask = Parent::NextFreeMask << 2
- EditOrbitMask = Parent::NextFreeMask << 3
- NextFreeMask = Parent::NextFreeMask << 4
Public Static Attributes
S32 smExtendedMovePosRotIndex
The ExtendedMove position/rotation index used for camera movements.
Protected Attributes
F32 mCurOrbitDist
CameraData * mDataBlock
StateDelta mDelta
F32 mLastAbsolutePitch
Stores that last absolute pitch value as passed in by ExtendedMove.
F32 mLastAbsoluteRoll
Stores that last absolute roll value as passed in by ExtendedMove.
F32 mLastAbsoluteYaw
Stores that last absolute yaw value as passed in by ExtendedMove.
bool mLocked
F32 mMaxOrbitDist
F32 mMinOrbitDist
CameraMotionMode mMode
bool mObservingClientObject
Point3F mOffset
SimObjectPtr< GameBase > mOrbitObject
Point3F mPosition
Point3F mRot
Protected Static Attributes
F32 smMovementSpeed
Protected Functions
_calcEditOrbitPoint(MatrixF * mat, const Point3F & rot)
_calcOrbitPoint(MatrixF * mat, const Point3F & rot)
_setPosition(const Point3F & pos, const Point3F & viewRot)
_setRenderPosition(const Point3F & pos, const Point3F & viewRot)
_validateEyePoint(F32 pos, MatrixF * mat)
getCameraFov()
Reimplemented from: ShapeBase
getDamageFlash()
Reimplemented from: ShapeBase
getDefaultCameraFov()
Reimplemented from: ShapeBase
getWhiteOut()
Reimplemented from: ShapeBase
isValidCameraFov(F32 fov)
Reimplemented from: ShapeBase
setCameraFov(F32 fov)
Reimplemented from: ShapeBase
setRenderTransform(const MatrixF & mat)
Reimplemented from: SceneObject
setTransform(const MatrixF & mat)
Reimplemented from: SceneObject
Protected Static Functions
_setModeField(void * object, const char * index, const char * data)
_setNewtonField(void * object, const char * index, const char * data)
Public Functions
Camera()
~Camera()
DECLARE_CATEGORY("Game" )
DECLARE_CONOBJECT(Camera )
DECLARE_DESCRIPTION("Represents <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> position, direction and field of view <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> scene from." )
getCameraRenderTarget()
getCameraTransform(F32 * pos, MatrixF * mat)
Reimplemented from: ShapeBase
getEyeCameraTransform(IDisplayDevice * display, U32 eyeId, MatrixF * outMat)
Reimplemented from: ShapeBase
getMode()
getOffset()
getOrbitObject()
getPosition()
getRotation()
interpolateTick(F32 delta)
Reimplemented from: ProcessObject
isCamera()
Reimplemented from: SceneObject
isObservingClientObject()
lookAt(const Point3F & pos)
onAdd()
Reimplemented from: SceneObject
onDeleteNotify(SimObject * object)
Reimplemented from: ShapeBase
onEditorDisable()
Reimplemented from: SimObject
onEditorEnable()
Reimplemented from: SimObject
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: GameBase
onRemove()
Reimplemented from: SceneObject
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: SceneObject
processTick(const Move * move)
Reimplemented from: ProcessObject
readPacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: GameBase
setFlyMode()
setOffset(const Point3F & offset)
setOrbitMode(GameBase * obj, const Point3F & pos, const Point3F & rot, const Point3F & offset, F32 minDist, F32 maxDist, F32 curDist, bool ownClientObject, bool locked)
setRotation(const Point3F & viewRot)
setTrackObject(GameBase * obj, const Point3F & offset)
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: SceneObject
writePacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: GameBase