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
- __init__(world: BulletWorld, chassis: BulletRigidBodyNode)
Creates a new
BulletVehicle
instance in the given world and with a chassis node.
- applyEngineForce(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.
- createWheel() 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.
- 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.
- 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.
- resetSuspension()
Resets the vehicle’s suspension.
- setCoordinateSystem(up: BulletUpAxis)
Specifies which axis is “up”. Nessecary for the vehicle’s suspension to work properly!
- setSteeringValue(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.