WheeledVehicle
A wheeled vehicle.
Public Static Attributes
bool
Disables rendering of all instances of this type.
bool
Disables selection of all instances of this type.
Public Functions
int
Get the number of wheels on this vehicle.
bool
setWheelPowered(int wheel, bool powered)
Set whether the wheel is powered (has torque applied from the engine).
bool
setWheelSpring(int wheel, WheeledVehicleSpring spring)
Set the WheeledVehicleSpring datablock for this wheel.
bool
setWheelSteering(int wheel, float steering)
Set how much the wheel is affected by steering.
bool
setWheelTire(int wheel, WheeledVehicleTire tire)
Set the WheeledVehicleTire datablock for this wheel.
Detailed Description
A wheeled vehicle.
Public Static Attributes
bool isRenderable
Disables rendering of all instances of this type.
bool isSelectable
Disables selection of all instances of this type.
Public Functions
getWheelCount()
Get the number of wheels on this vehicle.
the number of wheels (equal to the number of hub nodes defined in the model)
setWheelPowered(int wheel, bool powered)
Set whether the wheel is powered (has torque applied from the engine).
A rear wheel drive car for example would set the front wheels to false, and the rear wheels to true. Parameters:
wheel | index of the wheel to set (hub node #) |
powered | flag indicating whether to power the wheel or not |
true if successful, false if failed
setWheelSpring(int wheel, WheeledVehicleSpring spring)
Set the WheeledVehicleSpring datablock for this wheel.
Parameters:
wheel | index of the wheel to set (hub node #) |
spring | WheeledVehicleSpring datablock |
true if successful, false if failed
%obj.setWheelSpring( 0, FrontSpring );
setWheelSteering(int wheel, float steering)
Set how much the wheel is affected by steering.
The steering factor controls how much the wheel is rotated by the vehicle steering. For example, most cars would have their front wheels set to 1.0, and their rear wheels set to 0 since only the front wheels should turn.
Negative values will turn the wheel in the opposite direction to the steering angle. Parameters:
wheel | index of the wheel to set (hub node #) |
steering | steering factor from -1 (full inverse) to 1 (full) |
true if successful, false if failed
setWheelTire(int wheel, WheeledVehicleTire tire)
Set the WheeledVehicleTire datablock for this wheel.
Parameters:
wheel | index of the wheel to set (hub node #) |
tire | WheeledVehicleTire datablock |
true if successful, false if failed
%obj.setWheelTire( 0, FrontTire );