IPhysics: CPhysicsCar Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# CPhysicsCar Class Reference

`#include <CPhysicsCar.h>`

Inherits IPhysicsCar.

List of all members.

## Public Member Functions

| CPhysicsCar ()
| ~CPhysicsCar ()
void | assembleCarPhysics (SPhysicsCar *car, NewtonWorld *world)
void | setSteeringPercent (f32 steeringPercent)

Set the steering as a percentage of the maximum steering value that was specified when the car was created. Use a negative value for turning left, positive for turning right. If you set this to 0, the wheels will be straight. This will be clamped at -100 and 100.

void | setThrottlePercent (f32 throttlePercent)

Set the throttle as a percentage of the maximum throttle value that was specified when the car was created. Use a positive value for going forwards, negative for reversing. If you set this to 0, the car will come to a halt. This will be clamped at -100 and 100.

void | setBrakesPercent (f32 brakesPercent)
| Set the brakes as a percentage of the maximum brakes value that was specified when the car was created. This will be clamped at 0 and 100.
void | setSteering (f32 steerangle)
void | setTorque (f32 torque)
void | setBrakes (f32 brakes)
void | setVehicleSpeed (f32 speed)
ISceneNode * | getNode ()
| Get a pointer to the Irrlicht SceneNode.
NewtonJoint * | getVehicleJoint ()
void | setPosition (vector3df position)
| Set position.
void | setRotation (vector3df rotation)
| Set rotation.
void | setScale (vector3df scale)
| Set the scale.
vector3df | getPosition ()
| Get position.
vector3df | getRotation ()
| Get rotation.
vector3df | getScale ()
| Get scale.
NewtonBody * | getBody ()
| Get a pointer to the Newton body. This will be the body of the vehicle hull, not of the wheels. You should only need this if you want to make direct calls to Newton.

## Public Attributes

CPhysicsCarWheel | wheel_FL
CPhysicsCarWheel | wheel_FR
CPhysicsCarWheel | wheel_RR
CPhysicsCarWheel | wheel_RL

## Protected Member Functions

void | cap (f32 limit, f32 *target, bool positiveAndNegative)

## Protected Attributes

ISceneNode * | m_carNode
f32 | m_vehicleSpeed
NewtonWorld * | m_world
NewtonBody * | m_carBody
NewtonJoint * | m_vehicleJoint
f32 | m_maxTorque
f32 | m_maxSteerAngle
f32 | m_maxBrakes

## Constructor & Destructor Documentation

CPhysicsCar::CPhysicsCar | ( |  | ) |

CPhysicsCar::~CPhysicsCar | ( |  | ) |

## Member Function Documentation

void CPhysicsCar::assembleCarPhysics | ( | SPhysicsCar * | car,
|  | NewtonWorld * | world |
| ) |  |  |

void CPhysicsCar::setSteeringPercent | ( | f32 | steeringPercent | ) | `[virtual]`

Set the steering as a percentage of the maximum steering value that was specified when the car was created. Use a negative value for turning left, positive for turning right. If you set this to 0, the wheels will be straight. This will be clamped at -100 and 100.

Implements IPhysicsCar.

void CPhysicsCar::setThrottlePercent | ( | f32 | throttlePercent | ) | `[virtual]`

Set the throttle as a percentage of the maximum throttle value that was specified when the car was created. Use a positive value for going forwards, negative for reversing. If you set this to 0, the car will come to a halt. This will be clamped at -100 and 100.

Implements IPhysicsCar.

void CPhysicsCar::setBrakesPercent | ( | f32 | brakesPercent | ) | `[virtual]`

Set the brakes as a percentage of the maximum brakes value that was specified when the car was created. This will be clamped at 0 and 100.

Implements IPhysicsCar.

void CPhysicsCar::setSteering | ( | f32 | steerangle | ) |

void CPhysicsCar::setTorque | ( | f32 | torque | ) |

void CPhysicsCar::setBrakes | ( | f32 | brakes | ) |

void CPhysicsCar::setVehicleSpeed | ( | f32 | speed | ) |

ISceneNode * CPhysicsCar::getNode | ( |  | ) | `[virtual]`

Get a pointer to the Irrlicht SceneNode.

Implements IPhysicsBaseEntity.

NewtonJoint * CPhysicsCar::getVehicleJoint | ( |  | ) |

void CPhysicsCar::setPosition | ( | vector3df | position | ) | `[virtual]`

Set position.

Implements IPhysicsCar.

void CPhysicsCar::setRotation | ( | vector3df | rotation | ) | `[virtual]`

Set rotation.

Implements IPhysicsCar.

void CPhysicsCar::setScale | ( | vector3df | scale | ) | `[virtual]`

Set the scale.

Implements IPhysicsCar.

vector3df CPhysicsCar::getPosition | ( |  | ) | `[virtual]`

Get position.

Implements IPhysicsCar.

vector3df CPhysicsCar::getRotation | ( |  | ) | `[virtual]`

Get rotation.

Implements IPhysicsCar.

vector3df CPhysicsCar::getScale | ( |  | ) | `[virtual]`

Get scale.

Implements IPhysicsCar.

NewtonBody * CPhysicsCar::getBody | ( |  | ) | `[virtual]`

Get a pointer to the Newton body. This will be the body of the vehicle hull, not of the wheels. You should only need this if you want to make direct calls to Newton.

Implements IPhysicsCar.

void CPhysicsCar::cap | ( | f32 | limit,
|  | f32 * | target,
|  | bool | positiveAndNegative |
| ) |  |  | `[protected]`

## Member Data Documentation

CPhysicsCarWheel CPhysicsCar::wheel_FL

CPhysicsCarWheel CPhysicsCar::wheel_FR

CPhysicsCarWheel CPhysicsCar::wheel_RR

CPhysicsCarWheel CPhysicsCar::wheel_RL

ISceneNode* CPhysicsCar::m_carNode`[protected]`

f32 CPhysicsCar::m_vehicleSpeed`[protected]`

NewtonWorld* CPhysicsCar::m_world`[protected]`

NewtonBody* CPhysicsCar::m_carBody`[protected]`

NewtonJoint* CPhysicsCar::m_vehicleJoint`[protected]`

f32 CPhysicsCar::m_maxTorque`[protected]`

f32 CPhysicsCar::m_maxSteerAngle`[protected]`

f32 CPhysicsCar::m_maxBrakes`[protected]`

The documentation for this class was generated from the following files:

- C:/Documents and Settings/user/Desktop/IPhysics 1.5 Irr 1.2/source/CPhysicsCar.h
- C:/Documents and Settings/user/Desktop/IPhysics 1.5 Irr 1.2/source/CPhysicsCar.cpp