RigidBodyComponent
Engine/source/T3D/components/physics/rigidBodyComponent.h
Private Types
MaskBits { PositionMask = Parent::NextFreeMask << 0 FreezeMask = Parent::NextFreeMask << 1 StateMask = Parent::NextFreeMask << 2 VelocityMask = Parent::NextFreeMask << 3 NextFreeMask = Parent::NextFreeMask << 4 }
SimType { SimType_ClientOnly SimType_ServerOnly SimType_ClientServer SimType_Bits = 3 }
Parent
Private Attributes
The abstracted physics actor.
mRenderState [2]
The previous and current render states.
enum RigidBodyComponent::SimType
The current physics state.
Private 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.
Public Functions
_onPhysicsReset(PhysicsResetEvent reset)
componentAddedToOwner(Component * comp)
componentRemovedFromOwner(Component * comp)
bool
onAdd()
Called when the object is added to the sim.
ownerTransformSet(MatrixF * mat)
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Instructs this object to pack its state for transfer over the network.
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.
updatePhysics(PhysicsCollision * collision)
Public Static Functions
Detailed Description
Private Types
MaskBits
Enumerator
- PositionMask = Parent::NextFreeMask << 0
- FreezeMask = Parent::NextFreeMask << 1
- StateMask = Parent::NextFreeMask << 2
- VelocityMask = Parent::NextFreeMask << 3
- NextFreeMask = Parent::NextFreeMask << 4
SimType
Enumerator
- SimType_ClientOnly
This physics representation only exists on the client world and the server only does ghosting.
- SimType_ServerOnly
The physics representation only exists on the server world and the client gets delta updates for rendering.
- SimType_ClientServer
The physics representation exists on the client and the server worlds with corrections occuring when the client gets out of sync.
- SimType_Bits = 3
The bits used to pack the SimType field.
typedef Component Parent
Private Attributes
F32 mAngularDamping
F32 mAngularSleepThreshold
F32 mBuoyancyDensity
F32 mDynamicFriction
F32 mLinearDamping
F32 mLinearSleepThreshold
F32 mMass
CollisionComponent * mOwnerColComponent
PhysicsBody * mPhysicsRep
The abstracted physics actor.
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.
F32 mRestitution
enum RigidBodyComponent::SimType mSimType
PhysicsState mState
The current physics state.
F32 mStaticFriction
F32 mWaterDampingScale
PhysicsWorld * mWorld
Private 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.
Public Functions
RigidBodyComponent()
~RigidBodyComponent()
_onPhysicsReset(PhysicsResetEvent reset)
applyImpulse(const Point3F & pos, const VectorF & vec)
applyRadialImpulse(const Point3F & origin, F32 radius, F32 magnitude)
componentAddedToOwner(Component * comp)
Reimplemented from: Component
componentRemovedFromOwner(Component * comp)
Reimplemented from: Component
DECLARE_CONOBJECT(RigidBodyComponent )
findContact()
getMass()
getVelocity()
onAdd()
Reimplemented from: Component
onComponentAdd()
Reimplemented from: Component
onComponentRemove()
Reimplemented from: Component
onRemove()
Reimplemented from: Component
ownerTransformSet(MatrixF * mat)
Reimplemented from: Component
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: Component
processTick()
Reimplemented from: Component
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: Component
updateContainerForces()
updatePhysics(PhysicsCollision * collision)
