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 _;
74 void set_coordinate_system(BulletUpAxis up);
75 void set_steering_value(PN_stdfloat steering,
int idx);
76 void set_brake(PN_stdfloat brake,
int idx);
77 void set_pitch_control(PN_stdfloat pitch);
80 PN_stdfloat get_current_speed_km_hour()
const;
81 PN_stdfloat get_steering_value(
int idx)
const;
82 LVector3 get_forward_vector()
const;
84 void reset_suspension();
85 void apply_engine_force(PN_stdfloat force,
int idx);
90 int get_num_wheels()
const;
92 MAKE_SEQ(get_wheels, get_num_wheels, get_wheel);
97 MAKE_PROPERTY(chassis, get_chassis);
98 MAKE_PROPERTY(current_speed_km_hour, get_current_speed_km_hour);
99 MAKE_PROPERTY(forward_vector, get_forward_vector);
100 MAKE_SEQ_PROPERTY(wheels, get_num_wheels, get_wheel);
101 MAKE_PROPERTY(tuning, get_tuning);
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());
127 return get_class_type();
131 return get_class_type();
140 #endif // __BULLET_VEHICLE_H__ 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.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
Simulates a raycast vehicle which casts a ray per wheel at the ground as a cheap replacement for comp...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
One wheel of a BulletVehicle.