Bullet Native:

- throw java NPE's on all native NPE cases

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7489 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 0bfd5aa2a3
commit 3829bcf2c7
  1. BIN
      engine/lib/bullet/jME3-bullet-natives.jar
  2. BIN
      engine/lib/bullet/jarcontent/native/macosx/libbulletjme.jnilib
  3. 54
      engine/src/bullet/native/com_jme3_bullet_PhysicsSpace.cpp
  4. 5
      engine/src/bullet/native/com_jme3_bullet_collision_PhysicsCollisionObject.cpp
  5. 20
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_CollisionShape.cpp
  6. 20
      engine/src/bullet/native/com_jme3_bullet_collision_shapes_CompoundCollisionShape.cpp
  7. 10
      engine/src/bullet/native/com_jme3_bullet_joints_ConeJoint.cpp
  8. 50
      engine/src/bullet/native/com_jme3_bullet_joints_HingeJoint.cpp
  9. 5
      engine/src/bullet/native/com_jme3_bullet_joints_PhysicsJoint.cpp
  10. 34
      engine/src/bullet/native/com_jme3_bullet_joints_Point2PointJoint.cpp
  11. 36
      engine/src/bullet/native/com_jme3_bullet_joints_SixDofJoint.cpp
  12. 286
      engine/src/bullet/native/com_jme3_bullet_joints_SliderJoint.cpp
  13. 100
      engine/src/bullet/native/com_jme3_bullet_joints_motors_RotationalLimitMotor.cpp
  14. 60
      engine/src/bullet/native/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp
  15. 124
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsCharacter.cpp
  16. 113
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsGhostObject.cpp
  17. 287
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsRigidBody.cpp
  18. 60
      engine/src/bullet/native/com_jme3_bullet_objects_PhysicsVehicle.cpp
  19. 32
      engine/src/bullet/native/com_jme3_bullet_objects_VehicleWheel.cpp
  20. 27
      engine/src/bullet/native/com_jme3_bullet_objects_infos_RigidBodyMotionState.cpp

