|
@@ -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
|