Vehicle Class Reference#include <vehicle.h>
Inheritance diagram for Vehicle:
[legend]
|
Public Member Functions |
| Vehicle () |
void | processTick (const Move *move) |
| Processes a move event and updates object state once every 32 milliseconds.
|
bool | onAdd () |
| Called when the object is added to the sim.
|
void | onRemove () |
| Called when the object is removed from the sim.
|
Point2F | getSteering () |
void | interpolateTick (F32 dt) |
| Interpolates between move ticks.
|
void | advanceTime (F32 dt) |
| Advances simulation time for animations.
|
void | disableCollision () |
| Disables collisions for this vehicle and all mounted objects.
|
void | enableCollision () |
| Enables collisions for this vehicle and all mounted objects.
|
Point3F | getVelocity () const |
| Returns the velocity of the vehicle.
|
void | setEnergyLevel (F32 energy) |
| Sets the level of energy for this object.
|
| DECLARE_CONOBJECT (Vehicle) |
|
void | getVelocity (const Point3F &r, Point3F *vel) |
| This method will get the velocity of the object, taking into account angular velocity.
|
void | applyImpulse (const Point3F &r, const Point3F &impulse) |
| Applies an impulse force.
|
void | 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.
|
void | getCameraTransform (F32 *pos, MatrixF *mat) |
| Gets the camera transform.
|
void | mountObject (ShapeBase *obj, U32 node) |
| Mount an object to a mount point.
|
Static Public Member Functions |
static void | initPersistFields () |
| Register dynamic fields in a subclass of ConsoleObject.
|
Static Public Attributes |
static ClippedPolyList * | sPolyList |
static S32 | sVehicleCount |
Protected Types |
enum | CollisionFaceFlags {
BodyCollision = 0x1,
WheelCollision = 0x2
} |
enum | MaskBits {
PositionMask = Parent::NextFreeMask << 0,
EnergyMask = Parent::NextFreeMask << 1,
NextFreeMask = Parent::NextFreeMask << 2
} |
Protected Member Functions |
bool | onNewDataBlock (GameBaseData *dptr) |
| Called when a new datablock is set.
|
void | updatePos (F32 dt) |
bool | updateCollision (F32 dt) |
bool | resolveCollision (Rigid &ns, CollisionList &cList) |
bool | resolveContacts (Rigid &ns, CollisionList &cList, F32 dt) |
bool | resolveDisplacement (Rigid &ns, CollisionState *state, F32 dt) |
bool | findContacts (Rigid &ns, CollisionList &cList) |
void | checkTriggers () |
void | setPosition (const Point3F &pos, const QuatF &rot) |
void | setRenderPosition (const Point3F &pos, const QuatF &rot) |
void | setTransform (const MatrixF &mat) |
| Sets the Object -> World transform.
|
virtual void | updateMove (const Move *move) |
virtual void | updateForces (F32 dt) |
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.
|
void | updateLiftoffDust (F32 dt) |
void | updateDamageSmoke (F32 dt) |
void | updateWorkingCollisionSet (const U32 mask) |
virtual U32 | getCollisionMask () |
void | updateFroth (F32 dt) |
bool | collidingWithWater (Point3F &waterHeight) |
void | renderImage (SceneState *state, SceneRenderImage *image) |
void | renderMountedImage (SceneState *state, ShapeImageRenderImage *image) |
| Renders a mounted object.
|
virtual bool | getAIMove (Move *move) |
Static Protected Member Functions |
static void | findCallback (SceneObject *obj, void *key) |
Protected Attributes |
StateDelta | mDelta |
S32 | mPredictionCount |
| Number of ticks to predict.
|
VehicleData * | mDataBlock |
| Datablock.
|
bool | inLiquid |
AUDIOHANDLE | waterWakeHandle |
Point3F | mCameraOffset |
| 3rd person camera
|
Point2F | mSteering |
F32 | mThrottle |
bool | mJetting |
bool | mDisableMove |
CollisionList | mCollisionList |
CollisionList | mContacts |
Rigid | mRigid |
ShapeBaseConvex | mConvex |
int | restCount |
ParticleEmitter * | mDustEmitterList [VehicleData::VC_NUM_DUST_EMITTERS] |
ParticleEmitter * | mDamageEmitterList [VehicleData::VC_NUM_DAMAGE_EMITTERS] |
ParticleEmitter * | mSplashEmitterList [VehicleData::VC_NUM_SPLASH_EMITTERS] |
Private Types |
typedef ShapeBase | Parent |
Data Structures |
struct | StateDelta |
Member Typedef Documentation
Member Enumeration Documentation
- Enumerator:
-
BodyCollision |
|
WheelCollision |
|
- Enumerator:
-
PositionMask |
|
EnergyMask |
|
NextFreeMask |
|
Reimplemented in WheeledVehicle.
Constructor & Destructor Documentation
Member Function Documentation
bool Vehicle::onNewDataBlock |
( |
GameBaseData * |
dptr |
) |
[protected, virtual] |
void Vehicle::updatePos |
( |
F32 |
dt |
) |
[protected] |
bool Vehicle::updateCollision |
( |
F32 |
dt |
) |
[protected] |
void Vehicle::checkTriggers |
( |
|
) |
[protected] |
void Vehicle::setPosition |
( |
const Point3F & |
pos, |
|
|
const QuatF & |
rot | |
|
) |
| | [protected] |
void Vehicle::setRenderPosition |
( |
const Point3F & |
pos, |
|
|
const QuatF & |
rot | |
|
) |
| | [protected] |
void Vehicle::setTransform |
( |
const MatrixF & |
mat |
) |
[protected, virtual] |
Sets the Object -> World transform.
- Parameters:
-
Reimplemented from SceneObject.
virtual void Vehicle::updateMove |
( |
const Move * |
move |
) |
[protected, virtual] |
virtual void Vehicle::updateForces |
( |
F32 |
dt |
) |
[protected, 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 ShapeBase.
Reimplemented in FlyingVehicle, and WheeledVehicle.
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 ShapeBase.
Reimplemented in FlyingVehicle, HoverVehicle, and WheeledVehicle.
void Vehicle::updateLiftoffDust |
( |
F32 |
dt |
) |
[protected] |
void Vehicle::updateDamageSmoke |
( |
F32 |
dt |
) |
[protected] |
void Vehicle::updateWorkingCollisionSet |
( |
const U32 |
mask |
) |
[protected] |
virtual U32 Vehicle::getCollisionMask |
( |
|
) |
[protected, virtual] |
void Vehicle::updateFroth |
( |
F32 |
dt |
) |
[protected] |
bool Vehicle::collidingWithWater |
( |
Point3F & |
waterHeight |
) |
[protected] |
Renders a mounted object.
- Parameters:
-
| state | State of scene |
| image | ShapeImage to render |
Reimplemented from ShapeBase.
virtual bool Vehicle::getAIMove |
( |
Move * |
move |
) |
[protected, virtual] |
static void Vehicle::initPersistFields |
( |
|
) |
[static] |
void Vehicle::processTick |
( |
const Move * |
move |
) |
[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 ShapeBase.
Reimplemented in WheeledVehicle.
bool Vehicle::onAdd |
( |
|
) |
[virtual] |
void Vehicle::onRemove |
( |
|
) |
[virtual] |
Point2F Vehicle::getSteering |
( |
|
) |
[inline] |
void Vehicle::interpolateTick |
( |
F32 |
dt |
) |
[virtual] |
Interpolates between move ticks.
- See also:
- processTick
- Parameters:
-
| dt | Change in time between the last call and this call to the function |
Reimplemented from GameBase.
void Vehicle::advanceTime |
( |
F32 |
dt |
) |
[virtual] |
void Vehicle::disableCollision |
( |
|
) |
[virtual] |
Disables collisions for this vehicle and all mounted objects.
Reimplemented from SceneObject.
void Vehicle::enableCollision |
( |
|
) |
[virtual] |
Enables collisions for this vehicle and all mounted objects.
Reimplemented from SceneObject.
Point3F Vehicle::getVelocity |
( |
|
) |
const [virtual] |
Returns the velocity of the vehicle.
Reimplemented from SceneObject.
void Vehicle::setEnergyLevel |
( |
F32 |
energy |
) |
[virtual] |
Sets the level of energy for this object.
- Parameters:
-
| energy | Level of energy to assign to this object |
Reimplemented from ShapeBase.
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) |
Applies an impulse force.
- Parameters:
-
| r | Point on the object to apply impulse to, r is relative to Center of Mass |
| impulse | Impulse vector to apply. |
Reimplemented from ShapeBase.
Gets the minimum viewing distance, maximum viewing distance, camera offsetand rotation for this object, if the world were to be viewed through its eyes.
- Parameters:
-
| min | Minimum viewing distance |
| max | Maximum viewing distance |
| offset | Offset of the camera from the origin in local space |
| rot | Rotation matrix |
Reimplemented from ShapeBase.
void Vehicle::getCameraTransform |
( |
F32 * |
pos, |
|
|
MatrixF * |
mat | |
|
) |
| | [virtual] |
Gets the camera transform.
- Todo:
- Find out what pos does
- Parameters:
-
| pos | TODO: Find out what this does |
| mat | Camera transform (out) |
Reimplemented from ShapeBase.
Mount an object to a mount point.
- Parameters:
-
| obj | Object to mount |
| node | Mount node ID |
Reimplemented from ShapeBase.
Vehicle::DECLARE_CONOBJECT |
( |
Vehicle |
|
) |
|
Field Documentation
Number of ticks to predict.
|