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