AITurretShape
Engine/source/T3D/turret/aiTurretShape.h
Classes:
Protected Types
MaskBits { TurretStateMask = Parent::TurretUpdateMask NextFreeMask = Parent::NextFreeMask }
Private Types
Parent
Protected Attributes
Ignore these objects when targeting.
bool
bool
Is the turret active?
Time till next state.
Information on the current target.
bool
Public Attributes
Protected Functions
_gainedTarget(ShapeBase * target)
_renderScanner(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)
ObjectRenderInst delegate hooked up in prepBatchRender if GameBase::gShowBoundingBox is true.
_scriptCallback(const char * function)
Utility function to call state script functions on the datablock.
bool
_testTargetLineOfSight(Point3F & aimPoint, ShapeBase * target, Point3F & sightPoint)
_trackTarget(F32 dt)
Public Functions
addPotentialTarget(ShapeBase * shape)
addToIgnoreList(ShapeBase * obj)
advanceTime(F32 dt)
Advances simulation time for animations.
getAimTransform(MatrixF & mat)
getIgnoreListObject(S32 index)
getScanTransform(MatrixF & mat)
bool
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.
processTick(const Move * move)
Processes a move event and updates object state once every 32 milliseconds.
removeFromIgnoreList(ShapeBase * obj)
setAllGunsFiring(bool fire)
setGunSlotFiring(S32 slot, bool fire)
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
setTurretState(U32 newState, bool force)
setTurretStateName(const char * newState, bool force)
setWeaponLeadVelocity(F32 velocity)
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
Public Static Functions
Detailed Description
Protected Types
MaskBits
Enumerator
- TurretStateMask = Parent::TurretUpdateMask
- NextFreeMask = Parent::NextFreeMask
Private Types
typedef TurretShape Parent
Protected Attributes
AITurretShapeData * mDataBlock
SimSet mIgnoreObjects
Ignore these objects when targeting.
SimObjectList mPotentialTargets
Box3F mScanBox
F32 mScanDistance
F32 mScanDistanceSquared
bool mScanForTargets
F32 mScanHeading
F32 mScanPitch
S32 mScanTickFrequency
S32 mScanTickFrequencyVariance
AITurretShapeData::StateData * mState
bool mStateActive
Is the turret active?
TSThread * mStateAnimThread
F32 mStateDelayTime
Time till next state.
TargetInfo mTarget
Information on the current target.
S32 mTicksToNextScan
bool mTrackTarget
Box3F mTransformedScanBox
F32 mWeaponLeadVelocitySquared
F32 mWeaponRangeSquared
Public Attributes
MatrixF mScanWorkspaceScanMat
MatrixF mScanWorkspaceScanWorldMat
Protected Functions
_cleanupPotentialTargets()
_cleanupTargetAndTurret()
_gainedTarget(ShapeBase * target)
_initState()
_lostTarget()
_performScan()
_renderScanner(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)
ObjectRenderInst delegate hooked up in prepBatchRender if GameBase::gShowBoundingBox is true.
_scriptCallback(const char * function)
Utility function to call state script functions on the datablock.
Parameters:
function | Function |
_setScanBox()
_testTargetLineOfSight(Point3F & aimPoint, ShapeBase * target, Point3F & sightPoint)
_trackTarget(F32 dt)
_updateTurretState(F32 dt)
Public Functions
AITurretShape()
~AITurretShape()
activateTurret()
addPotentialTarget(ShapeBase * shape)
addToIgnoreList(ShapeBase * obj)
advanceTime(F32 dt)
Reimplemented from: TurretShape
clearIgnoreList()
deactivateTurret()
DECLARE_CONOBJECT(AITurretShape )
getAimTransform(MatrixF & mat)
getIgnoreListObject(S32 index)
getMaxScanDistance()
getMaxScanDistanceSquared()
getMaxScanHeading()
getMaxScanPitch()
getScanTransform(MatrixF & mat)
getTarget()
getWeaponLeadVelocity()
hasTarget()
ignoreListCount()
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: TurretShape
prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)
Reimplemented from: TurretShape
processTick(const Move * move)
Reimplemented from: TurretShape
recenterTurret()
removeFromIgnoreList(ShapeBase * obj)
resetTarget()
setAllGunsFiring(bool fire)
setGunSlotFiring(S32 slot, bool fire)
setTransform(const MatrixF & mat)
Reimplemented from: TurretShape
setTurretState(U32 newState, bool force)
setTurretStateName(const char * newState, bool force)
setWeaponLeadVelocity(F32 velocity)
startScanForTargets()
startTrackingTarget()
stopScanForTargets()
stopTrackingTarget()
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: TurretShape