14 #ifndef __BULLET_HINGE_CONSTRAINT_H__ 15 #define __BULLET_HINGE_CONSTRAINT_H__ 34 const LPoint3 &pivot_a,
35 const LVector3 &axis_a,
36 bool use_frame_a=
false);
39 const LPoint3 &pivot_a,
40 const LPoint3 &pivot_b,
41 const LVector3 &axis_a,
42 const LVector3 &axis_b,
43 bool use_frame_a=
false);
47 bool use_frame_a=
false);
52 bool use_frame_a=
false);
56 PN_stdfloat get_hinge_angle();
57 PN_stdfloat get_lower_limit()
const;
58 PN_stdfloat get_upper_limit()
const;
59 bool get_angular_only()
const;
61 void set_angular_only(
bool value);
62 void set_limit(PN_stdfloat low, PN_stdfloat high, PN_stdfloat softness=0.9f, PN_stdfloat bias=0.3f, PN_stdfloat relaxation=1.0f);
63 void set_axis(
const LVector3 &axis);
65 void enable_angular_motor(
bool enable, PN_stdfloat target_velocity, PN_stdfloat max_impulse);
66 void enable_motor(
bool enable);
67 void set_max_motor_impulse(PN_stdfloat max_impulse);
68 void set_motor_target(
const LQuaternion &quat, PN_stdfloat dt);
69 void set_motor_target(PN_stdfloat target_angle, PN_stdfloat dt);
75 MAKE_PROPERTY(hinge_angle, get_hinge_angle);
76 MAKE_PROPERTY(lower_limit, get_lower_limit);
77 MAKE_PROPERTY(upper_limit, get_upper_limit);
78 MAKE_PROPERTY(angular_only, get_angular_only, set_angular_only);
79 MAKE_PROPERTY(frame_a, get_frame_a);
80 MAKE_PROPERTY(frame_b, get_frame_b);
83 virtual btTypedConstraint *ptr()
const;
86 btHingeConstraint *_constraint;
92 static void init_type() {
93 BulletConstraint::init_type();
95 BulletConstraint::get_class_type());
98 return get_class_type();
102 return get_class_type();
111 #endif // __BULLET_HINGE_CONSTRAINT_H__
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The hinge constraint lets two bodies rotate around a given axis while adhering to specified limits.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.