WheeledVehicle
Engine/source/T3D/vehicles/wheeledVehicle.h
Classes:
Private Types
MaskBits { WheelMask = Parent::NextFreeMask << 0 NextFreeMask = Parent::NextFreeMask << 1 }
Parent
Private Attributes
bool
Wheel
mWheel [WheeledVehicleData::MaxWheels]
Private Functions
extendWheels(bool clientHack)
Extend the wheels The wheels are extended until they contact a surface.
bool
onNewDataBlock(GameBaseData * dptr, bool reload)
Called when a new datablock is set.
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.
updateEngineSound(F32 level)
Update engine sound This method is only invoked by clients.
updateForces(F32 dt)
Update the rigid body forces on the vehicle This method calculates the forces acting on the body, including gravity, suspension & tire forces.
Update jet sound This method is only invoked by clients.
updateMove(const Move * move)
updateSquealSound(F32 level)
Update wheel skid sound This method is only invoked by clients.
Update wheel particles effects These animations are purely cosmetic and this method is only invoked on the client.
Update wheel steering and suspension threads.
Public Functions
advanceTime(F32 dt)
Interpolates between move ticks.
bool
buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)
Build a collision polylist The polylist is filled with polygons representing the collision volume and the wheels.
getWheelInstAndTransform(U32 wheel, TSShapeInstance ** inst, MatrixF * xfrm)
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.
readPacketData(GameConnection * conn, BitStream * stream)
Read data written with writePacketData() and update the object state.
setWheelPowered(S32 wheel, bool powered)
setWheelSpring(S32 wheel, WheeledVehicleSpring * )
setWheelSteering(S32 wheel, F32 steering)
setWheelTire(S32 wheel, WheeledVehicleTire * )
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
writePacketData(GameConnection * conn, BitStream * stream)
Write state information necessary to perform client side prediction of an object.
Public Static Functions
Detailed Description
Private Types
MaskBits
Enumerator
- WheelMask = Parent::NextFreeMask << 0
- NextFreeMask = Parent::NextFreeMask << 1
typedef Vehicle Parent
Private Attributes
bool mBraking
WheeledVehicleData * mDataBlock
SFXSource * mEngineSound
SFXSource * mJetSound
SFXSource * mSquealSound
TSThread * mSteeringThread
TSThread * mTailLightThread
Wheel mWheel [WheeledVehicleData::MaxWheels]
Private Functions
extendWheels(bool clientHack)
Extend the wheels The wheels are extended until they contact a surface.
The extension is instantaneous. The wheels are extended before force calculations and also on during client side interpolation (so that the wheels are glued to the ground).
getCollisionMask()
Reimplemented from: Vehicle
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: Vehicle
prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)
Reimplemented from: Vehicle
processTick(const Move * move)
Reimplemented from: Vehicle
updateEngineSound(F32 level)
Update engine sound This method is only invoked by clients.
updateForces(F32 dt)
Reimplemented from: Vehicle
updateJetSound()
Update jet sound This method is only invoked by clients.
updateMove(const Move * move)
Reimplemented from: Vehicle
updateSquealSound(F32 level)
Update wheel skid sound This method is only invoked by clients.
updateWheelParticles(F32 dt)
Update wheel particles effects These animations are purely cosmetic and this method is only invoked on the client.
Particles are emitted as long as the moving.
updateWheelThreads()
Update wheel steering and suspension threads.
These animations are purely cosmetic and this method is only invoked on the client.
Public Functions
WheeledVehicle()
~WheeledVehicle()
advanceTime(F32 dt)
Reimplemented from: Vehicle
buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)
Reimplemented from: ShapeBase
DECLARE_CONOBJECT(WheeledVehicle )
getWheel(U32 index)
getWheelCount()
getWheelInstAndTransform(U32 wheel, TSShapeInstance ** inst, MatrixF * xfrm)
onAdd()
Reimplemented from: Vehicle
onRemove()
Reimplemented from: Vehicle
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: Vehicle
readPacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: Vehicle
setWheelPowered(S32 wheel, bool powered)
setWheelSpring(S32 wheel, WheeledVehicleSpring * )
setWheelSteering(S32 wheel, F32 steering)
setWheelTire(S32 wheel, WheeledVehicleTire * )
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: Vehicle
writePacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: Vehicle