Fixed Point2PointJoint.createJoint() incorrectly creating btHingeConstraint

Replaced it with btPoint2PointConstraint.
define_list_fix
Albert Santos 9 years ago
parent 93b7be9b83
commit 03318a6766
  1. 13
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp

@ -146,14 +146,11 @@ extern "C" {
jmeClasses::initJavaClasses(env);
btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
//TODO: matrix not needed?
btMatrix3x3 mtx1 = btMatrix3x3();
btMatrix3x3 mtx2 = btMatrix3x3();
btTransform transA = btTransform(mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
btTransform transB = btTransform(mtx2);
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, transA, transB);
btVector3 pivotAIn;
btVector3 pivotBIn;
jmeBulletUtil::convert(env, pivotA, &pivotAIn);
jmeBulletUtil::convert(env, pivotB, &pivotBIn);
btPoint2PointConstraint * joint = new btPoint2PointConstraint(*bodyA, *bodyB, pivotAIn, pivotBIn);
return reinterpret_cast<jlong>(joint);
}

Loading…
Cancel
Save