# 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.

setCoordinateSystem(up: BulletUpAxis) → None

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

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

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

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

Applies braking force to the wheel with index idx.

setPitchControl(pitch: float) → None
getChassis() → BulletRigidBodyNode

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

Return type

BulletRigidBodyNode

getCurrentSpeedKmHour() → float

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

getSteeringValue(idx: int) → float

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

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

resetSuspension() → None

Resets the vehicle’s suspension.

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

Applies force at the wheel with index idx for acceleration.

createWheel() → BulletWheel

Factory method for creating wheels for this vehicle instance.

Return type

BulletWheel

getNumWheels() → int

Returns the number of wheels this vehicle has.

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

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

static getClassType() → TypeHandle
Return type

TypeHandle

getWheels() → list
property chassis

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

Return type

BulletRigidBodyNode

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

property wheels

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

Return type
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