BulletVehicle

from acron.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

digraph inheritance9e9fa20289 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "BulletVehicle" [URL="acron.bullet.BulletVehicle.html#acron.bullet.BulletVehicle",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "BulletVehicle" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }
__init__()

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

apply_engine_force()

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

Wheels

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

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

static get_class_type()
get_current_speed_km_hour()

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

get_forward_vector()

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

get_num_wheels()

Returns the number of wheels this vehicle has.

get_steering_value()

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

get_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!

get_wheel()

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

Applies braking force to the wheel with index idx.

set_coordinate_system()

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

set_pitch_control()
set_steering_value()

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.