Panda3D
|
Simulates a raycast vehicle which casts a ray per wheel at the ground as a cheap replacement for complex suspension simulation. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ (BulletWorld world, BulletRigidBodyNode chassis) | |
Creates a new BulletVehicle instance in the given world and with a chassis node. More... | |
applyEngineForce (float force, int idx) | |
Applies force at the wheel with index idx for acceleration. More... | |
BulletWheel | createWheel () |
Factory method for creating wheels for this vehicle instance. More... | |
BulletRigidBodyNode | getChassis () |
Returns the chassis of this vehicle. More... | |
float | getCurrentSpeedKmHour () |
Returns the current speed in kilometers per hour. More... | |
LVector3 | getForwardVector () |
Returns the forward vector representing the car's actual direction of movement. More... | |
int | getNumWheels () |
Returns the number of wheels this vehicle has. More... | |
float | getSteeringValue (int idx) |
Returns the steering angle of the wheel with index idx in degrees. More... | |
BulletVehicleTuning | getTuning () |
Returns a reference to the BulletVehicleTuning object of this vehicle which offers various vehicle-global tuning options. More... | |
BulletWheel | getWheel (int idx) |
Returns the BulletWheel with index idx. More... | |
list | getWheels () |
resetSuspension () | |
Resets the vehicle's suspension. More... | |
setBrake (float brake, int idx) | |
Applies braking force to the wheel with index idx. More... | |
setCoordinateSystem (BulletUpAxis up) | |
Specifies which axis is "up". More... | |
setPitchControl (float pitch) | |
setSteeringValue (float steering, int idx) | |
Sets the steering value (in degrees) of the wheel with index idx. More... | |
![]() | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. More... | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. More... | |
![]() | |
int | getRefCount () |
Returns the current reference count. More... | |
ref () | |
Explicitly increments the reference count. More... | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
bool | unref () |
Explicitly decrements the reference count. More... | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
Public Attributes | |
BulletRigidBodyNode | chassis |
Returns the chassis of this vehicle. More... | |
float | current_speed_km_hour |
Returns the current speed in kilometers per hour. More... | |
LVector3 | forward_vector |
Returns the forward vector representing the car's actual direction of movement. More... | |
BulletVehicleTuning | tuning |
Tuning. More... | |
BulletWheel | wheels [] |
Returns the BulletWheel with index idx. More... | |
![]() | |
TypeHandle | type |
Returns the TypeHandle representing this object's type. More... | |
![]() | |
int | ref_count |
The current reference count. More... | |
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.
__init__ | ( | BulletWorld | world, |
BulletRigidBodyNode | chassis | ||
) |
Creates a new BulletVehicle instance in the given world and with a chassis node.
applyEngineForce | ( | float | force, |
int | idx | ||
) |
Applies force at the wheel with index idx for acceleration.
BulletWheel createWheel | ( | ) |
Factory method for creating wheels for this vehicle instance.
BulletRigidBodyNode getChassis | ( | ) |
Returns the chassis of this vehicle.
The chassis is a rigid body node.
|
static |
float getCurrentSpeedKmHour | ( | ) |
Returns the current speed in kilometers per hour.
Convert to miles using: km/h * 0.62 = mph
LVector3 getForwardVector | ( | ) |
Returns the forward vector representing the car's actual direction of movement.
The forward vetcor is given in global coordinates.
int getNumWheels | ( | ) |
Returns the number of wheels this vehicle has.
float getSteeringValue | ( | int | idx | ) |
Returns the steering angle of the wheel with index idx in degrees.
BulletVehicleTuning getTuning | ( | ) |
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!
BulletWheel getWheel | ( | int | idx | ) |
Returns the BulletWheel with index idx.
Causes an AssertionError if idx is equal or larger than the number of wheels.
list getWheels | ( | ) |
resetSuspension | ( | ) |
Resets the vehicle's suspension.
setBrake | ( | float | brake, |
int | idx | ||
) |
Applies braking force to the wheel with index idx.
setCoordinateSystem | ( | BulletUpAxis | up | ) |
Specifies which axis is "up".
Nessecary for the vehicle's suspension to work properly!
setPitchControl | ( | float | pitch | ) |
setSteeringValue | ( | float | steering, |
int | idx | ||
) |
Sets the steering value (in degrees) of the wheel with index idx.
BulletRigidBodyNode chassis |
Returns the chassis of this vehicle.
The chassis is a rigid body node.
float current_speed_km_hour |
Returns the current speed in kilometers per hour.
Convert to miles using: km/h * 0.62 = mph
LVector3 forward_vector |
Returns the forward vector representing the car's actual direction of movement.
The forward vetcor is given in global coordinates.
BulletVehicleTuning tuning |
Tuning.
BulletWheel wheels[] |
Returns the BulletWheel with index idx.
Causes an AssertionError if idx is equal or larger than the number of wheels.