torque Torque Game Engine Documentation
TGE Version 1.5.2

WheeledVehicle Class Reference

#include <wheeledVehicle.h>

Inheritance diagram for WheeledVehicle:

Inheritance graph
[legend]

Public Member Functions

 DECLARE_CONOBJECT (WheeledVehicle)
 WheeledVehicle ()
 ~WheeledVehicle ()
bool prepRenderImage (SceneState *state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState)
 Called when the SceneGraph is ready for the registration of RenderImages.
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 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

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

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 renderImage (SceneState *state, SceneRenderImage *image)
void extendWheels (bool clientHack=false)
void updateWheelThreads ()
void updateWheelParticles (F32 dt)
void updateEngineSound (F32 level)
void updateSquealSound (F32 level)
void updateJetSound ()
U32 getCollisionMask ()

Private Attributes

WheeledVehicleDatamDataBlock
 Datablock.
bool mBraking
TSThreadmTailLightThread
AUDIOHANDLE mJetSound
AUDIOHANDLE mEngineSound
AUDIOHANDLE mSquealSound
Wheel mWheel [WheeledVehicleData::MaxWheels]
TSThreadmSteeringThread

Data Structures

struct  Wheel

Member Typedef Documentation

typedef Vehicle WheeledVehicle::Parent [private]

Reimplemented from Vehicle.

Reimplemented in AIWheeledVehicle.


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::renderImage ( SceneState state,
SceneRenderImage image 
) [private, virtual]

Reimplemented from Vehicle.

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

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]

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(), addDepricatedField(), addGroup(), endGroup()

Reimplemented from Vehicle.

bool WheeledVehicle::prepRenderImage ( SceneState state,
const U32  stateKey,
const U32  startZone,
const bool  modifyBaseZoneState 
) [virtual]

Called when the SceneGraph is ready for the registration of RenderImages.

See also:
SceneState
Parameters:
state SceneState
stateKey State key of the current SceneState
startZone Base zone index
modifyBaseZoneState If true, the object needs to modify the zone state.

Reimplemented from ShapeBase.

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


Field Documentation

Datablock.

Reimplemented from Vehicle.

bool WheeledVehicle::mBraking [private]

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




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen