| ## Public API Reference

- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iPcWheeled Struct Reference

List of all members.

## Public Member Functions
virtual void | Accelerate (bool applied)=0
| Set wether the vehicle will accelerate.
virtual int | AddWheel (csVector3 position, float turnspeed, float returnspeed, float suspensionsoftness, float suspensiondamping, float brakepower, float enginepower, float leftsteersensitivity, float rightsteersensitivity, bool handbrakeaffect, bool steerinvert)=0
| Add a wheel to the vehicle's wheel layout.
virtual int | AddWheelAuto (csVector3 position, float turnspeed=2.0f, float returnspeed=2.0f, float suspensionsoftness=0.000125f, float suspensiondamping=0.125f, float brakepower=1.0f)=0
| Add a wheel to the vehicle's wheel layout.
virtual void | Brake (bool applied)=0
| Set wether the vehicle will brake.
virtual void | ClearWheelPresets ()=0
| A wheel preset to reset power and steering of all wheels.
virtual void | DeleteAllWheels ()=0
| Destry and delete all wheels in the layout.
virtual void | DeleteWheel (int wheelnum)=0
| Destroy a wheel on the car, and delete it from the layout.
virtual void | DestroyAllWheels ()=0
| Destroy all wheels on the car.
virtual void | DestroyWheel (int wheelnum)=0
| Destroy a wheel on the car.
virtual iBodyGroup * | GetBodyGroup ()=0
| Get the BodyGroup that the car belongs too.
virtual int | GetGear ()=0
| Get the vehicle's gear.
virtual size_t | GetNumberGears ()=0
| Get the number of forwards gears the vehicle has.
virtual float | GetSteerAmount ()=0
| Get the tightness of the vehicle's turning.
virtual int | GetTankMode ()=0
| Get if tank mode is enabled.
virtual float | GetWheelBrakePower (int wheelnum)=0
| Get the amount of power from the brakes which goes to a wheel.
virtual float | GetWheelEnginePower (int wheelnum)=0
| Get the amount of power from the engine which goes to a wheel when accelerating.
virtual bool | GetWheelHandbrakeAffected (int wheelnum)=0
| Get whether the handbrake applies to a wheel.
virtual float | GetWheelLeftSteerSensitivity (int wheelnum)=0
| Get the sensitivity of a wheel when steering left.
virtual csVector3 | GetWheelPosition (int wheelnum)=0
| Get the position of a wheel.
virtual float | GetWheelReturnSpeed (int wheelnum)=0
| Get the speed at which a wheel returns to the middle.
virtual float | GetWheelRightSteerSensitivity (int wheelnum)=0
| Get the sensitivity of a wheel when steering right.
virtual bool | GetWheelSteerInverted (int wheelnum)=0
| Get whether a wheel steers in the opposite direction.
virtual float | GetWheelSuspensionDamping (int wheelnum)=0
| Get the damping of a wheel's suspension.
virtual float | GetWheelSuspensionSoftness (int wheelnum)=0
| Get the softness of a wheel's suspension.
virtual float | GetWheelTurnSpeed (int wheelnum)=0
| Get the speed at which a wheel turns away from the middle.
virtual void | Handbrake (bool applied)=0
| Set wether the vehicle will handbrake.
virtual bool | IsAccelerating ()=0
| Get whether the vehicle is accelerating.
virtual bool | IsBraking ()=0
| Get whether the vehicle is brakeing.
virtual bool | IsHandbraking ()=0
| Get whether the vehicle is handbrakeing.
virtual void | Neutral ()=0
| Call this to put the car in neutral gear.
virtual void | RestoreAllWheels ()=0
| Restore all of the vehicle's wheels from the layout.
virtual void | RestoreWheel (int wheelnum)=0
| Restore a wheel, along with its settings, from the layout.
virtual void | Reverse ()=0
| Reverse the vehicle.
virtual void | SetAutoReverse (bool autoreverse)=0
| Set wether the vehicle will automatically begin reversing after braking to a stop.
virtual void | SetAutoTransmission (bool auto)=0
| Set whether the vehicle has an automatic transmission, or gears will be manually controlled.
virtual void | SetBrakeForce (float force)=0
| Set the force at which the vehicle brakes.
virtual void | SetFrontWheelPreset (float sensitivity, float power)=0
| A wheel grouping preset which sets steering amount and drive power to front wheels.
virtual void | SetGear (int gear)=0
| Change the vehicle's gear.
virtual void | SetGearSettings (int gear, float velocity, float force)=0
| Set up a gear with a given velocity and force.
virtual void | SetNumberGears (int number)=0
| Set the number of forwards gears the vehicle has.
virtual void | SetOuterWheelSteerPreset (float sensitivity)=0
| A wheel grouping preset which lowers by the sensitivity of outer wheels, to improve handling.
virtual void | SetRearWheelPreset (float sensitivity, float power)=0
| A wheel grouping preset which sets steering amount and drive power to rear wheels.
virtual void | SetSteerAmount (float amount)=0
| Set the tightness of the vehicle's turning.
virtual void | SetTankMode (bool tankmode)=0
| Set if tank steering is enabled vehicle.
virtual void | SetWheelBrakePower (int wheelnum, float power)=0
| Set amount of power from the brakes which goes to a wheel.
virtual void | SetWheelEnginePower (int wheelnum, float power)=0
| Set amount of power from the engine which goes to a wheel when accelerating.
virtual void | SetWheelHandbrakeAffected (int wheelnum, bool handbrakeaffected)=0
| Set whether the handbrake applies to a wheel.
virtual void | SetWheelLeftSteerSensitivity (int wheelnum, float sensitivity)=0
| Set the sensitivity of a wheel when steering left.This is initially automatically determined from the wheels position.
virtual void | SetWheelMesh (const char *file, const char *factname)=0
| Set the mesh to use for the wheels.
virtual void | SetWheelPosition (int wheelnum, csVector3 position)=0
| Set the position of a wheel.
virtual void | SetWheelReturnSpeed (int wheelnum, float speed)=0
| Set the speed at which a wheel returns to the middle.
virtual void | SetWheelRightSteerSensitivity (int wheelnum, float sensitivity)=0
| Set the sensitivity of a wheel when steering right.
virtual void | SetWheelSteerInverted (int wheelnum, bool inverted)=0
| Set whether a wheel steers in the opposite direction.
virtual void | SetWheelSuspensionDamping (int wheelnum, float damping)=0
| Set the damping of a wheel's suspension.
virtual void | SetWheelSuspensionSoftness (int wheelnum, float softness)=0
| Set the softness of a wheel's suspension.
virtual void | SetWheelTurnSpeed (int wheelnum, float speed)=0
| Set the speed at which a wheel turns away from the middle.
virtual void | SteerLeft ()=0
| Steer the vehicle left.
virtual void | SteerRight ()=0
| Steer the vehicle right.
virtual void | SteerStraight ()=0
| Straighten the steering wheels.

## Detailed Description

Definition at line 57 of file wheeled.h.

## Member Function Documentation

virtual void iPcWheeled::Accelerate | ( | bool | applied | ) | `[pure virtual]`

Set wether the vehicle will accelerate.

Parameters:

  | applied | Whether the accelerator is applied.

virtual int iPcWheeled::AddWheel | ( | csVector3 | position,
|  | float | turnspeed,
|  | float | returnspeed,
|  | float | suspensionsoftness,
|  | float | suspensiondamping,
|  | float | brakepower,
|  | float | enginepower,
|  | float | leftsteersensitivity,
|  | float | rightsteersensitivity,
|  | bool | handbrakeaffect,
|  | bool | steerinvert |
| ) |  |  | `[pure virtual]`

Add a wheel to the vehicle's wheel layout.

This method allows for total control over the wheel, overriding the vehicle's presets. The wheel won't be created until SetupWheels() is called.

Parameters:

  | position | Where the wheel will be placed.
  | turnspeed | How fast the wheel should steer away from centre.
  | returnspeed | How fast the wheel should return to the centre.
  | suspensionsoftness | How soft the suspension on the wheel should be.
  | suspensiondamping | How dampened the suspension on the wheel should be.
  | brakepower | Fraction of vehicle's brake force this wheel recieves.
  | leftsteersensitivity | How sensitive wheel is when steering left.
  | rightsteersensitivity | How sensitive wheel is when steering right.
  | handbrakeaffect | Wether the handbrake applies to this wheel.
  | steerinvert | Wether this wheel steers back-to-front.

virtual int iPcWheeled::AddWheelAuto | ( | csVector3 | position,
|  | float | turnspeed = `2.0f`,
|  | float | returnspeed = `2.0f`,
|  | float | suspensionsoftness = `0.000125f`,
|  | float | suspensiondamping = `0.125f`,
|  | float | brakepower = `1.0f` |
| ) |  |  | `[pure virtual]`

Add a wheel to the vehicle's wheel layout.

This method uses sensible defaults and the vehicle's wheel presets for steering and power, and automatically applies handbrake and invert steering to rear wheels. Therefore it is enough to just give the wheel's position. The wheel won't be created until SetupWheels() is called.

Parameters:

  | position | Where the wheel will be placed.
  | turnspeed | How fast the wheel should steer away from centre.
  | returnspeed | How fast the wheel should return to the centre.
  | suspensionsoftness | How soft the suspension on the wheel should be.
  | suspensiondamping | How dampened the suspension on the wheel should be.
  | brakepower | Fraction of vehicle's brake force this wheel recieves.

virtual void iPcWheeled::Brake | ( | bool | applied | ) | `[pure virtual]`

Set wether the vehicle will brake.

Parameters:

  | applied | Wether the brake is applied

virtual void iPcWheeled::ClearWheelPresets | ( |  | ) | `[pure virtual]`

A wheel preset to reset power and steering of all wheels.

Defaults back to front-wheel steer, 4 wheel drive.

virtual void iPcWheeled::DeleteAllWheels | ( |  | ) | `[pure virtual]`

Destry and delete all wheels in the layout.

virtual void iPcWheeled::DeleteWheel | ( | int | wheelnum | ) | `[pure virtual]`

Destroy a wheel on the car, and delete it from the layout.

It

Parameters:

  | wheelnum | Index of the wheel to delete.

virtual void iPcWheeled::DestroyAllWheels | ( |  | ) | `[pure virtual]`

Destroy all wheels on the car.

The layout is still retained, so the wheels can be restored with RestoreWheelLayout().

virtual void iPcWheeled::DestroyWheel | ( | int | wheelnum | ) | `[pure virtual]`

Destroy a wheel on the car.

It will remain in the layout, so it can be restored along with all its settings with RestoreWheel(wheelnum).

virtual iBodyGroup* iPcWheeled::GetBodyGroup | ( |  | ) | `[pure virtual]`

Get the BodyGroup that the car belongs too.

virtual int iPcWheeled::GetGear | ( |  | ) | `[pure virtual]`

Get the vehicle's gear.

virtual size_t iPcWheeled::GetNumberGears | ( |  | ) | `[pure virtual]`

Get the number of forwards gears the vehicle has.

This excludes neutral and reverse.

virtual float iPcWheeled::GetSteerAmount | ( |  | ) | `[pure virtual]`

Get the tightness of the vehicle's turning.

virtual int iPcWheeled::GetTankMode | ( |  | ) | `[pure virtual]`

Get if tank mode is enabled.

virtual float iPcWheeled::GetWheelBrakePower | ( | int | wheelnum | ) | `[pure virtual]`

Get the amount of power from the brakes which goes to a wheel.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual float iPcWheeled::GetWheelEnginePower | ( | int | wheelnum | ) | `[pure virtual]`

Get the amount of power from the engine which goes to a wheel when accelerating.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual bool iPcWheeled::GetWheelHandbrakeAffected | ( | int | wheelnum | ) | `[pure virtual]`

Get whether the handbrake applies to a wheel.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual float iPcWheeled::GetWheelLeftSteerSensitivity | ( | int | wheelnum | ) | `[pure virtual]`

Get the sensitivity of a wheel when steering left.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual csVector3 iPcWheeled::GetWheelPosition | ( | int | wheelnum | ) | `[pure virtual]`

Get the position of a wheel.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual float iPcWheeled::GetWheelReturnSpeed | ( | int | wheelnum | ) | `[pure virtual]`

Get the speed at which a wheel returns to the middle.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual float iPcWheeled::GetWheelRightSteerSensitivity | ( | int | wheelnum | ) | `[pure virtual]`

Get the sensitivity of a wheel when steering right.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual bool iPcWheeled::GetWheelSteerInverted | ( | int | wheelnum | ) | `[pure virtual]`

Get whether a wheel steers in the opposite direction.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual float iPcWheeled::GetWheelSuspensionDamping | ( | int | wheelnum | ) | `[pure virtual]`

Get the damping of a wheel's suspension.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual float iPcWheeled::GetWheelSuspensionSoftness | ( | int | wheelnum | ) | `[pure virtual]`

Get the softness of a wheel's suspension.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual float iPcWheeled::GetWheelTurnSpeed | ( | int | wheelnum | ) | `[pure virtual]`

Get the speed at which a wheel turns away from the middle.

Parameters:

  | wheelnum | Index of the wheel to get.

virtual void iPcWheeled::Handbrake | ( | bool | applied | ) | `[pure virtual]`

Set wether the vehicle will handbrake.

(rear wheel lock)

Parameters:

  | applied | Wether the handbrake is applied

virtual bool iPcWheeled::IsAccelerating | ( |  | ) | `[pure virtual]`

