TurretShape
Engine/source/T3D/turret/turretShape.h
Classes:
Protected Types
MaskBits { TurretUpdateMask = Parent::NextFreeMask << 0 NextFreeMask = Parent::NextFreeMask << 1 }
Private Types
GrandParent
Parent
Protected Attributes
bool
bool
bool
Are heading changes allowed.
Maximum heading limit from center, in radians.
How fast the turret may yaw, in radians per second.
bool
Are pitch changes allowed.
Pitch down limit, in radians.
How fast the turret may pitch, in radians per second.
bool
bool
A subclass of TurretShape will handle all of the adding to the scene.
Protected Functions
_applyLimits(Point3F & rot)
bool
_outsideLimits(Point3F & rot)
Return true if any angle is outside of the limits.
_setRotation(const Point3F & rot)
_updateNodes(const Point3F & rot)
onImageRecoil(U32 imageSlot, ShapeBaseImageData::StateData::RecoilState )
onImageStateAnimation(U32 imageSlot, const char * seqName, bool direction, bool scaleToState, F32 stateTimeOutValue)
onUnmount(SceneObject * obj, S32 node)
Callback when this object is unmounted.
updateAnimation(F32 dt)
Public Functions
advanceTime(F32 dt)
Advances simulation time for animations.
bool
bool
bool
getCameraParameters(F32 * min, F32 * max, Point3F * offset, MatrixF * rot)
Gets the minimum viewing distance, maximum viewing distance, camera offsetand rotation for this object, if the world were to be viewed through its eyes.
getCameraTransform(F32 * pos, MatrixF * mat)
Gets the camera to world space transform matrix.
getImageTransform(U32 imageSlot, MatrixF * mat)
Gets the transform of a mounted image in world space.
getImageTransform(U32 imageSlot, S32 node, MatrixF * mat)
Gets the transform of a node on a mounted image in world space.
bool
getNodeTransform(S32 node, MatrixF & mat)
getRenderImageTransform(U32 imageSlot, MatrixF * mat, bool noEyeOffset)
getRenderImageTransform(U32 imageSlot, S32 node, MatrixF * mat)
const char *
bool
getWorldNodeTransform(S32 node, MatrixF & mat)
interpolateTick(F32 delta)
Interpolates between tick events.
mountObject(SceneObject * obj, S32 node, const MatrixF & xfm)
ex: Mount B to A at A's node N A.mountObject( B, N )
bool
onAdd()
Called when the object is added to the sim.
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.
prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)
Used from ShapeBase::_prepRenderImage() to submit render instances for the main shape or its mounted elements.
prepRenderImage(SceneRenderState * state)
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.
setAllowManualFire(bool allow)
setAllowManualRotation(bool allow)
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
setTurretRotation(const Point3F & rot)
unmountObject(SceneObject * obj)
Remove an object mounting.
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
updateMove(const Move * move)
writePacketData(GameConnection * conn, BitStream * stream)
Write state information necessary to perform client side prediction of an object.
Public Static Functions
Detailed Description
Protected Types
MaskBits
Enumerator
- TurretUpdateMask = Parent::NextFreeMask << 0
using one mask because we're running out of maskbits
- NextFreeMask = Parent::NextFreeMask << 1
Private Types
typedef SceneObject GrandParent
typedef Item Parent
Protected Attributes
bool allowManualFire
bool allowManualRotation
TurretShapeData * mDataBlock
bool mHeadingAllowed
Are heading changes allowed.
F32 mHeadingMax
Maximum heading limit from center, in radians.
F32 mHeadingRate
How fast the turret may yaw, in radians per second.
TSThread * mHeadingThread
TSThread * mImageStateThread
bool mPitchAllowed
Are pitch changes allowed.
F32 mPitchDown
Pitch down limit, in radians.
F32 mPitchRate
How fast the turret may pitch, in radians per second.
TSThread * mPitchThread
F32 mPitchUp
Pitch up limit, in radians.
TSThread * mRecoilThread
bool mRespawn
Point3F mRot
Current heading and pitch.
bool mSubclassTurretShapeHandlesScene
A subclass of TurretShape will handle all of the adding to the scene.
TurretStateDelta mTurretDelta
Protected Functions
_applyLimits(Point3F & rot)
_outsideLimits(Point3F & rot)
Return true if any angle is outside of the limits.
_setRotation(const Point3F & rot)
_updateNodes(const Point3F & rot)
onImage(U32 imageSlot, bool unmount)
Reimplemented from: ShapeBase
onImageRecoil(U32 imageSlot, ShapeBaseImageData::StateData::RecoilState )
Reimplemented from: ShapeBase
onImageStateAnimation(U32 imageSlot, const char * seqName, bool direction, bool scaleToState, F32 stateTimeOutValue)
Reimplemented from: ShapeBase
onUnmount(SceneObject * obj, S32 node)
Reimplemented from: ShapeBase
updateAnimation(F32 dt)
Public Functions
TurretShape()
~TurretShape()
advanceTime(F32 dt)
Reimplemented from: Item
Reimplemented by: AITurretShape
DECLARE_CONOBJECT(TurretShape )
doRespawn()
getAllowManualFire()
getAllowManualRotation()
getCameraParameters(F32 * min, F32 * max, Point3F * offset, MatrixF * rot)
Reimplemented from: ShapeBase
getCameraTransform(F32 * pos, MatrixF * mat)
Reimplemented from: ShapeBase
getImageTransform(U32 imageSlot, MatrixF * mat)
Reimplemented from: ShapeBase
getImageTransform(U32 imageSlot, S32 node, MatrixF * mat)
Reimplemented from: ShapeBase
getNodeTransform(S32 node, MatrixF & mat)
getRenderImageTransform(U32 imageSlot, MatrixF * mat, bool noEyeOffset)
Reimplemented from: ShapeBase
getRenderImageTransform(U32 imageSlot, S32 node, MatrixF * mat)
Reimplemented from: ShapeBase
getRenderWeaponMountTransform(F32 delta, S32 index, const MatrixF & xfm, MatrixF * outMat)
getStateName()
getTurretRotation()
getWeaponMountTransform(S32 index, const MatrixF & xfm, MatrixF * outMat)
getWorldNodeTransform(S32 node, MatrixF & mat)
interpolateTick(F32 delta)
Reimplemented from: Item
mountObject(SceneObject * obj, S32 node, const MatrixF & xfm)
Reimplemented from: SceneObject
onAdd()
Reimplemented from: Item
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: Item
onRemove()
Reimplemented from: Item
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: Item
Reimplemented by: AITurretShape
prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)
Reimplemented from: ShapeBase
Reimplemented by: AITurretShape
prepRenderImage(SceneRenderState * state)
Reimplemented from: Item
processTick(const Move * move)
Reimplemented from: Item
Reimplemented by: AITurretShape
readPacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: ShapeBase
setAllowManualFire(bool allow)
setAllowManualRotation(bool allow)
setTransform(const MatrixF & mat)
Reimplemented from: Item
Reimplemented by: AITurretShape
setTurretRotation(const Point3F & rot)
unmountObject(SceneObject * obj)
Reimplemented from: SceneObject
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: Item
Reimplemented by: AITurretShape
updateDamageLevel()
Reimplemented from: ShapeBase
updateMove(const Move * move)
writePacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: ShapeBase