@ -50,7 +50,7 @@ extern "C" {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
jmePhysicsSpace* space = new jmePhysicsSpace(env, object); jmePhysicsSpace* space = new jmePhysicsSpace(env, object);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space has not been created."); env->ThrowNew(newExc, "The physics space has not been created.");
return 0; return 0;
} }
@ -67,7 +67,7 @@ extern "C" {
(JNIEnv * env, jobject object, jlong spaceId, jfloat tpf, jint maxSteps, jfloat accuracy) { (JNIEnv * env, jobject object, jlong spaceId, jfloat tpf, jint maxSteps, jfloat accuracy) {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
@ -84,12 +84,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId; btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (collisionObject == NULL) { if (collisionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
@ -106,12 +106,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId; btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (collisionObject == NULL) { if (collisionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
@ -128,12 +128,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btRigidBody* collisionObject = (btRigidBody*) rigidBodyId; btRigidBody* collisionObject = (btRigidBody*) rigidBodyId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (collisionObject == NULL) { if (collisionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
@ -150,12 +150,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btRigidBody* collisionObject = (btRigidBody*) rigidBodyId; btRigidBody* collisionObject = (btRigidBody*) rigidBodyId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (collisionObject == NULL) { if (collisionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
@ -172,12 +172,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId; btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (collisionObject == NULL) { if (collisionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
@ -194,12 +194,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btCollisionObject* collisionObject = (btCollisionObject*) objectId; btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (collisionObject == NULL) { if (collisionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
@ -216,12 +216,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId; btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (actionObject == NULL) { if (actionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The action object does not exist."); env->ThrowNew(newExc, "The action object does not exist.");
return; return;
} }
@ -238,12 +238,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId; btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (actionObject == NULL) { if (actionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The action object does not exist."); env->ThrowNew(newExc, "The action object does not exist.");
return; return;
} }
@ -260,12 +260,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId; btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (actionObject == NULL) { if (actionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The vehicle object does not exist."); env->ThrowNew(newExc, "The vehicle object does not exist.");
return; return;
} }
@ -282,12 +282,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btActionInterface* actionObject = (btActionInterface*) objectId; btActionInterface* actionObject = (btActionInterface*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (actionObject == NULL) { if (actionObject == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The action object does not exist."); env->ThrowNew(newExc, "The action object does not exist.");
return; return;
} }
@ -304,12 +304,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btTypedConstraint* constraint = (btTypedConstraint*) objectId; btTypedConstraint* constraint = (btTypedConstraint*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (constraint == NULL) { if (constraint == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The constraint object does not exist."); env->ThrowNew(newExc, "The constraint object does not exist.");
return; return;
} }
@ -326,12 +326,12 @@ extern "C" {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
btTypedConstraint* constraint = (btTypedConstraint*) objectId; btTypedConstraint* constraint = (btTypedConstraint*) objectId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }
if (constraint == NULL) { if (constraint == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The constraint object does not exist."); env->ThrowNew(newExc, "The constraint object does not exist.");
return; return;
} }
@ -347,7 +347,7 @@ extern "C" {
(JNIEnv * env, jobject object, jlong spaceId, jobject vector) { (JNIEnv * env, jobject object, jlong spaceId, jobject vector) {
jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId; jmePhysicsSpace* space = (jmePhysicsSpace*) spaceId;
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/IllegalStateException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
return; return;
} }

@ -70,6 +70,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_finalizeNative JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_finalizeNative
(JNIEnv * env, jobject object, jlong objectId) { (JNIEnv * env, jobject object, jlong objectId) {
btCollisionObject* collisionObject = (btCollisionObject*) objectId; btCollisionObject* collisionObject = (btCollisionObject*) objectId;
if (collisionObject == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
delete(collisionObject); delete(collisionObject);
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_getMargin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_getMargin
(JNIEnv * env, jobject object, jlong shapeId) { (JNIEnv * env, jobject object, jlong shapeId) {
btCollisionShape* shape = (btCollisionShape*) shapeId; btCollisionShape* shape = (btCollisionShape*) shapeId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return shape->getMargin(); return shape->getMargin();
} }
@ -59,6 +64,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setLocalScaling JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setLocalScaling
(JNIEnv * env, jobject object, jlong shapeId, jobject scale) { (JNIEnv * env, jobject object, jlong shapeId, jobject scale) {
btCollisionShape* shape = (btCollisionShape*) shapeId; btCollisionShape* shape = (btCollisionShape*) shapeId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 scl = btVector3(); btVector3 scl = btVector3();
jmeBulletUtil::convert(env, scale, &scl); jmeBulletUtil::convert(env, scale, &scl);
shape->setLocalScaling(scl); shape->setLocalScaling(scl);
@ -72,6 +82,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setMargin JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setMargin
(JNIEnv * env, jobject object, jlong shapeId, jfloat newMargin) { (JNIEnv * env, jobject object, jlong shapeId, jfloat newMargin) {
btCollisionShape* shape = (btCollisionShape*) shapeId; btCollisionShape* shape = (btCollisionShape*) shapeId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
shape->setMargin(newMargin); shape->setMargin(newMargin);
} }
@ -83,6 +98,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_finalizeNative JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_finalizeNative
(JNIEnv * env, jobject object, jlong shapeId) { (JNIEnv * env, jobject object, jlong shapeId) {
btCollisionShape* shape = (btCollisionShape*) shapeId; btCollisionShape* shape = (btCollisionShape*) shapeId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
delete(shape); delete(shape);
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -60,7 +60,17 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_addChildShape JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_addChildShape
(JNIEnv *env, jobject object, jlong compoundId, jlong childId, jobject childLocation, jobject childRotation) { (JNIEnv *env, jobject object, jlong compoundId, jlong childId, jobject childLocation, jobject childRotation) {
btCompoundShape* shape = (btCompoundShape*) compoundId; btCompoundShape* shape = (btCompoundShape*) compoundId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
btCollisionShape* child = (btCollisionShape*) childId; btCollisionShape* child = (btCollisionShape*) childId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
btMatrix3x3 mtx = btMatrix3x3(); btMatrix3x3 mtx = btMatrix3x3();
btTransform trans = btTransform(mtx); btTransform trans = btTransform(mtx);
jmeBulletUtil::convert(env, childLocation, &trans.getOrigin()); jmeBulletUtil::convert(env, childLocation, &trans.getOrigin());
@ -77,7 +87,17 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_removeChildShape JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_removeChildShape
(JNIEnv * env, jobject object, jlong compoundId, jlong childId) { (JNIEnv * env, jobject object, jlong compoundId, jlong childId) {
btCompoundShape* shape = (btCompoundShape*) compoundId; btCompoundShape* shape = (btCompoundShape*) compoundId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
btCollisionShape* child = (btCollisionShape*) childId; btCollisionShape* child = (btCollisionShape*) childId;
if (shape == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
shape->removeChildShape(child); shape->removeChildShape(child);
return 0; return 0;
} }

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat swingSpan1, jfloat swingSpan2, jfloat twistSpan) { (JNIEnv * env, jobject object, jlong jointId, jfloat swingSpan1, jfloat swingSpan2, jfloat twistSpan) {
btConeTwistConstraint* joint = (btConeTwistConstraint*) jointId; btConeTwistConstraint* joint = (btConeTwistConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
//TODO: extended setLimit! //TODO: extended setLimit!
joint->setLimit(swingSpan1, swingSpan2, twistSpan); joint->setLimit(swingSpan1, swingSpan2, twistSpan);
} }
@ -60,6 +65,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setAngularOnly JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setAngularOnly
(JNIEnv * env, jobject object, jlong jointId, jboolean angularOnly) { (JNIEnv * env, jobject object, jlong jointId, jboolean angularOnly) {
btConeTwistConstraint* joint = (btConeTwistConstraint*) jointId; btConeTwistConstraint* joint = (btConeTwistConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setAngularOnly(angularOnly); joint->setAngularOnly(angularOnly);
} }

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_enableMotor JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_enableMotor
(JNIEnv * env, jobject object, jlong jointId, jboolean enable, jfloat targetVelocity, jfloat maxMotorImpulse) { (JNIEnv * env, jobject object, jlong jointId, jboolean enable, jfloat targetVelocity, jfloat maxMotorImpulse) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->enableAngularMotor(enable, targetVelocity, maxMotorImpulse); joint->enableAngularMotor(enable, targetVelocity, maxMotorImpulse);
} }
@ -59,6 +64,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_HingeJoint_getEnableAngularMotor JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_HingeJoint_getEnableAngularMotor
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return joint->getEnableAngularMotor(); return joint->getEnableAngularMotor();
} }
@ -70,6 +80,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMotorTargetVelocity JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMotorTargetVelocity
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getMotorTargetVelosity(); return joint->getMotorTargetVelosity();
} }
@ -81,6 +96,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMaxMotorImpulse JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMaxMotorImpulse
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getMaxMotorImpulse(); return joint->getMaxMotorImpulse();
} }
@ -92,6 +112,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFF JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFF
(JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high) { (JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
return joint->setLimit(low, high); return joint->setLimit(low, high);
} }
@ -103,6 +128,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFFFFF JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFFFFF
(JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high, jfloat softness, jfloat biasFactor, jfloat relaxationFactor) { (JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high, jfloat softness, jfloat biasFactor, jfloat relaxationFactor) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
return joint->setLimit(low, high, softness, biasFactor, relaxationFactor); return joint->setLimit(low, high, softness, biasFactor, relaxationFactor);
} }
@ -114,6 +144,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getUpperLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getUpperLimit
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getUpperLimit(); return joint->getUpperLimit();
} }
@ -125,6 +160,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getLowerLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getLowerLimit
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getLowerLimit(); return joint->getLowerLimit();
} }
@ -136,6 +176,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setAngularOnly JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setAngularOnly
(JNIEnv * env, jobject object, jlong jointId, jboolean angular) { (JNIEnv * env, jobject object, jlong jointId, jboolean angular) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setAngularOnly(angular); joint->setAngularOnly(angular);
} }
@ -147,6 +192,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getHingeAngle JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getHingeAngle
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btHingeConstraint* joint = (btHingeConstraint*) jointId; btHingeConstraint* joint = (btHingeConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getHingeAngle(); return joint->getHingeAngle();
} }

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_getAppliedImpulse JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_getAppliedImpulse
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btTypedConstraint* joint = (btTypedConstraint*) jointId; btTypedConstraint* joint = (btTypedConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getAppliedImpulse(); return joint->getAppliedImpulse();
} }

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setDamping JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setDamping
(JNIEnv * env, jobject object, jlong jointId, jfloat damping) { (JNIEnv * env, jobject object, jlong jointId, jfloat damping) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId; btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->m_setting.m_damping = damping; joint->m_setting.m_damping = damping;
} }
@ -59,6 +64,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setImpulseClamp JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setImpulseClamp
(JNIEnv * env, jobject object, jlong jointId, jfloat clamp) { (JNIEnv * env, jobject object, jlong jointId, jfloat clamp) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId; btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->m_setting.m_impulseClamp = clamp; joint->m_setting.m_impulseClamp = clamp;
} }
@ -70,6 +80,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setTau JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setTau
(JNIEnv * env, jobject object, jlong jointId, jfloat tau) { (JNIEnv * env, jobject object, jlong jointId, jfloat tau) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId; btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->m_setting.m_tau = tau; joint->m_setting.m_tau = tau;
} }
@ -81,6 +96,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getDamping JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getDamping
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId; btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->m_setting.m_damping; return joint->m_setting.m_damping;
} }
@ -92,6 +112,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getImpulseClamp JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getImpulseClamp
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId; btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->m_setting.m_damping; return joint->m_setting.m_damping;
} }
@ -103,6 +128,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getTau JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getTau
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId; btPoint2PointConstraint* joint = (btPoint2PointConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->m_setting.m_damping; return joint->m_setting.m_damping;
} }
@ -117,8 +147,8 @@ extern "C" {
btRigidBody* bodyA = (btRigidBody*) bodyIdA; btRigidBody* bodyA = (btRigidBody*) bodyIdA;
btRigidBody* bodyB = (btRigidBody*) bodyIdB; btRigidBody* bodyB = (btRigidBody*) bodyIdB;
//TODO: matrix not needed? //TODO: matrix not needed?
btMatrix3x3 mtx1=btMatrix3x3(); btMatrix3x3 mtx1 = btMatrix3x3();
btMatrix3x3 mtx2=btMatrix3x3(); btMatrix3x3 mtx2 = btMatrix3x3();
btTransform transA = btTransform(mtx1); btTransform transA = btTransform(mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin()); jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
btTransform transB = btTransform(mtx2); btTransform transB = btTransform(mtx2);

@ -48,7 +48,12 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getRotationalLimitMotor JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getRotationalLimitMotor
(JNIEnv * env, jobject object, jlong jointId, jint index) { (JNIEnv * env, jobject object, jlong jointId, jint index) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId; btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
return (long)joint->getRotationalLimitMotor(index); if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return (long) joint->getRotationalLimitMotor(index);
} }
/* /*
@ -59,7 +64,12 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getTranslationalLimitMotor JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getTranslationalLimitMotor
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId; btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
return (long)joint->getTranslationalLimitMotor(); if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return (long) joint->getTranslationalLimitMotor();
} }
/* /*
@ -70,6 +80,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearUpperLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearUpperLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) { (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId; btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec); jmeBulletUtil::convert(env, vector, &vec);
joint->setLinearUpperLimit(vec); joint->setLinearUpperLimit(vec);
@ -83,6 +98,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearLowerLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearLowerLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) { (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId; btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec); jmeBulletUtil::convert(env, vector, &vec);
joint->setLinearLowerLimit(vec); joint->setLinearLowerLimit(vec);
@ -96,6 +116,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularUpperLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularUpperLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) { (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId; btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec); jmeBulletUtil::convert(env, vector, &vec);
joint->setAngularUpperLimit(vec); joint->setAngularUpperLimit(vec);
@ -109,6 +134,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularLowerLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularLowerLimit
(JNIEnv * env, jobject object, jlong jointId, jobject vector) { (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId; btGeneric6DofConstraint* joint = (btGeneric6DofConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec); jmeBulletUtil::convert(env, vector, &vec);
joint->setAngularLowerLimit(vec); joint->setAngularLowerLimit(vec);
@ -133,7 +163,7 @@ extern "C" {
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin()); jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis()); jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA); btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
return (long)joint; return (long) joint;
} }
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerLinLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerLinLimit
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getLowerLinLimit(); return joint->getLowerLinLimit();
} }
@ -59,6 +64,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerLinLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerLinLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setLowerLinLimit(value); joint->setLowerLinLimit(value);
} }
@ -70,6 +80,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperLinLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperLinLimit
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getUpperLinLimit(); return joint->getUpperLinLimit();
} }
@ -81,6 +96,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperLinLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperLinLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setUpperLinLimit(value); joint->setUpperLinLimit(value);
} }
@ -92,6 +112,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerAngLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerAngLimit
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getLowerAngLimit(); return joint->getLowerAngLimit();
} }
@ -103,6 +128,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerAngLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerAngLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setLowerAngLimit(value); joint->setLowerAngLimit(value);
} }
@ -114,6 +144,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperAngLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperAngLimit
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getUpperAngLimit(); return joint->getUpperAngLimit();
} }
@ -125,6 +160,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperAngLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperAngLimit
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setUpperAngLimit(value); joint->setUpperAngLimit(value);
} }
@ -136,6 +176,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getSoftnessDirLin(); return joint->getSoftnessDirLin();
} }
@ -147,6 +192,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setSoftnessDirLin(value); joint->setSoftnessDirLin(value);
} }
@ -158,6 +208,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getRestitutionDirLin(); return joint->getRestitutionDirLin();
} }
@ -169,6 +224,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setRestitutionDirLin(value); joint->setRestitutionDirLin(value);
} }
@ -180,6 +240,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getDampingDirLin(); return joint->getDampingDirLin();
} }
@ -191,6 +256,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setDampingDirLin(value); joint->setDampingDirLin(value);
} }
@ -202,6 +272,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getSoftnessDirAng(); return joint->getSoftnessDirAng();
} }
@ -213,6 +288,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setSoftnessDirAng(value); joint->setSoftnessDirAng(value);
} }
@ -224,6 +304,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getRestitutionDirAng(); return joint->getRestitutionDirAng();
} }
@ -235,6 +320,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setRestitutionDirAng(value); joint->setRestitutionDirAng(value);
} }
@ -246,6 +336,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getDampingDirAng(); return joint->getDampingDirAng();
} }
@ -257,6 +352,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setDampingDirAng(value); joint->setDampingDirAng(value);
} }
@ -268,6 +368,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getSoftnessLimLin(); return joint->getSoftnessLimLin();
} }
@ -279,6 +384,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setSoftnessLimLin(value); joint->setSoftnessLimLin(value);
} }
@ -290,6 +400,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getRestitutionLimLin(); return joint->getRestitutionLimLin();
} }
@ -301,6 +416,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setRestitutionLimLin(value); joint->setRestitutionLimLin(value);
} }
@ -312,6 +432,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getDampingLimLin(); return joint->getDampingLimLin();
} }
@ -323,6 +448,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setDampingLimLin(value); joint->setDampingLimLin(value);
} }
@ -334,6 +464,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getSoftnessLimAng(); return joint->getSoftnessLimAng();
} }
@ -345,6 +480,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setSoftnessLimAng(value); joint->setSoftnessLimAng(value);
} }
@ -356,6 +496,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getRestitutionLimAng(); return joint->getRestitutionLimAng();
} }
@ -367,6 +512,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setRestitutionLimAng(value); joint->setRestitutionLimAng(value);
} }
@ -378,6 +528,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getDampingLimAng(); return joint->getDampingLimAng();
} }
@ -389,6 +544,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setDampingLimAng(value); joint->setDampingLimAng(value);
} }
@ -400,6 +560,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getSoftnessOrthoLin(); return joint->getSoftnessOrthoLin();
} }
@ -411,6 +576,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setSoftnessOrthoLin(value); joint->setSoftnessOrthoLin(value);
} }
@ -422,6 +592,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getRestitutionOrthoLin(); return joint->getRestitutionOrthoLin();
} }
@ -433,6 +608,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setRestitutionOrthoLin(value); joint->setRestitutionOrthoLin(value);
} }
@ -444,6 +624,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoLin JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoLin
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getDampingOrthoLin(); return joint->getDampingOrthoLin();
} }
@ -455,6 +640,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoLin JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoLin
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setDampingOrthoLin(value); joint->setDampingOrthoLin(value);
} }
@ -466,6 +656,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getSoftnessOrthoAng(); return joint->getSoftnessOrthoAng();
} }
@ -477,6 +672,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setSoftnessOrthoAng(value); joint->setSoftnessOrthoAng(value);
} }
@ -488,6 +688,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getRestitutionOrthoAng(); return joint->getRestitutionOrthoAng();
} }
@ -499,6 +704,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setRestitutionOrthoAng(value); joint->setRestitutionOrthoAng(value);
} }
@ -510,6 +720,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoAng JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoAng
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getDampingOrthoAng(); return joint->getDampingOrthoAng();
} }
@ -521,6 +736,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoAng JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoAng
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setDampingOrthoAng(value); joint->setDampingOrthoAng(value);
} }
@ -532,6 +752,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredLinMotor JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredLinMotor
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return joint->getPoweredLinMotor(); return joint->getPoweredLinMotor();
} }
@ -543,6 +768,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredLinMotor JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredLinMotor
(JNIEnv * env, jobject object, jlong jointId, jboolean value) { (JNIEnv * env, jobject object, jlong jointId, jboolean value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setPoweredLinMotor(value); joint->setPoweredLinMotor(value);
} }
@ -554,6 +784,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetLinMotorVelocity JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetLinMotorVelocity
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getTargetLinMotorVelocity(); return joint->getTargetLinMotorVelocity();
} }
@ -565,6 +800,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetLinMotorVelocity JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetLinMotorVelocity
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setTargetLinMotorVelocity(value); joint->setTargetLinMotorVelocity(value);
} }
@ -576,6 +816,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxLinMotorForce JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxLinMotorForce
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getMaxLinMotorForce(); return joint->getMaxLinMotorForce();
} }
@ -587,6 +832,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxLinMotorForce JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxLinMotorForce
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setMaxLinMotorForce(value); joint->setMaxLinMotorForce(value);
} }
@ -598,6 +848,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredAngMotor JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredAngMotor
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return joint->getPoweredAngMotor(); return joint->getPoweredAngMotor();
} }
@ -609,6 +864,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredAngMotor JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredAngMotor
(JNIEnv * env, jobject object, jlong jointId, jboolean value) { (JNIEnv * env, jobject object, jlong jointId, jboolean value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setPoweredAngMotor(value); joint->setPoweredAngMotor(value);
} }
@ -620,6 +880,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetAngMotorVelocity JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetAngMotorVelocity
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getTargetAngMotorVelocity(); return joint->getTargetAngMotorVelocity();
} }
@ -631,6 +896,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetAngMotorVelocity JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetAngMotorVelocity
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setTargetAngMotorVelocity(value); joint->setTargetAngMotorVelocity(value);
} }
@ -642,6 +912,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxAngMotorForce JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxAngMotorForce
(JNIEnv * env, jobject object, jlong jointId) { (JNIEnv * env, jobject object, jlong jointId) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return joint->getMaxAngMotorForce(); return joint->getMaxAngMotorForce();
} }
@ -653,6 +928,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxAngMotorForce JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxAngMotorForce
(JNIEnv * env, jobject object, jlong jointId, jfloat value) { (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
btSliderConstraint* joint = (btSliderConstraint*) jointId; btSliderConstraint* joint = (btSliderConstraint*) jointId;
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
joint->setMaxAngMotorForce(value); joint->setMaxAngMotorForce(value);
} }
@ -666,8 +946,8 @@ extern "C" {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
btRigidBody* bodyA = (btRigidBody*) bodyIdA; btRigidBody* bodyA = (btRigidBody*) bodyIdA;
btRigidBody* bodyB = (btRigidBody*) bodyIdB; btRigidBody* bodyB = (btRigidBody*) bodyIdB;
btMatrix3x3 mtx1=btMatrix3x3(); btMatrix3x3 mtx1 = btMatrix3x3();
btMatrix3x3 mtx2=btMatrix3x3(); btMatrix3x3 mtx2 = btMatrix3x3();
btTransform transA = btTransform(mtx1); btTransform transA = btTransform(mtx1);
jmeBulletUtil::convert(env, pivotA, &transA.getOrigin()); jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
jmeBulletUtil::convert(env, rotA, &transA.getBasis()); jmeBulletUtil::convert(env, rotA, &transA.getBasis());
@ -675,7 +955,7 @@ extern "C" {
jmeBulletUtil::convert(env, pivotB, &transB.getOrigin()); jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
jmeBulletUtil::convert(env, rotB, &transB.getBasis()); jmeBulletUtil::convert(env, rotB, &transB.getBasis());
btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA); btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
return (long)joint; return (long) joint;
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLoLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLoLimit
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_loLimit; return motor->m_loLimit;
} }
@ -59,6 +64,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLoLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLoLimit
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_loLimit = value; motor->m_loLimit = value;
} }
@ -70,6 +80,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getHiLimit JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getHiLimit
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_hiLimit; return motor->m_hiLimit;
} }
@ -81,6 +96,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setHiLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setHiLimit
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_hiLimit = value; motor->m_hiLimit = value;
} }
@ -92,6 +112,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getTargetVelocity JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getTargetVelocity
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_targetVelocity; return motor->m_targetVelocity;
} }
@ -103,6 +128,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setTargetVelocity JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setTargetVelocity
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_targetVelocity = value; motor->m_targetVelocity = value;
} }
@ -114,6 +144,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxMotorForce JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxMotorForce
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_maxMotorForce; return motor->m_maxMotorForce;
} }
@ -125,6 +160,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxMotorForce JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxMotorForce
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_maxMotorForce = value; motor->m_maxMotorForce = value;
} }
@ -136,6 +176,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxLimitForce JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxLimitForce
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_maxLimitForce; return motor->m_maxLimitForce;
} }
@ -147,6 +192,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxLimitForce JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxLimitForce
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_maxLimitForce = value; motor->m_maxLimitForce = value;
} }
@ -158,6 +208,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getDamping JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getDamping
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_damping; return motor->m_damping;
} }
@ -169,6 +224,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setDamping JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setDamping
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_damping = value; motor->m_damping = value;
} }
@ -180,6 +240,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLimitSoftness JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLimitSoftness
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_limitSoftness; return motor->m_limitSoftness;
} }
@ -191,6 +256,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLimitSoftness JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLimitSoftness
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_limitSoftness = value; motor->m_limitSoftness = value;
} }
@ -202,6 +272,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getERP JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getERP
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_stopERP; return motor->m_stopERP;
} }
@ -213,6 +288,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setERP JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setERP
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_stopERP = value; motor->m_stopERP = value;
} }
@ -224,6 +304,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getBounce JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getBounce
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_bounce; return motor->m_bounce;
} }
@ -235,6 +320,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setBounce JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setBounce
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_bounce = value; motor->m_bounce = value;
} }
@ -246,6 +336,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_isEnableMotor JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_isEnableMotor
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return motor->m_enableMotor; return motor->m_enableMotor;
} }
@ -257,6 +352,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setEnableMotor JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setEnableMotor
(JNIEnv *env, jobject object, jlong motorId, jboolean value) { (JNIEnv *env, jobject object, jlong motorId, jboolean value) {
btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId; btRotationalLimitMotor* motor = (btRotationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_enableMotor = value; motor->m_enableMotor = value;
} }

@ -48,6 +48,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLowerLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLowerLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) { (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &motor->m_lowerLimit, vector); jmeBulletUtil::convert(env, &motor->m_lowerLimit, vector);
} }
@ -59,6 +64,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLowerLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLowerLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) { (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, vector, &motor->m_lowerLimit); jmeBulletUtil::convert(env, vector, &motor->m_lowerLimit);
} }
@ -70,6 +80,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getUpperLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getUpperLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) { (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &motor->m_upperLimit, vector); jmeBulletUtil::convert(env, &motor->m_upperLimit, vector);
} }
@ -81,6 +96,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setUpperLimit JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setUpperLimit
(JNIEnv *env, jobject object, jlong motorId, jobject vector) { (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, vector, &motor->m_upperLimit); jmeBulletUtil::convert(env, vector, &motor->m_upperLimit);
} }
@ -92,6 +112,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getAccumulatedImpulse JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getAccumulatedImpulse
(JNIEnv *env, jobject object, jlong motorId, jobject vector) { (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &motor->m_accumulatedImpulse, vector); jmeBulletUtil::convert(env, &motor->m_accumulatedImpulse, vector);
} }
@ -103,6 +128,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setAccumulatedImpulse JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setAccumulatedImpulse
(JNIEnv *env, jobject object, jlong motorId, jobject vector) { (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, vector, &motor->m_accumulatedImpulse); jmeBulletUtil::convert(env, vector, &motor->m_accumulatedImpulse);
} }
@ -114,6 +144,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLetLimitSoftness JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLetLimitSoftness
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_limitSoftness; return motor->m_limitSoftness;
} }
@ -125,6 +160,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLimitSoftness JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLimitSoftness
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_limitSoftness = value; motor->m_limitSoftness = value;
} }
@ -136,6 +176,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getDamping JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getDamping
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_damping; return motor->m_damping;
} }
@ -147,6 +192,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setDamping JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setDamping
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_damping = value; motor->m_damping = value;
} }
@ -158,6 +208,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getRestitution JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getRestitution
(JNIEnv *env, jobject object, jlong motorId) { (JNIEnv *env, jobject object, jlong motorId) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return motor->m_restitution; return motor->m_restitution;
} }
@ -169,6 +224,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setRestitution JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setRestitution
(JNIEnv *env, jobject object, jlong motorId, jfloat value) { (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId; btTranslationalLimitMotor* motor = (btTranslationalLimitMotor*) motorId;
if (motor == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
motor->m_restitution = value; motor->m_restitution = value;
} }

@ -63,6 +63,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCharacterFlags JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCharacterFlags
(JNIEnv *env, jobject object, jlong ghostId) { (JNIEnv *env, jobject object, jlong ghostId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) ghostId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) ghostId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
ghost->setCollisionFlags(ghost->getCollisionFlags() | btCollisionObject::CF_CHARACTER_OBJECT); ghost->setCollisionFlags(ghost->getCollisionFlags() | btCollisionObject::CF_CHARACTER_OBJECT);
ghost->setCollisionFlags(ghost->getCollisionFlags() & ~btCollisionObject::CF_NO_CONTACT_RESPONSE); ghost->setCollisionFlags(ghost->getCollisionFlags() & ~btCollisionObject::CF_NO_CONTACT_RESPONSE);
} }
@ -75,6 +80,11 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createCharacterObject JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createCharacterObject
(JNIEnv *env, jobject object, jlong objectId, jlong shapeId, jfloat stepHeight) { (JNIEnv *env, jobject object, jlong objectId, jlong shapeId, jfloat stepHeight) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
//TODO: check convexshape! //TODO: check convexshape!
btConvexShape* shape = (btConvexShape*) shapeId; btConvexShape* shape = (btConvexShape*) shapeId;
btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight); btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight);
@ -89,6 +99,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_warp JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_warp
(JNIEnv *env, jobject object, jlong objectId, jobject vector) { (JNIEnv *env, jobject object, jlong objectId, jobject vector) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec); jmeBulletUtil::convert(env, vector, &vec);
character->warp(vec); character->warp(vec);
@ -102,6 +117,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setWalkDirection JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setWalkDirection
(JNIEnv *env, jobject object, jlong objectId, jobject vector) { (JNIEnv *env, jobject object, jlong objectId, jobject vector) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, vector, &vec); jmeBulletUtil::convert(env, vector, &vec);
character->setWalkDirection(vec); character->setWalkDirection(vec);
@ -115,6 +135,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setUpAxis JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setUpAxis
(JNIEnv *env, jobject object, jlong objectId, jint value) { (JNIEnv *env, jobject object, jlong objectId, jint value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
character->setUpAxis(value); character->setUpAxis(value);
} }
@ -126,6 +151,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setFallSpeed JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setFallSpeed
(JNIEnv *env, jobject object, jlong objectId, jfloat value) { (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
character->setFallSpeed(value); character->setFallSpeed(value);
} }
@ -137,6 +167,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setJumpSpeed JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setJumpSpeed
(JNIEnv *env, jobject object, jlong objectId, jfloat value) { (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
character->setJumpSpeed(value); character->setJumpSpeed(value);
} }
@ -148,6 +183,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setGravity JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setGravity
(JNIEnv *env, jobject object, jlong objectId, jfloat value) { (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
character->setGravity(value); character->setGravity(value);
} }
@ -159,6 +199,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getGravity JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getGravity
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return character->getGravity(); return character->getGravity();
} }
@ -170,6 +215,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxSlope JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxSlope
(JNIEnv *env, jobject object, jlong objectId, jfloat value) { (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
character->setMaxSlope(value); character->setMaxSlope(value);
} }
@ -181,6 +231,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxSlope JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxSlope
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return character->getMaxSlope(); return character->getMaxSlope();
} }
@ -192,6 +247,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_onGround JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_onGround
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return character->onGround(); return character->onGround();
} }
@ -203,6 +263,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_jump JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_jump
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
character->jump(); character->jump();
} }
@ -213,8 +278,13 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getPhysicsLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getPhysicsLocation
(JNIEnv *env, jobject object, jlong objectId, jobject value) { (JNIEnv *env, jobject object, jlong objectId, jobject value) {
btGhostObject* character = (btGhostObject*) objectId; btGhostObject* ghost = (btGhostObject*) objectId;
jmeBulletUtil::convert(env, &character->getWorldTransform().getOrigin(), value); if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &ghost->getWorldTransform().getOrigin(), value);
} }
/* /*
@ -224,8 +294,13 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdSweptSphereRadius JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong objectId, jfloat value) { (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btGhostObject* character = (btGhostObject*) objectId; btGhostObject* ghost = (btGhostObject*) objectId;
character->setCcdSweptSphereRadius(value); if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
ghost->setCcdSweptSphereRadius(value);
} }
/* /*
@ -235,8 +310,13 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdMotionThreshold JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdMotionThreshold
(JNIEnv *env, jobject object, jlong objectId, jfloat value) { (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btGhostObject* character = (btGhostObject*) objectId; btGhostObject* ghost = (btGhostObject*) objectId;
character->setCcdMotionThreshold(value); if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
ghost->setCcdMotionThreshold(value);
} }
/* /*
@ -246,8 +326,13 @@ extern "C" {
*/ */
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSweptSphereRadius JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btGhostObject* character = (btGhostObject*) objectId; btGhostObject* ghost = (btGhostObject*) objectId;
return character->getCcdSweptSphereRadius(); if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return ghost->getCcdSweptSphereRadius();
} }
/* /*
@ -257,8 +342,13 @@ extern "C" {
*/ */
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdMotionThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdMotionThreshold
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btGhostObject* character = (btGhostObject*) objectId; btGhostObject* ghost = (btGhostObject*) objectId;
return character->getCcdMotionThreshold(); if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return ghost->getCcdMotionThreshold();
} }
/* /*
@ -268,8 +358,13 @@ extern "C" {
*/ */
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSquareMotionThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSquareMotionThreshold
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btGhostObject* character = (btGhostObject*) objectId; btGhostObject* ghost = (btGhostObject*) objectId;
return character->getCcdSquareMotionThreshold(); if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return ghost->getCcdSquareMotionThreshold();
} }
/* /*
@ -280,6 +375,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_finalizeNativeCharacter JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_finalizeNativeCharacter
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btKinematicCharacterController* character = (btKinematicCharacterController*) objectId; btKinematicCharacterController* character = (btKinematicCharacterController*) objectId;
if (character == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
delete(character); delete(character);
} }

@ -63,6 +63,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setGhostFlags JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setGhostFlags
(JNIEnv *env, jobject object, jlong objectId) { (JNIEnv *env, jobject object, jlong objectId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
ghost->setCollisionFlags(ghost->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE); ghost->setCollisionFlags(ghost->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
} }
@ -72,8 +77,13 @@ extern "C" {
* Signature: (JLcom/jme3/math/Vector3f;)V * Signature: (JLcom/jme3/math/Vector3f;)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsLocation
(JNIEnv *env, jobject object, jlong objectId, jobject value){ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getOrigin()); jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getOrigin());
} }
@ -83,8 +93,13 @@ extern "C" {
* Signature: (JLcom/jme3/math/Matrix3f;)V * Signature: (JLcom/jme3/math/Matrix3f;)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2 JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
(JNIEnv *env, jobject object, jlong objectId, jobject value){ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getBasis()); jmeBulletUtil::convert(env, value, &ghost->getWorldTransform().getBasis());
} }
@ -94,8 +109,13 @@ extern "C" {
* Signature: (JLcom/jme3/math/Quaternion;)V * Signature: (JLcom/jme3/math/Quaternion;)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Quaternion_2 JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
(JNIEnv *env, jobject object, jlong objectId, jobject value){ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convertQuat(env, value, &ghost->getWorldTransform().getBasis()); jmeBulletUtil::convertQuat(env, value, &ghost->getWorldTransform().getBasis());
} }
@ -105,8 +125,13 @@ extern "C" {
* Signature: (JLcom/jme3/math/Vector3f;)V * Signature: (JLcom/jme3/math/Vector3f;)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsLocation
(JNIEnv *env, jobject object, jlong objectId, jobject value){ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &ghost->getWorldTransform().getOrigin(), value); jmeBulletUtil::convert(env, &ghost->getWorldTransform().getOrigin(), value);
} }
@ -116,8 +141,13 @@ extern "C" {
* Signature: (JLcom/jme3/math/Quaternion;)V * Signature: (JLcom/jme3/math/Quaternion;)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotation
(JNIEnv *env, jobject object, jlong objectId, jobject value){ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convertQuat(env, &ghost->getWorldTransform().getBasis(), value); jmeBulletUtil::convertQuat(env, &ghost->getWorldTransform().getBasis(), value);
} }
@ -127,8 +157,13 @@ extern "C" {
* Signature: (JLcom/jme3/math/Matrix3f;)V * Signature: (JLcom/jme3/math/Matrix3f;)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotationMatrix JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotationMatrix
(JNIEnv *env, jobject object, jlong objectId, jobject value){ (JNIEnv *env, jobject object, jlong objectId, jobject value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &ghost->getWorldTransform().getBasis(), value); jmeBulletUtil::convert(env, &ghost->getWorldTransform().getBasis(), value);
} }
@ -138,8 +173,13 @@ extern "C" {
* Signature: (J)I * Signature: (J)I
*/ */
JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingCount JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingCount
(JNIEnv *env, jobject object, jlong objectId){ (JNIEnv *env, jobject object, jlong objectId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return ghost->getNumOverlappingObjects(); return ghost->getNumOverlappingObjects();
} }
@ -149,8 +189,13 @@ extern "C" {
* Signature: (JF)V * Signature: (JF)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdSweptSphereRadius JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong objectId, jfloat value){ (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
ghost->setCcdSweptSphereRadius(value); ghost->setCcdSweptSphereRadius(value);
} }
@ -160,8 +205,13 @@ extern "C" {
* Signature: (JF)V * Signature: (JF)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdMotionThreshold JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdMotionThreshold
(JNIEnv *env, jobject object, jlong objectId, jfloat value){ (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
ghost->setCcdMotionThreshold(value); ghost->setCcdMotionThreshold(value);
} }
@ -171,8 +221,13 @@ extern "C" {
* Signature: (J)F * Signature: (J)F
*/ */
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSweptSphereRadius JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong objectId){ (JNIEnv *env, jobject object, jlong objectId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return ghost->getCcdSweptSphereRadius(); return ghost->getCcdSweptSphereRadius();
} }
@ -182,8 +237,13 @@ extern "C" {
* Signature: (J)F * Signature: (J)F
*/ */
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdMotionThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdMotionThreshold
(JNIEnv *env, jobject object, jlong objectId){ (JNIEnv *env, jobject object, jlong objectId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return ghost->getCcdMotionThreshold(); return ghost->getCcdMotionThreshold();
} }
@ -193,8 +253,13 @@ extern "C" {
* Signature: (J)F * Signature: (J)F
*/ */
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSquareMotionThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSquareMotionThreshold
(JNIEnv *env, jobject object, jlong objectId){ (JNIEnv *env, jobject object, jlong objectId) {
btPairCachingGhostObject* ghost = (btPairCachingGhostObject*)objectId; btPairCachingGhostObject* ghost = (btPairCachingGhostObject*) objectId;
if (ghost == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return ghost->getCcdSquareMotionThreshold(); return ghost->getCcdSquareMotionThreshold();
} }

@ -65,6 +65,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isInWorld JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isInWorld
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return body->isInWorld(); return body->isInWorld();
} }
@ -76,16 +81,21 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsLocation
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
// if (body->isStaticOrKinematicObject() || !body->isInWorld()) if (body == NULL) {
((jmeMotionState*)body->getMotionState())->setKinematicLocation(env, value); jclass newExc = env->FindClass("java/lang/NullPointerException");
body->setCenterOfMassTransform(((jmeMotionState*)body->getMotionState())->worldTransform); env->ThrowNew(newExc, "The native object does not exist.");
// else{ return;
// btMatrix3x3* mtx = &btMatrix3x3(); }
// btTransform* trans = &btTransform(*mtx); // if (body->isStaticOrKinematicObject() || !body->isInWorld())
// trans->setBasis(body->getCenterOfMassTransform().getBasis()); ((jmeMotionState*) body->getMotionState())->setKinematicLocation(env, value);
// jmeBulletUtil::convert(env, value, &trans->getOrigin()); body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
// body->setCenterOfMassTransform(*trans); // else{
// } // btMatrix3x3* mtx = &btMatrix3x3();
// btTransform* trans = &btTransform(*mtx);
// trans->setBasis(body->getCenterOfMassTransform().getBasis());
// jmeBulletUtil::convert(env, value, &trans->getOrigin());
// body->setCenterOfMassTransform(*trans);
// }
} }
/* /*
@ -96,16 +106,21 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2 JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
// if (body->isStaticOrKinematicObject() || !body->isInWorld()) if (body == NULL) {
((jmeMotionState*)body->getMotionState())->setKinematicRotation(env, value); jclass newExc = env->FindClass("java/lang/NullPointerException");
body->setCenterOfMassTransform(((jmeMotionState*)body->getMotionState())->worldTransform); env->ThrowNew(newExc, "The native object does not exist.");
// else{ return;
// btMatrix3x3* mtx = &btMatrix3x3(); }
// btTransform* trans = &btTransform(*mtx); // if (body->isStaticOrKinematicObject() || !body->isInWorld())
// trans->setOrigin(body->getCenterOfMassTransform().getOrigin()); ((jmeMotionState*) body->getMotionState())->setKinematicRotation(env, value);
// jmeBulletUtil::convert(env, value, &trans->getBasis()); body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
// body->setCenterOfMassTransform(*trans); // else{
// } // btMatrix3x3* mtx = &btMatrix3x3();
// btTransform* trans = &btTransform(*mtx);
// trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
// jmeBulletUtil::convert(env, value, &trans->getBasis());
// body->setCenterOfMassTransform(*trans);
// }
} }
/* /*
@ -116,16 +131,21 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Quaternion_2 JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
// if (body->isStaticOrKinematicObject() || !body->isInWorld()) if (body == NULL) {
((jmeMotionState*)body->getMotionState())->setKinematicRotationQuat(env, value); jclass newExc = env->FindClass("java/lang/NullPointerException");
body->setCenterOfMassTransform(((jmeMotionState*)body->getMotionState())->worldTransform); env->ThrowNew(newExc, "The native object does not exist.");
// else{ return;
// btMatrix3x3* mtx = &btMatrix3x3(); }
// btTransform* trans = &btTransform(*mtx); // if (body->isStaticOrKinematicObject() || !body->isInWorld())
// trans->setOrigin(body->getCenterOfMassTransform().getOrigin()); ((jmeMotionState*) body->getMotionState())->setKinematicRotationQuat(env, value);
// jmeBulletUtil::convertQuat(env, value, &trans->getBasis()); body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
// body->setCenterOfMassTransform(*trans); // else{
// } // btMatrix3x3* mtx = &btMatrix3x3();
// btTransform* trans = &btTransform(*mtx);
// trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
// jmeBulletUtil::convertQuat(env, value, &trans->getBasis());
// body->setCenterOfMassTransform(*trans);
// }
} }
/* /*
@ -136,6 +156,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsLocation
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &body->getWorldTransform().getOrigin(), value); jmeBulletUtil::convert(env, &body->getWorldTransform().getOrigin(), value);
} }
@ -147,6 +172,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotation
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convertQuat(env, &body->getWorldTransform().getBasis(), value); jmeBulletUtil::convertQuat(env, &body->getWorldTransform().getBasis(), value);
} }
@ -158,6 +188,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotationMatrix JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotationMatrix
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &body->getWorldTransform().getBasis(), value); jmeBulletUtil::convert(env, &body->getWorldTransform().getBasis(), value);
} }
@ -169,6 +204,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setKinematic JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setKinematic
(JNIEnv *env, jobject object, jlong bodyId, jboolean value) { (JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
if (value) { if (value) {
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
body->setActivationState(DISABLE_DEACTIVATION); body->setActivationState(DISABLE_DEACTIVATION);
@ -186,6 +226,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdSweptSphereRadius JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setCcdSweptSphereRadius(value); body->setCcdSweptSphereRadius(value);
} }
@ -197,6 +242,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdMotionThreshold JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdMotionThreshold
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setCcdMotionThreshold(value); body->setCcdMotionThreshold(value);
} }
@ -208,6 +258,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSweptSphereRadius JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSweptSphereRadius
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getCcdSweptSphereRadius(); return body->getCcdSweptSphereRadius();
} }
@ -219,6 +274,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdMotionThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdMotionThreshold
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getCcdMotionThreshold(); return body->getCcdMotionThreshold();
} }
@ -230,6 +290,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSquareMotionThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSquareMotionThreshold
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getCcdSquareMotionThreshold(); return body->getCcdSquareMotionThreshold();
} }
@ -241,6 +306,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setStatic JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setStatic
(JNIEnv *env, jobject object, jlong bodyId, jboolean value) { (JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
if (value) { if (value) {
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_STATIC_OBJECT); body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_STATIC_OBJECT);
} else { } else {
@ -256,6 +326,11 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_updateMassProps JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_updateMassProps
(JNIEnv *env, jobject object, jlong bodyId, jlong shapeId, jfloat mass) { (JNIEnv *env, jobject object, jlong bodyId, jlong shapeId, jfloat mass) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
btCollisionShape* shape = (btCollisionShape*) shapeId; btCollisionShape* shape = (btCollisionShape*) shapeId;
btVector3 localInertia = btVector3(); btVector3 localInertia = btVector3();
shape->calculateLocalInertia(mass, localInertia); shape->calculateLocalInertia(mass, localInertia);
@ -271,6 +346,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getGravity JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getGravity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &body->getGravity(), value); jmeBulletUtil::convert(env, &body->getGravity(), value);
} }
@ -282,6 +362,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setGravity JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setGravity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, value, &vec); jmeBulletUtil::convert(env, value, &vec);
body->setGravity(vec); body->setGravity(vec);
@ -295,6 +380,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getFriction JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getFriction
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getFriction(); return body->getFriction();
} }
@ -306,6 +396,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setFriction JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setFriction
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setFriction(value); body->setFriction(value);
} }
@ -317,6 +412,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setDamping JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setDamping
(JNIEnv *env, jobject object, jlong bodyId, jfloat value1, jfloat value2) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value1, jfloat value2) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setDamping(value1, value2); body->setDamping(value1, value2);
} }
@ -328,6 +428,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularDamping JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularDamping
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setDamping(body->getLinearDamping(), value); body->setDamping(body->getLinearDamping(), value);
} }
@ -339,6 +444,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearDamping JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearDamping
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getLinearDamping(); return body->getLinearDamping();
} }
@ -350,6 +460,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularDamping JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularDamping
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getAngularDamping(); return body->getAngularDamping();
} }
@ -361,6 +476,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getRestitution JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getRestitution
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getRestitution(); return body->getRestitution();
} }
@ -372,6 +492,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setRestitution JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setRestitution
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setRestitution(value); body->setRestitution(value);
} }
@ -383,6 +508,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularVelocity JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &body->getAngularVelocity(), value); jmeBulletUtil::convert(env, &body->getAngularVelocity(), value);
} }
@ -394,8 +524,13 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularVelocity JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, value,&vec); jmeBulletUtil::convert(env, value, &vec);
body->setAngularVelocity(vec); body->setAngularVelocity(vec);
} }
@ -407,6 +542,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearVelocity JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &body->getLinearVelocity(), value); jmeBulletUtil::convert(env, &body->getLinearVelocity(), value);
} }
@ -418,6 +558,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearVelocity JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearVelocity
(JNIEnv *env, jobject object, jlong bodyId, jobject value) { (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec = btVector3(); btVector3 vec = btVector3();
jmeBulletUtil::convert(env, value, &vec); jmeBulletUtil::convert(env, value, &vec);
body->setLinearVelocity(vec); body->setLinearVelocity(vec);
@ -431,6 +576,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyForce JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyForce
(JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) { (JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec1 = btVector3(); btVector3 vec1 = btVector3();
btVector3 vec2 = btVector3(); btVector3 vec2 = btVector3();
jmeBulletUtil::convert(env, force, &vec1); jmeBulletUtil::convert(env, force, &vec1);
@ -446,6 +596,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyCentralForce JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyCentralForce
(JNIEnv *env, jobject object, jlong bodyId, jobject force) { (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec1 = btVector3(); btVector3 vec1 = btVector3();
jmeBulletUtil::convert(env, force, &vec1); jmeBulletUtil::convert(env, force, &vec1);
body->applyCentralForce(vec1); body->applyCentralForce(vec1);
@ -459,6 +614,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorque JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorque
(JNIEnv *env, jobject object, jlong bodyId, jobject force) { (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec1 = btVector3(); btVector3 vec1 = btVector3();
jmeBulletUtil::convert(env, force, &vec1); jmeBulletUtil::convert(env, force, &vec1);
body->applyTorque(vec1); body->applyTorque(vec1);
@ -472,6 +632,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyImpulse JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyImpulse
(JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) { (JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec1 = btVector3(); btVector3 vec1 = btVector3();
btVector3 vec2 = btVector3(); btVector3 vec2 = btVector3();
jmeBulletUtil::convert(env, force, &vec1); jmeBulletUtil::convert(env, force, &vec1);
@ -487,6 +652,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorqueImpulse JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorqueImpulse
(JNIEnv *env, jobject object, jlong bodyId, jobject force) { (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec1 = btVector3(); btVector3 vec1 = btVector3();
jmeBulletUtil::convert(env, force, &vec1); jmeBulletUtil::convert(env, force, &vec1);
body->applyTorqueImpulse(vec1); body->applyTorqueImpulse(vec1);
@ -500,6 +670,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_clearForces JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_clearForces
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->clearForces(); body->clearForces();
} }
@ -511,6 +686,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCollisionShape JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCollisionShape
(JNIEnv *env, jobject object, jlong bodyId, jlong shapeId) { (JNIEnv *env, jobject object, jlong bodyId, jlong shapeId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btCollisionShape* shape = (btCollisionShape*) shapeId; btCollisionShape* shape = (btCollisionShape*) shapeId;
body->setCollisionShape(shape); body->setCollisionShape(shape);
} }
@ -523,6 +703,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_activate JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_activate
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->activate(false); body->activate(false);
} }
@ -534,6 +719,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isActive JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isActive
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return body->isActive(); return body->isActive();
} }
@ -545,6 +735,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setSleepingThresholds JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setSleepingThresholds
(JNIEnv *env, jobject object, jlong bodyId, jfloat linear, jfloat angular) { (JNIEnv *env, jobject object, jlong bodyId, jfloat linear, jfloat angular) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setSleepingThresholds(linear, angular); body->setSleepingThresholds(linear, angular);
} }
@ -556,6 +751,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearSleepingThreshold JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setSleepingThresholds(value, body->getAngularSleepingThreshold()); body->setSleepingThresholds(value, body->getAngularSleepingThreshold());
} }
@ -567,6 +767,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularSleepingThreshold JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
body->setSleepingThresholds(body->getLinearSleepingThreshold(), value); body->setSleepingThresholds(body->getLinearSleepingThreshold(), value);
} }
@ -578,6 +783,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearSleepingThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getLinearSleepingThreshold(); return body->getLinearSleepingThreshold();
} }
@ -589,6 +799,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularSleepingThreshold JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularSleepingThreshold
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getAngularSleepingThreshold(); return body->getAngularSleepingThreshold();
} }
@ -600,6 +815,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
(JNIEnv *env, jobject object, jlong bodyId) { (JNIEnv *env, jobject object, jlong bodyId) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return body->getAngularFactor().getX(); return body->getAngularFactor().getX();
} }
@ -611,6 +831,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) { (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
btRigidBody* body = (btRigidBody*) bodyId; btRigidBody* body = (btRigidBody*) bodyId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btVector3 vec1 = btVector3(); btVector3 vec1 = btVector3();
vec1.setX(value); vec1.setX(value);
vec1.setY(value); vec1.setY(value);

@ -50,6 +50,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_updateWheelTransform JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_updateWheelTransform
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jboolean interpolated) { (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jboolean interpolated) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
vehicle->updateWheelTransform(wheel, interpolated); vehicle->updateWheelTransform(wheel, interpolated);
} }
@ -62,6 +67,11 @@ extern "C" {
(JNIEnv *env, jobject object, jlong bodyId, jlong spaceId) { (JNIEnv *env, jobject object, jlong bodyId, jlong spaceId) {
//btRigidBody* body = (btRigidBody*) bodyId; //btRigidBody* body = (btRigidBody*) bodyId;
btDiscreteDynamicsWorld* spsace = (btDiscreteDynamicsWorld*) spaceId; btDiscreteDynamicsWorld* spsace = (btDiscreteDynamicsWorld*) spaceId;
if (spsace == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(spsace); btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(spsace);
return (long) caster; return (long) caster;
} }
@ -74,6 +84,11 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createRaycastVehicle JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createRaycastVehicle
(JNIEnv *env, jobject object, jlong objectId, jlong casterId) { (JNIEnv *env, jobject object, jlong objectId, jlong casterId) {
btRigidBody* body = (btRigidBody*) objectId; btRigidBody* body = (btRigidBody*) objectId;
if (body == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
body->setActivationState(DISABLE_DEACTIVATION); body->setActivationState(DISABLE_DEACTIVATION);
btVehicleRaycaster* caster = (btDefaultVehicleRaycaster*) casterId; btVehicleRaycaster* caster = (btDefaultVehicleRaycaster*) casterId;
btRaycastVehicle::btVehicleTuning tuning; btRaycastVehicle::btVehicleTuning tuning;
@ -90,6 +105,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_setCoordinateSystem JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_setCoordinateSystem
(JNIEnv *env, jobject object, jlong vehicleId, jint right, jint up, jint forward) { (JNIEnv *env, jobject object, jlong vehicleId, jint right, jint up, jint forward) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
vehicle->setCoordinateSystem(right, up, forward); vehicle->setCoordinateSystem(right, up, forward);
} }
@ -101,6 +121,11 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_addWheel JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_addWheel
(JNIEnv *env, jobject object, jlong vehicleId, jobject location, jobject direction, jobject axle, jfloat restLength, jfloat radius, jobject tuning, jboolean frontWheel) { (JNIEnv *env, jobject object, jlong vehicleId, jobject location, jobject direction, jobject axle, jfloat restLength, jfloat radius, jobject tuning, jboolean frontWheel) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
btVector3 vec1 = btVector3(); btVector3 vec1 = btVector3();
btVector3 vec2 = btVector3(); btVector3 vec2 = btVector3();
btVector3 vec3 = btVector3(); btVector3 vec3 = btVector3();
@ -120,6 +145,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_resetSuspension JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_resetSuspension
(JNIEnv *env, jobject object, jlong vehicleId) { (JNIEnv *env, jobject object, jlong vehicleId) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
vehicle->resetSuspension(); vehicle->resetSuspension();
} }
@ -131,6 +161,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_applyEngineForce JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_applyEngineForce
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat force) { (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat force) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
vehicle->applyEngineForce(force, wheel); vehicle->applyEngineForce(force, wheel);
} }
@ -142,6 +177,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_steer JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_steer
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) { (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
vehicle->setSteeringValue(value, wheel); vehicle->setSteeringValue(value, wheel);
} }
@ -153,6 +193,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_brake JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_brake
(JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) { (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
vehicle->setBrake(value, wheel); vehicle->setBrake(value, wheel);
} }
@ -164,6 +209,11 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getCurrentVehicleSpeedKmHour JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getCurrentVehicleSpeedKmHour
(JNIEnv *env, jobject object, jlong vehicleId) { (JNIEnv *env, jobject object, jlong vehicleId) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return vehicle->getCurrentSpeedKmHour(); return vehicle->getCurrentSpeedKmHour();
} }
@ -175,6 +225,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getForwardVector JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getForwardVector
(JNIEnv *env, jobject object, jlong vehicleId, jobject out) { (JNIEnv *env, jobject object, jlong vehicleId, jobject out) {
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &vehicle->getForwardVector(), out); jmeBulletUtil::convert(env, &vehicle->getForwardVector(), out);
} }
@ -187,6 +242,11 @@ extern "C" {
(JNIEnv *env, jobject object, jlong casterId, jlong vehicleId) { (JNIEnv *env, jobject object, jlong casterId, jlong vehicleId) {
btVehicleRaycaster* rayCaster = (btVehicleRaycaster*) casterId; btVehicleRaycaster* rayCaster = (btVehicleRaycaster*) casterId;
btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId; btRaycastVehicle* vehicle = (btRaycastVehicle*) vehicleId;
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
delete(vehicle); delete(vehicle);
delete(rayCaster); delete(rayCaster);
} }

@ -49,6 +49,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelLocation
(JNIEnv *env, jobject object, jlong wheelId, jobject out) { (JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId; btWheelInfo* wheel = (btWheelInfo*) wheelId;
if (wheel == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &wheel->m_worldTransform.getOrigin(), out); jmeBulletUtil::convert(env, &wheel->m_worldTransform.getOrigin(), out);
} }
@ -60,6 +65,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelRotation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelRotation
(JNIEnv *env, jobject object, jlong wheelId, jobject out) { (JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId; btWheelInfo* wheel = (btWheelInfo*) wheelId;
if (wheel == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &wheel->m_worldTransform.getBasis(), out); jmeBulletUtil::convert(env, &wheel->m_worldTransform.getBasis(), out);
} }
@ -92,6 +102,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionLocation
(JNIEnv *env, jobject object, jlong wheelId, jobject out) { (JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId; btWheelInfo* wheel = (btWheelInfo*) wheelId;
if (wheel == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &wheel->m_raycastInfo.m_contactPointWS, out); jmeBulletUtil::convert(env, &wheel->m_raycastInfo.m_contactPointWS, out);
} }
@ -103,6 +118,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionNormal JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionNormal
(JNIEnv *env, jobject object, jlong wheelId, jobject out) { (JNIEnv *env, jobject object, jlong wheelId, jobject out) {
btWheelInfo* wheel = (btWheelInfo*) wheelId; btWheelInfo* wheel = (btWheelInfo*) wheelId;
if (wheel == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &wheel->m_raycastInfo.m_contactNormalWS, out); jmeBulletUtil::convert(env, &wheel->m_raycastInfo.m_contactNormalWS, out);
} }
@ -114,12 +134,22 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getSkidInfo JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getSkidInfo
(JNIEnv *env, jobject object, jlong wheelId) { (JNIEnv *env, jobject object, jlong wheelId) {
btWheelInfo* wheel = (btWheelInfo*) wheelId; btWheelInfo* wheel = (btWheelInfo*) wheelId;
if (wheel == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return 0;
}
return wheel->m_skidInfo; return wheel->m_skidInfo;
} }
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_finalizeNative JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_finalizeNative
(JNIEnv *env, jobject object, jlong wheelId){ (JNIEnv *env, jobject object, jlong wheelId) {
btWheelInfo* wheel = (btWheelInfo*) wheelId; btWheelInfo* wheel = (btWheelInfo*) wheelId;
if (wheel == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
delete(wheel); delete(wheel);
} }
#ifdef __cplusplus #ifdef __cplusplus

@ -61,6 +61,11 @@ extern "C" {
JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_applyTransform JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_applyTransform
(JNIEnv *env, jobject object, jlong stateId, jobject location, jobject rotation) { (JNIEnv *env, jobject object, jlong stateId, jobject location, jobject rotation) {
jmeMotionState* motionState = (jmeMotionState*) stateId; jmeMotionState* motionState = (jmeMotionState*) stateId;
if (motionState == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return false;
}
return motionState->applyTransform(env, location, rotation); return motionState->applyTransform(env, location, rotation);
} }
@ -72,6 +77,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldLocation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldLocation
(JNIEnv *env, jobject object, jlong stateId, jobject value) { (JNIEnv *env, jobject object, jlong stateId, jobject value) {
jmeMotionState* motionState = (jmeMotionState*) stateId; jmeMotionState* motionState = (jmeMotionState*) stateId;
if (motionState == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &motionState->worldTransform.getOrigin(), value); jmeBulletUtil::convert(env, &motionState->worldTransform.getOrigin(), value);
} }
@ -83,6 +93,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotation JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotation
(JNIEnv *env, jobject object, jlong stateId, jobject value) { (JNIEnv *env, jobject object, jlong stateId, jobject value) {
jmeMotionState* motionState = (jmeMotionState*) stateId; jmeMotionState* motionState = (jmeMotionState*) stateId;
if (motionState == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convert(env, &motionState->worldTransform.getBasis(), value); jmeBulletUtil::convert(env, &motionState->worldTransform.getBasis(), value);
} }
@ -94,6 +109,11 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotationQuat JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotationQuat
(JNIEnv *env, jobject object, jlong stateId, jobject value) { (JNIEnv *env, jobject object, jlong stateId, jobject value) {
jmeMotionState* motionState = (jmeMotionState*) stateId; jmeMotionState* motionState = (jmeMotionState*) stateId;
if (motionState == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
jmeBulletUtil::convertQuat(env, &motionState->worldTransform.getBasis(), value); jmeBulletUtil::convertQuat(env, &motionState->worldTransform.getBasis(), value);
} }
@ -103,8 +123,13 @@ extern "C" {
* Signature: (J)V * Signature: (J)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_finalizeNative JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_finalizeNative
(JNIEnv *env, jobject object, jlong stateId){ (JNIEnv *env, jobject object, jlong stateId) {
jmeMotionState* motionState = (jmeMotionState*) stateId; jmeMotionState* motionState = (jmeMotionState*) stateId;
if (motionState == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
delete(motionState); delete(motionState);
} }

Loading…
Cancel
Save