14#ifndef __BULLET_VEHICLE_H__
15#define __BULLET_VEHICLE_H__
35 void set_suspension_stiffness(PN_stdfloat value);
36 void set_suspension_compression(PN_stdfloat value);
37 void set_suspension_damping(PN_stdfloat value);
38 void set_max_suspension_travel_cm(PN_stdfloat value);
39 void set_friction_slip(PN_stdfloat value);
40 void set_max_suspension_force(PN_stdfloat value);
42 PN_stdfloat get_suspension_stiffness()
const;
43 PN_stdfloat get_suspension_compression()
const;
44 PN_stdfloat get_suspension_damping()
const;
45 PN_stdfloat get_max_suspension_travel_cm()
const;
46 PN_stdfloat get_friction_slip()
const;
47 PN_stdfloat get_max_suspension_force()
const;
49 MAKE_PROPERTY(suspension_stiffness, get_suspension_stiffness, set_suspension_stiffness);
50 MAKE_PROPERTY(suspension_compression, get_suspension_compression, set_suspension_compression);
51 MAKE_PROPERTY(suspension_damping, get_suspension_damping, set_suspension_damping);
52 MAKE_PROPERTY(max_suspension_travel_cm, get_max_suspension_travel_cm, set_max_suspension_travel_cm);
53 MAKE_PROPERTY(friction_slip, get_friction_slip, set_friction_slip);
54 MAKE_PROPERTY(max_suspension_force, get_max_suspension_force, set_max_suspension_force);
57 btRaycastVehicle::btVehicleTuning _;
59 friend class BulletVehicle;
76 void set_brake(PN_stdfloat brake,
int idx);
77 void set_pitch_control(PN_stdfloat pitch);
104 INLINE btRaycastVehicle *get_vehicle()
const;
110 btRaycastVehicle *_vehicle;
111 btVehicleRaycaster *_raycaster;
115 static btVector3 get_axis(
int idx);
121 static void init_type() {
122 TypedReferenceCount::init_type();
124 TypedReferenceCount::get_class_type());
126 virtual TypeHandle get_type()
const {
127 return get_class_type();
129 virtual TypeHandle force_init_type() {
131 return get_class_type();
135 static TypeHandle _type_handle;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_tuning
Returns a reference to the BulletVehicleTuning object of this vehicle which offers various vehicle-gl...
void do_sync_b2p()
Assumes the lock(bullet global lock) is held by the caller.
void set_steering_value(PN_stdfloat steering, int idx)
Sets the steering value (in degrees) of the wheel with index idx.
get_wheel
Returns the BulletWheel with index idx.
get_forward_vector
Returns the forward vector representing the car's actual direction of movement.
PN_stdfloat get_steering_value(int idx) const
Returns the steering angle of the wheel with index idx in degrees.
BulletRigidBodyNode * do_get_chassis()
Returns the chassis of this vehicle.
get_num_wheels
Returns the number of wheels this vehicle has.
void apply_engine_force(PN_stdfloat force, int idx)
Applies force at the wheel with index idx for acceleration.
get_chassis
Returns the chassis of this vehicle.
void reset_suspension()
Resets the vehicle's suspension.
get_current_speed_km_hour
Returns the current speed in kilometers per hour.
BulletVehicle(BulletWorld *world, BulletRigidBodyNode *chassis)
Creates a new BulletVehicle instance in the given world and with a chassis node.
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".
BulletWheel create_wheel()
Factory method for creating wheels for this vehicle instance.
One wheel of a BulletVehicle.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.