#include "TA/Physics/DynamicObjectCar.h"
Inheritance diagram for TA::DynamicObjectCar:
Call the static function TA::DynamicObject::CreateNew to create a new instance of this class.
This class provides a simple implementation of vehicle simulation. Depending on how the parameters are set up, a DynamicObjectCar can either provide a realistic feeling simulation or an easy to drive 'arcady' feel. An interface is also provided for advanced users to replace tire force and engine torque calculations for more control over the simulation.
The default parameters are set so that the a car should handle reasonably well before the user starts changing parameters. Things such as wheel positions and car weight and shape can have a large impact. It is recommend the user uses the driving demo code from the True Axis Physics Demos as a starting point for tuning car handling.
A DynamicObjectCar must be initialised using a TA::CarTemplate object. See TA::DynamicObjectCar::Initialise.
AddRef()
and Release()
can be called to increment and decrement the reference count. If the reference count is zero after a call to Release()
the object will be automatically deleted. Reference counted objects should only be created using new.
Public Types | |
enum | WheelFlag { WHEEL_FLAG_STEERING = 0x1, WHEEL_FLAG_DRIVING = 0x2, WHEEL_FLAG_HAND_BRAKE_AFFECTED = 0x4, WHEEL_FLAG_CAMBER_CHANGED = 0x8 } |
Public Member Functions | |
Initialisation | |
void | Initialise (CarTemplate *pCarTemplate) |
void | Initialise (const Char *szFileName) |
void | Finalise () |
Update | |
virtual void | Update (float fDt) |
void | ClearControls () |
void | UpdateControls (float fSteeringAngle, float fAccelerator, float fBrake, float fHandBrake, float fSteeringHelp, float fTractionControl, int nGear=-1) |
Properties | |
float | GetRPM () const |
int | GetGear () const |
int | GetNumGears () const |
float | GetCarSpeedFromWheels () |
void | SetTorqueMultiplier (float fTorqueMultiplier) |
float | GetTorqueMultiplier () const |
void | SetAntiRollFudge (float fAntiRollFudge) |
float | GetAntiRollFudge () const |
const Wheel & | GetWheel (int nIndex) const |
Wheel & | GetWheel (int nIndex) |
int | GetNumWheels () const |
void | SetOrientation (const Vec3 &v3Forward, const Vec3 &v3Up) |
const Vec3 & | GetForward () const |
const Vec3 & | GetUp () const |
Static Public Member Functions | |
static DynamicObjectCar *TAC_CALL | CreateNew () |
Data Structures | |
class | Wheel |
Contains the state and properties of a car's wheels. More...
|