15 #include "bulletSphericalConstraint.h" 16 #include "bulletRigidBodyNode.h" 18 TypeHandle BulletSphericalConstraint::_type_handle;
25 BulletSphericalConstraint::
29 btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
30 btVector3 pos_a = LVecBase3_to_btVector3(pivot_a);
32 _constraint =
new btPoint2PointConstraint(*ptr_a, pos_a);
40 BulletSphericalConstraint::
46 btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
47 btVector3 pos_a = LVecBase3_to_btVector3(pivot_a);
49 btRigidBody *ptr_b = btRigidBody::upcast(node_b->get_object());
50 btVector3 pos_b = LVecBase3_to_btVector3(pivot_b);
52 _constraint =
new btPoint2PointConstraint(*ptr_a, *ptr_b, pos_a, pos_b);
60 btTypedConstraint *BulletSphericalConstraint::
71 void BulletSphericalConstraint::
72 set_pivot_a(
const LPoint3 &pivot_a) {
74 nassertv(!pivot_a.
is_nan());
75 _constraint->setPivotA(LVecBase3_to_btVector3(pivot_a));
83 void BulletSphericalConstraint::
84 set_pivot_b(
const LPoint3 &pivot_b) {
86 nassertv(!pivot_b.
is_nan());
87 _constraint->setPivotB(LVecBase3_to_btVector3(pivot_b));
95 LPoint3 BulletSphericalConstraint::
96 get_pivot_in_a()
const {
98 return btVector3_to_LPoint3(_constraint->getPivotInA());
106 LPoint3 BulletSphericalConstraint::
107 get_pivot_in_b()
const {
109 return btVector3_to_LPoint3(_constraint->getPivotInB());
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
TypeHandle is the identifier used to differentiate C++ class types.