# panda3d.bullet.BulletVehicle¶

from panda3d.bullet import BulletVehicle

class BulletVehicle

Bases: TypedReferenceCount

Simulates a raycast vehicle which casts a ray per wheel at the ground as a cheap replacement for complex suspension simulation. The suspension can be tuned in various ways. It is possible to add a (probably) arbitrary number of wheels.

Inheritance diagram

__init__(world: BulletWorld, chassis: BulletRigidBodyNode) → None

Creates a new BulletVehicle instance in the given world and with a chassis node.

applyEngineForce(force: float, idx: int) → None

Applies force at the wheel with index idx for acceleration.

property chassis

Returns the chassis of this vehicle. The chassis is a rigid body node.

Return type

BulletRigidBodyNode

createWheel() → BulletWheel

Factory method for creating wheels for this vehicle instance.

Return type

BulletWheel

property current_speed_km_hour

Returns the current speed in kilometers per hour. Convert to miles using: km/h * 0.62 = mph

Return type

float

property forward_vector

Returns the forward vector representing the car’s actual direction of movement. The forward vetcor is given in global coordinates.

Return type

LVector3

getChassis() → BulletRigidBodyNode

Returns the chassis of this vehicle. The chassis is a rigid body node.

Return type

BulletRigidBodyNode

static getClassType() → TypeHandle
Return type

TypeHandle

getCurrentSpeedKmHour() → float

Returns the current speed in kilometers per hour. Convert to miles using: km/h * 0.62 = mph

getForwardVector() → LVector3

Returns the forward vector representing the car’s actual direction of movement. The forward vetcor is given in global coordinates.

Return type

LVector3

getNumWheels() → int

Returns the number of wheels this vehicle has.

getSteeringValue(idx: int) → float

Returns the steering angle of the wheel with index idx in degrees.

getTuning() → BulletVehicleTuning

Returns a reference to the BulletVehicleTuning object of this vehicle which offers various vehicle-global tuning options. Make sure to configure this before adding wheels!

Return type

BulletVehicleTuning

getWheel(idx: int) → BulletWheel

Returns the BulletWheel with index idx. Causes an AssertionError if idx is equal or larger than the number of wheels.

Return type

BulletWheel

getWheels() → list
resetSuspension() → None

Resets the vehicle’s suspension.

setBrake(brake: float, idx: int) → None

Applies braking force to the wheel with index idx.

setCoordinateSystem(up: BulletUpAxis) → None

Specifies which axis is “up”. Nessecary for the vehicle’s suspension to work properly!

setPitchControl(pitch: float) → None
setSteeringValue(steering: float, idx: int) → None

Sets the steering value (in degrees) of the wheel with index idx.

property tuning

Tuning

Tuning

Tuning

Returns a reference to the BulletVehicleTuning object of this vehicle which offers various vehicle-global tuning options. Make sure to configure this before adding wheels!

Return type

BulletVehicleTuning

property wheels

Returns the BulletWheel with index idx. Causes an AssertionError if idx is equal or larger than the number of wheels.

Return type