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);
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);
66 void enable_motor(
bool enable);
68 void set_motor_target(
const LQuaternion &quat, PN_stdfloat dt);
69 void set_motor_target(PN_stdfloat target_angle, PN_stdfloat dt);
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());
97 virtual TypeHandle get_type()
const {
98 return get_class_type();
100 virtual TypeHandle force_init_type() {
102 return get_class_type();
106 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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_hinge_angle
Returns the angle between node_a and node_b in degrees.
get_lower_limit
Returns the lower angular limit in degrees.
void enable_angular_motor(bool enable, PN_stdfloat target_velocity, PN_stdfloat max_impulse)
Applies an impulse to the constraint so that the angle changes at target_velocity where max_impulse i...
get_upper_limit
Returns the upper angular limit in degrees.
void set_axis(const LVector3 &axis)
Sets the hinge's rotation axis in world coordinates.
void set_limit(PN_stdfloat low, PN_stdfloat high, PN_stdfloat softness=0.9f, PN_stdfloat bias=0.3f, PN_stdfloat relaxation=1.0f)
Sets the lower and upper rotational limits in degrees.
void set_max_motor_impulse(PN_stdfloat max_impulse)
Sets the maximum impulse used to achieve the velocity set in enable_angular_motor.
BulletHingeConstraint(const BulletRigidBodyNode *node_a, const LPoint3 &pivot_a, const LVector3 &axis_a, bool use_frame_a=false)
Creates a hinge constraint in the same way as the other constructor, but uses the world as second bod...
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(),...