KX_VehicleWrapper(EXP_PyObjectPlus)

base class — EXP_PyObjectPlus

class KX_VehicleWrapper(EXP_PyObjectPlus)

KX_VehicleWrapper

TODO - description

addWheel(wheel, attachPos, downDir, 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 to attach the wheel, relative to the chassis object center.
  • downDir (vector of 3 floats) – The direction vector pointing down to where the vehicle should collide with the floor.
  • axleDir (vector of 3 floats) – The axis the wheel rotates around, relative to the chassis.
  • suspensionRestLength (float) – The length of the suspension when no forces are being applied.
  • wheelRadius (float) – The radius of the wheel (half the diameter).
  • hasSteering (boolean) – True if the wheel should turn with steering, typically used in front wheels.
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:the constraint id
Return type:integer
getConstraintType()

Returns the constraint type.

Returns:constraint type
Return type:integer
getNumWheels()

Returns the number of wheels.

Returns:the number of wheels for this vehicle
Return type:integer
getWheelOrientationQuaternion(wheelIndex)

Returns the wheel orientation as a quaternion.

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

Returns the position of the specified wheel

Parameters:wheelIndex (integer) – the wheel index
Returns:position vector
Return type:list[x, y, z]
getWheelRotation(wheelIndex)

Returns the rotation of the specified wheel

Parameters:wheelIndex (integer) – the wheel index
Returns:the wheel rotation
Return type:float
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
rayMask

Set ray cast mask.

Type:bitfield