Get whether the vehicle is accelerating.

virtual bool iPcWheeled::IsBraking | ( |  | ) | `[pure virtual]`

Get whether the vehicle is brakeing.

virtual bool iPcWheeled::IsHandbraking | ( |  | ) | `[pure virtual]`

Get whether the vehicle is handbrakeing.

virtual void iPcWheeled::Neutral | ( |  | ) | `[pure virtual]`

Call this to put the car in neutral gear.

This is the same as setting gear to 0.

virtual void iPcWheeled::RestoreAllWheels | ( |  | ) | `[pure virtual]`

Restore all of the vehicle's wheels from the layout.

virtual void iPcWheeled::RestoreWheel | ( | int | wheelnum | ) | `[pure virtual]`

Restore a wheel, along with its settings, from the layout.

virtual void iPcWheeled::Reverse | ( |  | ) | `[pure virtual]`

Reverse the vehicle.

This is the same as setting the gear to -1.

virtual void iPcWheeled::SetAutoReverse | ( | bool | autoreverse | ) | `[pure virtual]`

Set wether the vehicle will automatically begin reversing after braking to a stop.

This is enabled by default.

Parameters:

  | autoreverse. | Whether the vehicle will automatically reverse.

virtual void iPcWheeled::SetAutoTransmission | ( | bool | auto | ) | `[pure virtual]`

Set whether the vehicle has an automatic transmission, or gears will be manually controlled.

Parameters:

  | auto | Whether automatic transmission is enabled or not.

virtual void iPcWheeled::SetBrakeForce | ( | float | force | ) | `[pure virtual]`

Set the force at which the vehicle brakes.

Parameters:

  | force | The force with which the vehicle will brake

virtual void iPcWheeled::SetFrontWheelPreset | ( | float | sensitivity,
|  | float | power |
| ) |  |  | `[pure virtual]`

A wheel grouping preset which sets steering amount and drive power to front wheels.

Note that changing this will overwrite per-wheel steer and power settings! You will have to set per-wheel settings after you set all the presets.

Parameters:

  | sensitivity | sensitivity for front wheels when steering
  | power | power which front wheels recieve when accelerating (0-1)

virtual void iPcWheeled::SetGear | ( | int | gear | ) | `[pure virtual]`

Change the vehicle's gear.

Parameters:

  | gear | The gear to switch to. -1 is reverse, 0 is neutral, anything above are forwards gears.

virtual void iPcWheeled::SetGearSettings | ( | int | gear,
|  | float | velocity,
|  | float | force |
| ) |  |  | `[pure virtual]`

Set up a gear with a given velocity and force.

virtual void iPcWheeled::SetNumberGears | ( | int | number | ) | `[pure virtual]`

Set the number of forwards gears the vehicle has.

This excludes neutral and reverse.

Parameters:

  | number | The number of gears the vehicle will have.

virtual void iPcWheeled::SetOuterWheelSteerPreset | ( | float | sensitivity | ) | `[pure virtual]`

A wheel grouping preset which lowers by the sensitivity of outer wheels, to improve handling.

Note that changing this will overwrite per-wheel steer and power settings! You will have to set per-wheel settings after you set all the presets.

Parameters:

  | sensitivity | factor of sensitivity for outer wheels

virtual void iPcWheeled::SetRearWheelPreset | ( | float | sensitivity,
|  | float | power |
| ) |  |  | `[pure virtual]`

A wheel grouping preset which sets steering amount and drive power to rear wheels.

Note that changing this will overwrite per-wheel steer and power settings! You will have to set per-wheel settings after you set all the presets.

Parameters:

  | sensitivity | sensitivity for rear wheels when steering
  | power | power which rear wheels recieve when accelerating (0-1)

virtual void iPcWheeled::SetSteerAmount | ( | float | amount | ) | `[pure virtual]`

Set the tightness of the vehicle's turning.

Parameters:

  | amount | How tight the car will steer.

virtual void iPcWheeled::SetTankMode | ( | bool | tankmode | ) | `[pure virtual]`

Set if tank steering is enabled vehicle.

Parameters:

  | tankmode | Whether tank steering is enabled or not.

virtual void iPcWheeled::SetWheelBrakePower | ( | int | wheelnum,
|  | float | power |
| ) |  |  | `[pure virtual]`

Set amount of power from the brakes which goes to a wheel.

This is initially 1.

Parameters:

  | wheelnum | Index of the wheel to set.
  | power | Amount of brake power going to the wheel, from 0 to 1.

