Panda3D
Public Member Functions | Static Public Member Functions

BulletVehicle Class Reference

Inheritance diagram for BulletVehicle:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Member Functions

 BulletVehicle (BulletWorld *world, BulletRigidBodyNode *chassis)
 Creates a new BulletVehicle instance in the given world and with a chassis node.
void apply_engine_force (PN_stdfloat force, int idx)
 Applies force at the wheel with index idx for acceleration.
BulletWheel create_wheel ()
 Factory method for creating wheels for this vehicle instance.
virtual TypeHandle force_init_type ()
BulletRigidBodyNodeget_chassis ()
 Returns the chassis of this vehicle.
PN_stdfloat get_current_speed_km_hour () const
 Returns the current speed in kilometers per hour.
LVector3 get_forward_vector () const
 Returns the forward vector representing the car's actual direction of movement.
int get_num_wheels () const
 Returns the number of wheels this vehicle has.
PN_stdfloat get_steering_value (int idx) const
 Returns the steering angle of the wheel with index idx in degrees.
BulletVehicleTuningget_tuning ()
 Returns a reference to the BulletVehicleTuning object of this vehicle which offers various vehicle-global tuning options.
virtual TypeHandle get_type () const
btRaycastVehicle * get_vehicle () const
BulletWheel get_wheel (int idx) const
 Returns the BulletWheel with index idx.
 MAKE_SEQ (get_wheels, get_num_wheels, get_wheel)
void reset_suspension ()
 Resets the vehicle's suspension.
void set_brake (PN_stdfloat brake, int idx)
 Applies braking force to the wheel with index idx.
void set_coordinate_system (BulletUpAxis up)
 Specifies which axis is "up".
void set_pitch_control (PN_stdfloat pitch)
void set_steering_value (PN_stdfloat steering, int idx)
 Sets the steering value (in degrees) of the wheel with index idx.
void sync_b2p ()

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Detailed Description

Definition at line 65 of file bulletVehicle.h.


Constructor & Destructor Documentation

BulletVehicle::BulletVehicle ( BulletWorld world,
BulletRigidBodyNode chassis 
)

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

Definition at line 29 of file bulletVehicle.cxx.

References set_coordinate_system().


Member Function Documentation

void BulletVehicle::apply_engine_force ( PN_stdfloat  force,
int  idx 
)

Applies force at the wheel with index idx for acceleration.

Definition at line 146 of file bulletVehicle.cxx.

References get_num_wheels().

BulletWheel BulletVehicle::create_wheel ( )

Factory method for creating wheels for this vehicle instance.

Definition at line 182 of file bulletVehicle.cxx.

BulletRigidBodyNode * BulletVehicle::get_chassis ( )

Returns the chassis of this vehicle.

The chassis is a rigid body node.

Definition at line 84 of file bulletVehicle.cxx.

PN_stdfloat BulletVehicle::get_current_speed_km_hour ( ) const

Returns the current speed in kilometers per hour.

Convert to miles using: km/h * 0.62 = mph

Definition at line 97 of file bulletVehicle.cxx.

LVector3 BulletVehicle::get_forward_vector ( ) const

Returns the forward vector representing the car's actual direction of movement.

The forward vetcor is given in global coordinates.

Definition at line 72 of file bulletVehicle.cxx.

int BulletVehicle::get_num_wheels ( ) const [inline]

Returns the number of wheels this vehicle has.

Definition at line 58 of file bulletVehicle.I.

Referenced by apply_engine_force(), get_steering_value(), get_wheel(), set_brake(), and set_steering_value().

PN_stdfloat BulletVehicle::get_steering_value ( int  idx) const

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

Definition at line 120 of file bulletVehicle.cxx.

References get_num_wheels().

BulletVehicleTuning & BulletVehicle::get_tuning ( ) [inline]

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!

Definition at line 47 of file bulletVehicle.I.

BulletWheel BulletVehicle::get_wheel ( int  idx) const

Returns the BulletWheel with index idx.

Causes an AssertionError if idx is equal or larger than the number of wheels.

Definition at line 226 of file bulletVehicle.cxx.

References BulletWheel::empty(), and get_num_wheels().

static void BulletVehicle::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from TypedReferenceCount.

Definition at line 112 of file bulletVehicle.h.

References TypedReferenceCount::init_type().

void BulletVehicle::reset_suspension ( )

Resets the vehicle's suspension.

Definition at line 108 of file bulletVehicle.cxx.

void BulletVehicle::set_brake ( PN_stdfloat  brake,
int  idx 
)

Applies braking force to the wheel with index idx.

Definition at line 158 of file bulletVehicle.cxx.

References get_num_wheels().

void BulletVehicle::set_coordinate_system ( BulletUpAxis  up)

Specifies which axis is "up".

Nessecary for the vehicle's suspension to work properly!

Definition at line 46 of file bulletVehicle.cxx.

Referenced by BulletVehicle().

void BulletVehicle::set_steering_value ( PN_stdfloat  steering,
int  idx 
)

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

Definition at line 133 of file bulletVehicle.cxx.

References get_num_wheels().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations