Vehicle

Engine/source/T3D/vehicles/vehicle.h

More...

Classes:

Rigid body methods

This method will get the velocity of the object, taking into account angular velocity.

Applies an impulse force.

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.

Gets the camera to world space transform matrix.

Mounted objects

mountObject(SceneObject * obj, S32 node, const MatrixF & xfm)

ex: Mount B to A at A's node N A.mountObject( B, N )

Protected Types

enum
CollisionFaceFlags {
  BodyCollision =  0x1
  WheelCollision = 0x2
}
enum
MaskBits {
  PositionMask = Parent::NextFreeMask << 0
  EnergyMask = Parent::NextFreeMask << 1
  NextFreeMask = Parent::NextFreeMask << 2
}

Private Types

Parent 

Public Static Attributes

Protected Functions

ObjectRenderInst delegate hooked up in prepBatchRender if GameBase::gShowBoundingBox is true.

ObjectRenderInst delegate hooked up in prepBatchRender if GameBase::gShowBoundingBox is true.

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
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.

Read data written with writePacketData() and update the object state.

bool

Resolve collision impacts Handle collision impacts, as opposed to contacts.

bool

Resolve contact forces Resolve contact forces using the "penalty" method.

bool

Sets the Object -> World transform.

Instructs this object to read state data previously packed with packUpdate.

bool

Update collision information Update the convex state and check for collisions.

Update the physics.

Write state information necessary to perform client side prediction of an object.

Protected Static Functions

The callback used in by the checkTriggers() method.

Public Functions

Advances simulation time for animations.

Disables collisions for this vehicle and all mounted objects.

Enables collisions for this vehicle and all mounted objects.

Returns the velocity of the vehicle.

Interpolates between move ticks.

bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)

Used from ShapeBase::_prepRenderImage() to submit render instances for the main shape or its mounted elements.

Processes a move event and updates object state once every 32 milliseconds.

Sets the level of energy for this object.

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

getCameraParameters(F32 * min, F32 * max, Point3F * offset, MatrixF * rot)

Reimplemented from: ShapeBase

getCameraTransform(F32 * pos, MatrixF * mat)

Reimplemented from: ShapeBase

Mounted objects

mountObject(SceneObject * obj, S32 node, const MatrixF & xfm)

Reimplemented from: SceneObject

Protected Types

CollisionFaceFlags

Enumerator

BodyCollision = 0x1
WheelCollision = 0x2
MaskBits

Enumerator

PositionMask = Parent::NextFreeMask << 0
EnergyMask = Parent::NextFreeMask << 1
NextFreeMask = Parent::NextFreeMask << 2

Private Types

typedef ShapeBase Parent 

Protected Attributes

bool inLiquid 
Point3F mCameraOffset 

3rd person camera

CollisionList mCollisionList 
CollisionList mContacts 
ShapeBaseConvex mConvex 
SimObjectPtr< ParticleEmitter > mDamageEmitterList [VehicleData::VC_NUM_DAMAGE_EMITTERS]
VehicleData * mDataBlock 
StateDelta mDelta 
bool mDisableMove 
SimObjectPtr< ParticleEmitter > mDustEmitterList [VehicleData::VC_NUM_DUST_EMITTERS]
bool mJetting 
PhysicsBody * mPhysicsRep 
S32 mPredictionCount 

Number of ticks to predict.

Rigid mRigid 
GFXStateBlockRef mSolidSB 
SimObjectPtr< ParticleEmitter > mSplashEmitterList [VehicleData::VC_NUM_SPLASH_EMITTERS]
Point2F mSteering 
F32 mThrottle 
SFXSource * mWakeSound 
Box3F mWorkingQueryBox 
S32 mWorkingQueryBoxCountDown 
S32 restCount 

Public Static Attributes

ClippedPolyList * sPolyList 
S32 sVehicleCount 

Protected Functions

_renderMassAndContacts(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)

ObjectRenderInst delegate hooked up in prepBatchRender if GameBase::gShowBoundingBox is true.

_renderMuzzleVector(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)

ObjectRenderInst delegate hooked up in prepBatchRender if GameBase::gShowBoundingBox is true.

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)

findContacts(Rigid & ns, CollisionList & cList)

getCollisionMask()

Reimplemented by: FlyingVehicle, HoverVehicle, WheeledVehicle

onNewDataBlock(GameBaseData * dptr, bool reload)

Reimplemented from: ShapeBase

Reimplemented by: FlyingVehicle, HoverVehicle, WheeledVehicle

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Reimplemented from: ShapeBase

Reimplemented by: WheeledVehicle

readPacketData(GameConnection * conn, BitStream * stream)

Reimplemented from: ShapeBase

Reimplemented by: 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

unpackUpdate(NetConnection * conn, BitStream * stream)

Reimplemented from: ShapeBase

Reimplemented by: WheeledVehicle

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.

updateDamageSmoke(F32 dt)

updateForces(F32 dt)

Reimplemented by: WheeledVehicle, FlyingVehicle, HoverVehicle

updateFroth(F32 dt)

updateLiftoffDust(F32 dt)

updateMove(const Move * move)

Reimplemented by: FlyingVehicle, HoverVehicle, WheeledVehicle

updatePos(F32 dt)

Update the physics.

updateWorkingCollisionSet(const U32 mask)

writePacketData(GameConnection * conn, BitStream * stream)

Reimplemented from: ShapeBase

Reimplemented by: 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

Vehicle()

_createPhysics()

advanceTime(F32 dt)

Reimplemented from: ShapeBase

Reimplemented by: WheeledVehicle

DECLARE_CONOBJECT(Vehicle )

disableCollision()

Reimplemented from: SceneObject

enableCollision()

Reimplemented from: SceneObject

getVelocity()

Reimplemented from: SceneObject

interpolateTick(F32 dt)

Reimplemented from: ProcessObject

onAdd()

Reimplemented from: ShapeBase

Reimplemented by: WheeledVehicle

onRemove()

Reimplemented from: ShapeBase

Reimplemented by: WheeledVehicle

prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)

Reimplemented from: ShapeBase

Reimplemented by: WheeledVehicle

processTick(const Move * move)

Reimplemented from: ShapeBase

Reimplemented by: WheeledVehicle

setEnergyLevel(F32 energy)

Reimplemented from: ShapeBase

Public Static Functions

consoleInit()

initPersistFields()