WheeledVehicle Class Reference

#include <wheeledVehicle.h>

Inheritance diagram for WheeledVehicle:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 DECLARE_CONOBJECT (WheeledVehicle)
 WheeledVehicle ()
 ~WheeledVehicle ()
bool onAdd ()
 Called when the object is added to the sim.
void onRemove ()
 Called when the object is removed from the sim.
void advanceTime (F32 dt)
 Advances simulation time for animations.
bool buildPolyList (AbstractPolyList *polyList, const Box3F &box, const SphereF &sphere)
 Builds a polylist of the polygons in this object returns true if successful.
S32 getWheelCount ()
WheelgetWheel (U32 index)
void setWheelSteering (S32 wheel, F32 steering)
void setWheelPowered (S32 wheel, bool powered)
void setWheelTire (S32 wheel, WheeledVehicleTire *)
void setWheelSpring (S32 wheel, WheeledVehicleSpring *)
void getWheelInstAndTransform (U32 wheel, TSShapeInstance **inst, MatrixF *xfrm) const
void writePacketData (GameConnection *conn, BitStream *stream)
 Write state information necessary to perform client side prediction of an object.
void readPacketData (GameConnection *conn, BitStream *stream)
 Read data written with writePacketData() and update the object state.
U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream)
 Instructs this object to pack its state for transfer over the network.
void unpackUpdate (NetConnection *conn, BitStream *stream)
 Instructs this object to read state data previously packed with packUpdate.

Static Public Member Functions

static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.

Private Types

typedef Vehicle Parent
 WheelMask = Parent::NextFreeMask << 0
 NextFreeMask = Parent::NextFreeMask << 1
enum  MaskBits {
  WheelMask = Parent::NextFreeMask << 0,
  NextFreeMask = Parent::NextFreeMask << 1
}

Private Member Functions

bool onNewDataBlock (GameBaseData *dptr)
 Called when a new datablock is set.
void processTick (const Move *move)
 Processes a move event and updates object state once every 32 milliseconds.
void updateMove (const Move *move)
void updateForces (F32 dt)
void extendWheels (bool clientHack=false)
void prepBatchRender (SceneState *state, S32 mountedImageIndex)
void updateWheelThreads ()
void updateWheelParticles (F32 dt)
void updateEngineSound (F32 level)
void updateSquealSound (F32 level)
void updateJetSound ()
virtual U32 getCollisionMask ()

Private Attributes

WheeledVehicleDatamDataBlock
 Datablock.
bool mBraking
TSThreadmTailLightThread
SFXSourcemJetSound
SFXSourcemEngineSound
SFXSourcemSquealSound
Wheel mWheel [WheeledVehicleData::MaxWheels]
TSThreadmSteeringThread

Classes

struct  Wheel

Member Typedef Documentation

typedef Vehicle WheeledVehicle::Parent [private]

Reimplemented from Vehicle.


Member Enumeration Documentation

enum WheeledVehicle::MaskBits [private]

Enumerator:
WheelMask 
NextFreeMask 

Reimplemented from Vehicle.


Constructor & Destructor Documentation

WheeledVehicle::WheeledVehicle (  ) 

WheeledVehicle::~WheeledVehicle (  ) 


Member Function Documentation

bool WheeledVehicle::onNewDataBlock ( GameBaseData dptr  )  [private, virtual]

Called when a new datablock is set.

This allows subclasses to appropriately handle new datablocks.

See also:
setDataBlock()
Parameters:
dptr New datablock

Reimplemented from Vehicle.

void WheeledVehicle::processTick ( const Move move  )  [private, virtual]

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

This takes place both on the client and server, every 32 milliseconds (1 tick).

See also:
ProcessList
Parameters:
move Move event corresponding to this tick, or NULL.

Reimplemented from Vehicle.

void WheeledVehicle::updateMove ( const Move move  )  [private, virtual]

Reimplemented from Vehicle.

