21 TypeHandle BulletConeTwistConstraint::_type_handle;
26 BulletConeTwistConstraint::
30 btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
31 btTransform trans_a = TransformState_to_btTrans(frame_a);
33 _constraint =
new btConeTwistConstraint(*ptr_a, trans_a);
39 BulletConeTwistConstraint::
45 btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
46 btTransform trans_a = TransformState_to_btTrans(frame_a);
48 btRigidBody *ptr_b = btRigidBody::upcast(node_b->get_object());
49 btTransform trans_b = TransformState_to_btTrans(frame_b);
51 _constraint =
new btConeTwistConstraint(*ptr_a, *ptr_b, trans_a, trans_b);
57 btTypedConstraint *BulletConeTwistConstraint::
66 void BulletConeTwistConstraint::
67 set_limit(
int index, PN_stdfloat value) {
70 value = deg_2_rad(value);
72 _constraint->setLimit(index, value);
78 void BulletConeTwistConstraint::
79 set_limit(PN_stdfloat swing1, PN_stdfloat swing2, PN_stdfloat twist, PN_stdfloat softness, PN_stdfloat bias, PN_stdfloat relaxation) {
82 swing1 = deg_2_rad(swing1);
83 swing2 = deg_2_rad(swing2);
84 twist = deg_2_rad(twist);
86 _constraint->setLimit(swing1, swing2, twist, softness, bias, relaxation);
92 void BulletConeTwistConstraint::
93 set_damping(PN_stdfloat damping) {
96 _constraint->setDamping(damping);
102 PN_stdfloat BulletConeTwistConstraint::
103 get_fix_threshold()
const {
106 return _constraint->getFixThresh();
112 void BulletConeTwistConstraint::
113 set_fix_threshold(PN_stdfloat threshold) {
116 _constraint->setFixThresh(threshold);
122 void BulletConeTwistConstraint::
123 enable_motor(
bool enable) {
126 _constraint->enableMotor(enable);
132 void BulletConeTwistConstraint::
133 set_max_motor_impulse(PN_stdfloat max_impulse) {
136 _constraint->setMaxMotorImpulse(max_impulse);
142 void BulletConeTwistConstraint::
143 set_max_motor_impulse_normalized(PN_stdfloat max_impulse) {
146 _constraint->setMaxMotorImpulseNormalized(max_impulse);
152 void BulletConeTwistConstraint::
153 set_motor_target(
const LQuaternion &quat) {
156 _constraint->setMotorTarget(LQuaternion_to_btQuat(quat));
162 void BulletConeTwistConstraint::
163 set_motor_target_in_constraint_space(
const LQuaternion &quat) {
166 _constraint->setMotorTargetInConstraintSpace(LQuaternion_to_btQuat(quat));
172 void BulletConeTwistConstraint::
176 btTransform frame_a = TransformState_to_btTrans(ts_a);
177 btTransform frame_b = TransformState_to_btTrans(ts_b);
179 _constraint->setFrames(frame_a, frame_b);
186 get_frame_a()
const {
189 return btTrans_to_TransformState(_constraint->getAFrame());
196 get_frame_b()
const {
199 return btTrans_to_TransformState(_constraint->getBFrame());
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Similar to MutexHolder, but for a light mutex.
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.