From 03318a6766af6b02458d0e92c23046b2f03f4092 Mon Sep 17 00:00:00 2001 From: Albert Santos Date: Sun, 12 Jun 2016 09:47:34 -0400 Subject: [PATCH] Fixed Point2PointJoint.createJoint() incorrectly creating btHingeConstraint Replaced it with btPoint2PointConstraint. --- .../cpp/com_jme3_bullet_joints_Point2PointJoint.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp b/jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp index c1bffb00e..f6d785583 100644 --- a/jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp +++ b/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(bodyIdA); btRigidBody* bodyB = reinterpret_cast(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(joint); }