void WheeledVehicle::updateForces ( F32  dt  )  [private, virtual]

Reimplemented from Vehicle.

void WheeledVehicle::extendWheels ( bool  clientHack = false  )  [private]

void WheeledVehicle::prepBatchRender ( SceneState state,
S32  mountedImageIndex 
) [private, virtual]

Reimplemented from ShapeBase.

void WheeledVehicle::updateWheelThreads (  )  [private]

void WheeledVehicle::updateWheelParticles ( F32  dt  )  [private]

void WheeledVehicle::updateEngineSound ( F32  level  )  [private]

void WheeledVehicle::updateSquealSound ( F32  level  )  [private]

void WheeledVehicle::updateJetSound (  )  [private]

virtual U32 WheeledVehicle::getCollisionMask (  )  [private, virtual]

Reimplemented from Vehicle.

WheeledVehicle::DECLARE_CONOBJECT ( WheeledVehicle   ) 

static void WheeledVehicle::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDeprecatedField(), addGroup(), endGroup()

Reimplemented from Vehicle.

bool WheeledVehicle::onAdd (  )  [virtual]

Called when the object is added to the sim.

Reimplemented from Vehicle.

void WheeledVehicle::onRemove (  )  [virtual]

Called when the object is removed from the sim.

Reimplemented from Vehicle.

void WheeledVehicle::advanceTime ( F32  dt  )  [virtual]

Advances simulation time for animations.

This is called every frame.

Parameters:
dt Time since last advance call

Reimplemented from Vehicle.

bool WheeledVehicle::buildPolyList ( AbstractPolyList polyList,
const Box3F box,
const SphereF sphere 
) [virtual]

Builds a polylist of the polygons in this object returns true if successful.

Parameters:
polyList Returned polylist (out)
box Not used
sphere Not used

Reimplemented from ShapeBase.

S32 WheeledVehicle::getWheelCount (  ) 

Wheel* WheeledVehicle::getWheel ( U32  index  )  [inline]

void WheeledVehicle::setWheelSteering ( S32  wheel,
F32  steering 
)

void WheeledVehicle::setWheelPowered ( S32  wheel,
bool  powered 
)

void WheeledVehicle::setWheelTire ( S32  wheel,
WheeledVehicleTire  
)

void WheeledVehicle::setWheelSpring ( S32  wheel,
WheeledVehicleSpring  
)

void WheeledVehicle::getWheelInstAndTransform ( U32  wheel,
TSShapeInstance **  inst,
MatrixF xfrm 
) const

void WheeledVehicle::writePacketData ( GameConnection conn,
BitStream stream 
) [virtual]

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

This information is sent only to the controling object. For example, if you are a client controlling a Player, the server uses writePacketData() instead of packUpdate() to generate the data you receive.

Parameters:
conn Connection for which we're generating this data.
stream Bitstream for output.

Reimplemented from Vehicle.

void WheeledVehicle::readPacketData ( GameConnection conn,
BitStream stream 
) [virtual]

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

Parameters:
conn Connection for which we're generating this data.
stream Bitstream to read.

Reimplemented from Vehicle.

U32 WheeledVehicle::packUpdate ( NetConnection conn,
U32  mask,
BitStream stream 
) [virtual]

Instructs this object to pack its state for transfer over the network.

Parameters:
conn Net connection being used
mask Mask indicating fields to transmit.
stream Bitstream to pack data to
Returns:
Any bits which were not dealt with. The value is stored by the networking system. Don't set bits you weren't passed.

Reimplemented from Vehicle.

void WheeledVehicle::unpackUpdate ( NetConnection conn,
BitStream stream 
) [virtual]

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

Parameters:
conn Net connection being used
stream stream to read from

Reimplemented from Vehicle.


Member Data Documentation

Datablock.

Reimplemented from Vehicle.

Wheel WheeledVehicle::mWheel[WheeledVehicleData::MaxWheels] [private]