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

Inheritance diagram of BulletVehicle

__init__(world: BulletWorld, chassis: BulletRigidBodyNode)

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 chassisBulletRigidBodyNode

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

createWheel()BulletWheel

Factory method for creating wheels for this vehicle instance.

property current_speed_km_hourfloat

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

property forward_vector → LVector3

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

getChassis()BulletRigidBodyNode

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

static getClassType()panda3d.core.TypeHandle
getCurrentSpeedKmHour()float

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

getForwardVector()panda3d.core.LVector3

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

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!

getWheel(idx: int)BulletWheel

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

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 tuningBulletVehicleTuning

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!

property wheels → Sequence[BulletWheel]

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