Module GameTypes :: Class KX_VehicleWrapper
[frames] | no frames]

Class KX_VehicleWrapper

PyObjectPlus --+
               |
              KX_VehicleWrapper

KX_VehicleWrapper

TODO - description

Instance Methods
 
addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
Add a wheel to the vehicle
 
applyBraking(force, wheelIndex)
Apply a braking force to the specified wheel
 
applyEngineForce(force, wheelIndex)
Apply an engine force to the specified wheel
integer
getConstraintId()
Get the constraint ID
integer
getConstraintType()
Returns the constraint type.
integer
getNumWheels()
Returns the number of wheels.
TODO - type should be quat as per method name but from the code it looks like a matrix
getWheelOrientationQuaternion(wheelIndex)
Returns the wheel orientation as a quaternion.
list[x, y, z]
getWheelPosition(wheelIndex)
Returns the position of the specified wheel
float
getWheelRotation(wheelIndex)
Returns the rotation of the specified wheel
 
setRollInfluence(rollInfluece, wheelIndex)
Set the specified wheel's roll influence.
 
setSteeringValue(steering, wheelIndex)
Set the specified wheel's steering
 
setSuspensionCompression(compression, wheelIndex)
Set the specified wheel's compression
 
setSuspensionDamping(damping, wheelIndex)
Set the specified wheel's damping
 
setSuspensionStiffness(stiffness, wheelIndex)
Set the specified wheel's stiffness
 
setTyreFriction(friction, wheelIndex)
Set the specified wheel's tyre friction
bool
isA(game_type)
Check if this is a type or a subtype game_type. (Inherited from GameTypes.PyObjectPlus)
Instance Variables
bool invalid
Test if the object has been freed by the game engine and is no longer valid. (Inherited from GameTypes.PyObjectPlus)
Method Details

addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)

 

Add a wheel to the vehicle

Parameters:
  • wheel (KX_GameObject or a KX_GameObject name) - The object to use as a wheel.
  • attachPos (vector of 3 floats) - The position that this wheel will attach to.
  • attachDir (vector of 3 floats) - The direction this wheel points.
  • axleDir (vector of 3 floats) - The direction of this wheels axle.
  • suspensionRestLength (float) - TODO - Description
  • wheelRadius (float) - The size of the wheel.

applyBraking(force, wheelIndex)

 

Apply a braking force to the specified wheel

Parameters:
  • force (float) - the brake force
  • wheelIndex (integer) - index of the wheel where the force needs to be applied

applyEngineForce(force, wheelIndex)

 

Apply an engine force to the specified wheel

Parameters:
  • force (float) - the engine force
  • wheelIndex (integer) - index of the wheel where the force needs to be applied

getConstraintId()

 

Get the constraint ID

Returns: integer
the constraint id

getConstraintType()

 

Returns the constraint type.

Returns: integer
constraint type

getNumWheels()

 

Returns the number of wheels.

Returns: integer
the number of wheels for this vehicle

getWheelOrientationQuaternion(wheelIndex)

 

Returns the wheel orientation as a quaternion.

Parameters:
  • wheelIndex (integer) - the wheel index
Returns: TODO - type should be quat as per method name but from the code it looks like a matrix
TODO Description

getWheelPosition(wheelIndex)

 

Returns the position of the specified wheel

Parameters:
  • wheelIndex (integer) - the wheel index
Returns: list[x, y, z]
position vector

getWheelRotation(wheelIndex)

 

Returns the rotation of the specified wheel

Parameters:
  • wheelIndex (integer) - the wheel index
Returns: float
the wheel rotation

setRollInfluence(rollInfluece, wheelIndex)

 

Set the specified wheel's roll influence. The higher the roll influence the more the vehicle will tend to roll over in corners.

Parameters:
  • rollInfluece (float) - the wheel roll influence
  • wheelIndex (integer) - the wheel index

setSteeringValue(steering, wheelIndex)

 

Set the specified wheel's steering

Parameters:
  • steering (float) - the wheel steering
  • wheelIndex (integer) - the wheel index

setSuspensionCompression(compression, wheelIndex)

 

Set the specified wheel's compression

Parameters:
  • compression (float) - the wheel compression
  • wheelIndex (integer) - the wheel index

setSuspensionDamping(damping, wheelIndex)

 

Set the specified wheel's damping

Parameters:
  • damping (float) - the wheel damping
  • wheelIndex (integer) - the wheel index

setSuspensionStiffness(stiffness, wheelIndex)

 

Set the specified wheel's stiffness

Parameters:
  • stiffness (float) - the wheel stiffness
  • wheelIndex (integer) - the wheel index

setTyreFriction(friction, wheelIndex)

 

Set the specified wheel's tyre friction

Parameters:
  • friction (float) - the tyre friction
  • wheelIndex (integer) - the wheel index