PhysicsShape
Engine/source/T3D/physics/physicsShape.h
A simple single body dynamic physics object.
Protected Types
MaskBits { StateMask = Parent::NextFreeMask << 0 ResetPosMask = Parent::NextFreeMask << 1 DamageMask = Parent::NextFreeMask << 2 NextFreeMask = Parent::NextFreeMask << 3 }
Private Types
Parent
Protected Attributes
bool
True if the PhysicsShape has been destroyed ( gameplay ).
If a specified to create one in the PhysicsShape data, this is the subshape created when this PhysicsShape is destroyed.
The abstracted physics actor.
bool
Enables automatic playing of the animation named "ambient" (if it exists) when the PhysicsShape is loaded.
mRenderState [2]
The previous and current render states.
The rendered shape.
The current physics state.
Protected Static Attributes
bool
If true then no corrections are sent from the server and/or applied from the client.
bool
If true then no smoothing is done on the client when applying server corrections.
Protected Functions
Public Functions
advanceTime(F32 dt)
Advances simulation time for animations.
applyForce(const Point3F & force)
applyImpulse(const Point3F & pos, const VectorF & vec)
Applies an impulse force to this object.
applyRadialImpulse(const Point3F & origin, F32 radius, F32 magnitude)
Applies a radial impulse to the object using the impulse origin and force.
applyTorque(const Point3F & torque)
Returns the PhysicsShapeData datablock.
Gets the velocity of the object.
Called after any property of the object is changed in the world editor.
interpolateTick(F32 delta)
Interpolates between tick events.
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.
prepRenderImage(SceneRenderState * state)
Called when the SceneManager is ready for the registration of render instances.
processTick(const Move * move)
Processes a move event and updates object state once every 32 milliseconds.
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
Save the current transform as where we return to when a physics reset event occurs.
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
Public Static Functions
Detailed Description
A simple single body dynamic physics object.
Protected Types
MaskBits
Enumerator
- StateMask = Parent::NextFreeMask << 0
- ResetPosMask = Parent::NextFreeMask << 1
- DamageMask = Parent::NextFreeMask << 2
- NextFreeMask = Parent::NextFreeMask << 3
Private Types
typedef GameBase Parent
Protected Attributes
S32 mAmbientSeq
TSThread * mAmbientThread
bool mDestroyed
True if the PhysicsShape has been destroyed ( gameplay ).
SimObjectPtr< PhysicsShape > mDestroyedShape
If a specified to create one in the PhysicsShape data, this is the subshape created when this PhysicsShape is destroyed.
Is only assigned (non null) on the serverside PhysicsShape.
PhysicsBody * mPhysicsRep
The abstracted physics actor.
bool mPlayAmbient
Enables automatic playing of the animation named "ambient" (if it exists) when the PhysicsShape is loaded.
PhysicsState mRenderState [2]
The previous and current render states.
MatrixF mResetPos
The starting position to place the shape when the level begins or is reset.
TSShapeInstance * mShapeInst
The rendered shape.
PhysicsState mState
The current physics state.
PhysicsWorld * mWorld
Protected Static Attributes
bool smNoCorrections
If true then no corrections are sent from the server and/or applied from the client.
This is only ment for debugging.
bool smNoSmoothing
If true then no smoothing is done on the client when applying server corrections.
This is only ment for debugging.
Protected Functions
_applyCorrection(const MatrixF & mat)
_createShape()
_initAmbient()
_onPhysicsReset(PhysicsResetEvent reset)
_updateContainerForces()
Public Functions
PhysicsShape()
~PhysicsShape()
advanceTime(F32 dt)
Reimplemented from: ProcessObject
applyForce(const Point3F & force)
applyImpulse(const Point3F & pos, const VectorF & vec)
Reimplemented from: SceneObject
applyRadialImpulse(const Point3F & origin, F32 radius, F32 magnitude)
Reimplemented from: SceneObject
applyTorque(const Point3F & torque)
DECLARE_CONOBJECT(PhysicsShape )
destroy()
getDataBlock()
Returns the PhysicsShapeData datablock.
getMass()
Reimplemented from: SceneObject
getVelocity()
Reimplemented from: SceneObject
inspectPostApply()
Reimplemented from: GameBase
interpolateTick(F32 delta)
Reimplemented from: GameBase
isDestroyed()
onAdd()
Reimplemented from: GameBase
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: GameBase
onRemove()
Reimplemented from: GameBase
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: GameBase
prepRenderImage(SceneRenderState * state)
Reimplemented from: SceneObject
processTick(const Move * move)
Reimplemented from: GameBase
restore()
setScale(const VectorF & scale)
Reimplemented from: SceneObject
setTransform(const MatrixF & mat)
Reimplemented from: SceneObject
storeRestorePos()
Save the current transform as where we return to when a physics reset event occurs.
This is automatically set in onAdd but some manipulators such as Prefab need to make use of this.
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: GameBase