BulletVehicle

from panda3d.bullet import BulletVehicle
class BulletVehicle

Bases:

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.

apply_engine_force(force: float, idx: int)

Applies force at the wheel with index idx for acceleration.

property chassis BulletRigidBodyNode

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

create_wheel(suspension_rest_length: float) BulletWheel

Factory method for creating wheels for this vehicle instance.

property current_speed_km_hour float

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.

get_chassis() BulletRigidBodyNode

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

static get_class_type() panda3d.core.TypeHandle
get_current_speed_km_hour() float

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

get_forward_vector() panda3d.core.LVector3

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

get_num_wheels() int

Returns the number of wheels this vehicle has.

get_steering_value(idx: int) float

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

get_tuning() 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!

get_wheel(idx: int) BulletWheel

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

get_wheels() list
reset_suspension()

Resets the vehicle’s suspension.

set_brake(brake: float, idx: int)

Applies braking force to the wheel with index idx.

set_coordinate_system(up: BulletUpAxis)

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

set_pitch_control(pitch: float)
set_steering_value(steering: float, idx: int)

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

property tuning BulletVehicleTuning

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.