RigidShape
Engine/source/T3D/rigidShape.h
Classes:
Rigid body methods
getVelocity(const Point3F & r, Point3F * vel)
This method will get the velocity of the object, taking into account angular velocity.
Forces the client to jump to the RigidShape's transform rather then warp to it.
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.
Protected Types
MaskBits { PositionMask = Parent::NextFreeMask << 0 EnergyMask = Parent::NextFreeMask << 1 FreezeMask = Parent::NextFreeMask << 2 ForceMoveMask = Parent::NextFreeMask << 3 NextFreeMask = Parent::NextFreeMask << 4 }
Private Types
Parent
Private Attributes
Protected Attributes
bool
3rd person camera
bool
mDustEmitterList [RigidShapeData::VC_NUM_DUST_EMITTERS]
Number of ticks to predict.
mSplashEmitterList [RigidShapeData::VC_NUM_SPLASH_EMITTERS]
Public Static Attributes
Protected Functions
_renderMassAndContacts(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)
Check collisions with trigger and items Perform a container search using the current bounding box of the main body, wheels are not included.
bool
collidingWithWater(Point3F & waterHeight)
bool
onNewDataBlock(GameBaseData * dptr, bool reload)
Called when a new datablock is set.
readPacketData(GameConnection * conn, BitStream * stream)
Read data written with writePacketData() and update the object state.
bool
resolveCollision(Rigid & ns, CollisionList & cList)
Resolve collision impacts Handle collision impacts, as opposed to contacts.
bool
resolveContacts(Rigid & ns, CollisionList & cList, F32 dt)
Resolve contact forces Resolve contact forces using the "penalty" method.
bool
resolveDisplacement(Rigid & ns, CollisionState * state, F32 dt)
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
bool
updateCollision(F32 dt)
Update collision information Update the convex state and check for collisions.
updateDustTrail(F32 dt)
updateForces(F32 dt)
updateFroth(F32 dt)
updateLiftoffDust(F32 dt)
updateMove(const Move * move)
writePacketData(GameConnection * conn, BitStream * stream)
Write state information necessary to perform client side prediction of an object.
Protected Static Functions
findCallback(SceneObject * obj, void * key)
The callback used in by the checkTriggers() method.
Public Functions
advanceTime(F32 dt)
Advances simulation time for animations.
Disables collisions for this shape.
Enables collisions for this shape.
Returns the velocity of the shape.
interpolateTick(F32 dt)
Interpolates between move ticks.
bool
onAdd()
Called when the object is added to the sim.
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.
setEnergyLevel(F32 energy)
Sets the level of energy for this object.
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
Public Static Functions
Detailed Description
Rigid body methods
getVelocity(const Point3F & r, Point3F * vel)
This method will get the velocity of the object, taking into account angular velocity.
Parameters:
r | Point on the object you want the velocity of, relative to Center of Mass |
vel | Velocity (out) |
applyImpulse(const Point3F & r, const Point3F & impulse)
Reimplemented from: ShapeBase
forceClientTransform()
Forces the client to jump to the RigidShape's transform rather then warp to it.
getCameraParameters(F32 * min, F32 * max, Point3F * offset, MatrixF * rot)
Reimplemented from: ShapeBase
Reimplemented by: Vehicle
getCameraTransform(F32 * pos, MatrixF * mat)
Reimplemented from: ShapeBase
Reimplemented by: Vehicle
Protected Types
MaskBits
Enumerator
- PositionMask = Parent::NextFreeMask << 0
- EnergyMask = Parent::NextFreeMask << 1
- FreezeMask = Parent::NextFreeMask << 2
- ForceMoveMask = Parent::NextFreeMask << 3
- NextFreeMask = Parent::NextFreeMask << 4
Private Types
typedef ShapeBase Parent
Private Attributes
RigidShapeData * mDataBlock
SimObjectPtr< ParticleEmitter > mDustTrailEmitter
Protected Attributes
bool inLiquid
Point3F mCameraOffset
3rd person camera
CollisionList mCollisionList
CollisionList mContacts
ShapeBaseConvex mConvex
StateDelta mDelta
bool mDisableMove
SimObjectPtr< ParticleEmitter > mDustEmitterList [RigidShapeData::VC_NUM_DUST_EMITTERS]
PhysicsBody * mPhysicsRep
S32 mPredictionCount
Number of ticks to predict.
GFXStateBlockRef mSolidSB
SimObjectPtr< ParticleEmitter > mSplashEmitterList [RigidShapeData::VC_NUM_SPLASH_EMITTERS]
Box3F mWorkingQueryBox
S32 mWorkingQueryBoxCountDown
S32 restCount
Public Static Attributes
ClippedPolyList * sPolyList
Public Attributes
Rigid mRigid
Protected Functions
_renderMassAndContacts(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)
checkTriggers()
Check collisions with trigger and items Perform a container search using the current bounding box of the main body, wheels are not included.
This method should only be called on the server.
collidingWithWater(Point3F & waterHeight)
getCollisionMask()
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: GameBase
Reimplemented by: FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle
readPacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: FlyingVehicle, Vehicle, WheeledVehicle
resolveCollision(Rigid & ns, CollisionList & cList)
Resolve collision impacts Handle collision impacts, as opposed to contacts.
Impulses are calculated based on standard collision resolution formulas.
resolveContacts(Rigid & ns, CollisionList & cList, F32 dt)
Resolve contact forces Resolve contact forces using the "penalty" method.
Forces are generated based on the depth of penetration and the moment of inertia at the point of contact.
resolveDisplacement(Rigid & ns, CollisionState * state, F32 dt)
setPosition(const Point3F & pos, const QuatF & rot)
setRenderPosition(const Point3F & pos, const QuatF & rot)
setTransform(const MatrixF & mat)
Reimplemented from: SceneObject
updateCollision(F32 dt)
Update collision information Update the convex state and check for collisions.
If the object is in collision, impact and contact forces are generated.
updateDustTrail(F32 dt)
updateForces(F32 dt)
updateFroth(F32 dt)
updateLiftoffDust(F32 dt)
updateMove(const Move * move)
updatePos(F32 dt)
Update the physics.
updateWorkingCollisionSet(const U32 mask)
writePacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: FlyingVehicle, Vehicle, WheeledVehicle
Protected Static Functions
findCallback(SceneObject * obj, void * key)
The callback used in by the checkTriggers() method.
The checkTriggers method uses a container search which will invoke this callback on each obj that matches.
Public Functions
RigidShape()
~RigidShape()
_createPhysics()
advanceTime(F32 dt)
Reimplemented from: ProcessObject
Reimplemented by: FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle
DECLARE_CONOBJECT(RigidShape )
disableCollision()
Reimplemented from: SceneObject
enableCollision()
Reimplemented from: SceneObject
freezeSim(bool frozen)
getVelocity()
Reimplemented from: SceneObject
interpolateTick(F32 dt)
Reimplemented from: GameBase
onAdd()
Reimplemented from: GameBase
Reimplemented by: FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle
onRemove()
Reimplemented from: GameBase
Reimplemented by: FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle
prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)
Reimplemented from: ShapeBase
Reimplemented by: Vehicle, WheeledVehicle
processTick(const Move * move)
Reimplemented from: GameBase
Reimplemented by: Vehicle, WheeledVehicle
reset()
setEnergyLevel(F32 energy)
Reimplemented from: ShapeBase
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle