Bullet Native:

- dont use pointers in stack (thanks to chototsu)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7472 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent c8e09fd794
commit 29df71be5b
  1. 14
      engine/src/bullet/native/com_jme3_bullet_joints_ConeJoint.cpp
  2. 18
      engine/src/bullet/native/com_jme3_bullet_joints_HingeJoint.cpp
  3. 10
      engine/src/bullet/native/com_jme3_bullet_joints_Point2PointJoint.cpp
  4. 14
      engine/src/bullet/native/com_jme3_bullet_joints_SixDofJoint.cpp
  5. 14
      engine/src/bullet/native/com_jme3_bullet_joints_SliderJoint.cpp

@ -75,13 +75,13 @@ extern "C" {
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
btMatrix3x3* mtx1 = &btMatrix3x3();
btMatrix3x3* mtx2 = &btMatrix3x3();
btTransform* transA = &btTransform(*mtx1);
jmeBulletUtil::convert(env, pivotA, &transA->getOrigin());
jmeBulletUtil::convert(env, rotA, &transA->getBasis());
btTransform* transB = &btTransform(*mtx2);
jmeBulletUtil::convert(env, pivotB, &transB->getOrigin());
jmeBulletUtil::convert(env, rotB, &transB->getBasis());
btConeTwistConstraint* joint = new btConeTwistConstraint(*bodyA, *bodyB, *transA, *transB);
btTransform transA = btTransform(*mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
jmeBulletUtil::convert(env, rotA, &transA.getBasis());
btTransform transB = btTransform(*mtx2);
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btConeTwistConstraint* joint = new btConeTwistConstraint(*bodyA, *bodyB, transA, transB);
return (long) joint;
}

@ -160,15 +160,15 @@ extern "C" {
jmeClasses::initJavaClasses(env);
btRigidBody* bodyA = (btRigidBody*) bodyIdA;
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
btVector3* vec1 = &btVector3();
btVector3* vec2 = &btVector3();
btVector3* vec3 = &btVector3();
btVector3* vec4 = &btVector3();
jmeBulletUtil::convert(env, pivotA, vec1);
jmeBulletUtil::convert(env, axisA, vec2);
jmeBulletUtil::convert(env, pivotB, vec3);
jmeBulletUtil::convert(env, axisB, vec4);
btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, *vec1, *vec2, *vec3, *vec4);
btVector3 vec1 = btVector3();
btVector3 vec2 = btVector3();
btVector3 vec3 = btVector3();
btVector3 vec4 = btVector3();
jmeBulletUtil::convert(env, pivotA, &vec1);
jmeBulletUtil::convert(env, axisA, &vec2);
jmeBulletUtil::convert(env, pivotB, &vec3);
jmeBulletUtil::convert(env, axisB, &vec4);
btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, vec1, vec2, vec3, vec4);
return (long) joint;
}
#ifdef __cplusplus

@ -119,11 +119,11 @@ extern "C" {
//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);
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);
return (long) joint;
}

@ -126,13 +126,13 @@ extern "C" {
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
btMatrix3x3* mtx1 = &btMatrix3x3();
btMatrix3x3* mtx2 = &btMatrix3x3();
btTransform* transA = &btTransform(*mtx1);
jmeBulletUtil::convert(env, pivotA, &transA->getOrigin());
jmeBulletUtil::convert(env, rotA, &transA->getBasis());
btTransform* transB = &btTransform(*mtx2);
jmeBulletUtil::convert(env, pivotB, &transB->getOrigin());
jmeBulletUtil::convert(env, rotB, &transB->getBasis());
btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, *transA, *transB, useLinearReferenceFrameA);
btTransform transA = btTransform(*mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
jmeBulletUtil::convert(env, rotA, &transA.getBasis());
btTransform transB = btTransform(*mtx2);
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
return (long)joint;
}
#ifdef __cplusplus

@ -668,13 +668,13 @@ extern "C" {
btRigidBody* bodyB = (btRigidBody*) bodyIdB;
btMatrix3x3* mtx1=&btMatrix3x3();
btMatrix3x3* mtx2=&btMatrix3x3();
btTransform* transA = &btTransform(*mtx1);
jmeBulletUtil::convert(env, pivotA, &transA->getOrigin());
jmeBulletUtil::convert(env, rotA, &transA->getBasis());
btTransform* transB = &btTransform(*mtx2);
jmeBulletUtil::convert(env, pivotB, &transB->getOrigin());
jmeBulletUtil::convert(env, rotB, &transB->getBasis());
btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, *transA, *transB, useLinearReferenceFrameA);
btTransform transA = btTransform(*mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
jmeBulletUtil::convert(env, rotA, &transA.getBasis());
btTransform transB = btTransform(*mtx2);
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
return (long)joint;
}

Loading…
Cancel
Save