- fix collision between linked bodies option for joints in native bullet (thanks to @iwgeric)

- add fixed osx binary (win/linux are built on the server)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9387 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 5090b397a4
commit 7c18281818
  1. BIN
      engine/lib/bullet/jME3-bullet-natives.jar
  2. BIN
      engine/lib/bullet/jarcontent/native/macosx/libbulletjme.jnilib
  3. 22
      engine/src/bullet-native/com_jme3_bullet_PhysicsSpace.cpp
  4. 8
      engine/src/bullet-native/com_jme3_bullet_PhysicsSpace.h
  5. 4
      engine/src/bullet/com/jme3/bullet/PhysicsSpace.java

@ -332,6 +332,28 @@ extern "C" {
space->getDynamicsWorld()->addConstraint(constraint);
}
/*
* Class: com_jme3_bullet_PhysicsSpace
* Method: addConstraint
* Signature: (JJZ)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraintC
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId, jboolean collision) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*>(objectId);
if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist.");
return;
}
if (constraint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The constraint object does not exist.");
return;
}
space->getDynamicsWorld()->addConstraint(constraint, collision);
}
/*
* Class: com_jme3_bullet_PhysicsSpace
* Method: removeConstraint

@ -119,6 +119,14 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeVehicle
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraint
(JNIEnv *, jobject, jlong, jlong);
/*
* Class: com_jme3_bullet_PhysicsSpace
* Method: addConstraintC
* Signature: (JJZ)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraintC
(JNIEnv *, jobject, jlong, jlong, jboolean);
/*
* Class: com_jme3_bullet_PhysicsSpace
* Method: removeConstraint

@ -562,6 +562,8 @@ public class PhysicsSpace {
private native void addConstraint(long space, long id);
private native void addConstraintC(long space, long id, boolean collision);
private native void removeConstraint(long space, long id);
private void addGhostObject(PhysicsGhostObject node) {
@ -626,7 +628,7 @@ public class PhysicsSpace {
private void addJoint(PhysicsJoint joint) {
Logger.getLogger(PhysicsSpace.class.getName()).log(Level.INFO, "Adding Joint {0} to physics space.", Long.toHexString(joint.getObjectId()));
physicsJoints.add(joint);
addConstraint(physicsSpaceId, joint.getObjectId());
addConstraintC(physicsSpaceId, joint.getObjectId(), !joint.isCollisionBetweenLinkedBodys());
// dynamicsWorld.addConstraint(joint.getObjectId(), !joint.isCollisionBetweenLinkedBodys());
}

Loading…
Cancel
Save