virtual void iPcWheeled::SetWheelEnginePower | ( | int | wheelnum,
|  | float | power |
| ) |  |  | `[pure virtual]`

Set amount of power from the engine which goes to a wheel when accelerating.

This is initially 1.

Parameters:

  | wheelnum | Index of the wheel to set.
  | power | Amount of power going to the wheel, from 0 to 1.

virtual void iPcWheeled::SetWheelHandbrakeAffected | ( | int | wheelnum,
|  | bool | handbrakeaffected |
| ) |  |  | `[pure virtual]`

Set whether the handbrake applies to a wheel.

This is initially automatically determined from it's position, where rear wheels are affected by the handbrake

Parameters:

  | wheelnum | Index of the wheel to set.
  | handbrakeaffected | Whether the handbrake affects the wheel.

virtual void iPcWheeled::SetWheelLeftSteerSensitivity | ( | int | wheelnum,
|  | float | sensitivity |
| ) |  |  | `[pure virtual]`

Set the sensitivity of a wheel when steering left.This is initially automatically determined from the wheels position.

If it is an outer wheel when steering left, it is decreased. If it is a back wheel it is decreased further.

Parameters:

  | wheelnum | Index of the wheel to set.
  | sensitivity | Sensitivity of the steering, from 0 to 1.

virtual void iPcWheeled::SetWheelMesh | ( | const char * | file,
|  | const char * | factname |
| ) |  |  | `[pure virtual]`

Set the mesh to use for the wheels.

Parameters:

  | file | VFS path to the file which contains the wheel's factory. If 0, it is assumed the factory has already been loaded.
  | factname | The name of the factory to use for wheel meshes.

virtual void iPcWheeled::SetWheelPosition | ( | int | wheelnum,
|  | csVector3 | position |
| ) |  |  | `[pure virtual]`

Set the position of a wheel.

Parameters:

  | wheelnum | Index of the wheel to set.
  | position | The new position of the wheel.

virtual void iPcWheeled::SetWheelReturnSpeed | ( | int | wheelnum,
|  | float | speed |
| ) |  |  | `[pure virtual]`

Set the speed at which a wheel returns to the middle.

This is initially 2.

Parameters:

  | wheelnum | Index of the wheel to set.
  | speed | Speed at which the wheel returns.

virtual void iPcWheeled::SetWheelRightSteerSensitivity | ( | int | wheelnum,
|  | float | sensitivity |
| ) |  |  | `[pure virtual]`

Set the sensitivity of a wheel when steering right.

This is initially automatically determined from the wheels position. If it is an outer wheel when steering right, it is decreased. If it is a back wheel it is decreased further.

Parameters:

  | wheelnum | Index of the wheel to set.
  | sensitivity | Sensitivity of the steering, from 0 to 1.

virtual void iPcWheeled::SetWheelSteerInverted | ( | int | wheelnum,
|  | bool | inverted |
| ) |  |  | `[pure virtual]`

Set whether a wheel steers in the opposite direction.

This is initially automatically determined from it's position, where rear wheels are inverted.

Parameters:

  | wheelnum | Index of the wheel to set.
  | inverted | Wether the wheel is inverted.

virtual void iPcWheeled::SetWheelSuspensionDamping | ( | int | wheelnum,
|  | float | damping |
| ) |  |  | `[pure virtual]`

Set the damping of a wheel's suspension.

It is initially 0.125.

Parameters:

  | wheelnum | Index of the wheel to set.
  | damping | Damping of the suspension, from 0 to 1.

virtual void iPcWheeled::SetWheelSuspensionSoftness | ( | int | wheelnum,
|  | float | softness |
| ) |  |  | `[pure virtual]`

Set the softness of a wheel's suspension.

It is initially 0.000125.

Parameters:

  | wheelnum | Index of the wheel to set.
  | softness | Softness of the suspension, from 0 to 1.

virtual void iPcWheeled::SetWheelTurnSpeed | ( | int | wheelnum,
|  | float | speed |
| ) |  |  | `[pure virtual]`

Set the speed at which a wheel turns away from the middle.

This is initially 2.

Parameters:

  | wheelnum | Index of the wheel to set.
  | speed | Speed at which the wheel turns.

virtual void iPcWheeled::SteerLeft | ( |  | ) | `[pure virtual]`

Steer the vehicle left.

virtual void iPcWheeled::SteerRight | ( |  | ) | `[pure virtual]`

Steer the vehicle right.

virtual void iPcWheeled::SteerStraight | ( |  | ) | `[pure virtual]`

Straighten the steering wheels.

The documentation for this struct was generated from the following file:

- propclass/wheeled.h