- 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
This commit is contained in:
parent
5090b397a4
commit
7c18281818
Binary file not shown.
Binary file not shown.
@ -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
|
||||
|
@ -561,6 +561,8 @@ public class PhysicsSpace {
|
||||
private native void removeVehicle(long space, long id);
|
||||
|
||||
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);
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user