Răsfoiți Sursa

delete the glue code for native Bullet

Stephen Gold 4 ani în urmă
părinte
comite
b5f53f3541
42 a modificat fișierele cu 0 adăugiri și 8681 ștergeri
  1. 0 551
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_PhysicsSpace.cpp
  2. 0 342
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionEvent.cpp
  3. 0 202
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionObject.cpp
  4. 0 59
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_BoxCollisionShape.cpp
  5. 0 68
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.cpp
  6. 0 129
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CollisionShape.cpp
  7. 0 107
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CompoundCollisionShape.cpp
  8. 0 68
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_ConeCollisionShape.cpp
  9. 0 70
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CylinderCollisionShape.cpp
  10. 0 83
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_GImpactCollisionShape.cpp
  11. 0 59
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.cpp
  12. 0 71
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HullCollisionShape.cpp
  13. 0 107
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_MeshCollisionShape.cpp
  14. 0 60
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_PlaneCollisionShape.cpp
  15. 0 110
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SimplexCollisionShape.cpp
  16. 0 57
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SphereCollisionShape.cpp
  17. 0 100
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_ConeJoint.cpp
  18. 0 226
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_HingeJoint.cpp
  19. 0 77
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_PhysicsJoint.cpp
  20. 0 159
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp
  21. 0 194
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofJoint.cpp
  22. 0 125
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofSpringJoint.cpp
  23. 0 963
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SliderJoint.cpp
  24. 0 365
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_RotationalLimitMotor.cpp
  25. 0 274
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp
  26. 0 627
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsCharacter.cpp
  27. 0 320
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsGhostObject.cpp
  28. 0 918
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp
  29. 0 272
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsVehicle.cpp
  30. 0 163
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_VehicleWheel.cpp
  31. 0 138
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_infos_RigidBodyMotionState.cpp
  32. 0 152
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_DebugShapeFactory.cpp
  33. 0 59
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_NativeMeshUtil.cpp
  34. 0 48
      jme3-bullet-native/src/native/cpp/fake_win32/jni_md.h
  35. 0 417
      jme3-bullet-native/src/native/cpp/jmeBulletUtil.cpp
  36. 0 64
      jme3-bullet-native/src/native/cpp/jmeBulletUtil.h
  37. 0 331
      jme3-bullet-native/src/native/cpp/jmeClasses.cpp
  38. 0 112
      jme3-bullet-native/src/native/cpp/jmeClasses.h
  39. 0 89
      jme3-bullet-native/src/native/cpp/jmeMotionState.cpp
  40. 0 57
      jme3-bullet-native/src/native/cpp/jmeMotionState.h
  41. 0 222
      jme3-bullet-native/src/native/cpp/jmePhysicsSpace.cpp
  42. 0 66
      jme3-bullet-native/src/native/cpp/jmePhysicsSpace.h

+ 0 - 551
jme3-bullet-native/src/native/cpp/com_jme3_bullet_PhysicsSpace.cpp

@@ -1,551 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "com_jme3_bullet_PhysicsSpace.h"
-#include "jmePhysicsSpace.h"
-#include "jmeBulletUtil.h"
-
-/**
- * Author: Normen Hansen
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    createPhysicsSpace
-     * Signature: (FFFFFFI)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_PhysicsSpace_createPhysicsSpace
-    (JNIEnv * env, jobject object, jfloat minX, jfloat minY, jfloat minZ,
-            jfloat maxX, jfloat maxY, jfloat maxZ, jint broadphase,
-            jboolean threading) {
-        jmeClasses::initJavaClasses(env);
-
-        jmePhysicsSpace* space = new jmePhysicsSpace(env, object);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space has not been created.");
-            return 0;
-        }
-
-        space->createPhysicsSpace(minX, minY, minZ, maxX, maxY, maxZ,
-                broadphase, threading);
-        return reinterpret_cast<jlong> (space);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    stepSimulation
-     * Signature: (JFIF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_stepSimulation
-    (JNIEnv * env, jobject object, jlong spaceId, jfloat tpf, jint maxSteps,
-            jfloat accuracy) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        space->stepSimulation(tpf, maxSteps, accuracy);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    addCollisionObject
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCollisionObject
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The collision object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
-        userPointer -> space = space;
-
-        space->getDynamicsWorld()->addCollisionObject(collisionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    removeCollisionObject
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCollisionObject
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The collision object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->removeCollisionObject(collisionObject);
-        jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
-        userPointer -> space = NULL;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    addRigidBody
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addRigidBody
-    (JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btRigidBody* collisionObject = reinterpret_cast<btRigidBody*> (rigidBodyId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The collision object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
-        userPointer -> space = space;
-        space->getDynamicsWorld()->addRigidBody(collisionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    removeRigidBody
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeRigidBody
-    (JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btRigidBody* collisionObject = reinterpret_cast<btRigidBody*> (rigidBodyId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The collision object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
-        userPointer -> space = NULL;
-        space->getDynamicsWorld()->removeRigidBody(collisionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    addCharacterObject
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCharacterObject
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The collision object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
-        userPointer -> space = space;
-        space->getDynamicsWorld()->addCollisionObject(collisionObject,
-                btBroadphaseProxy::CharacterFilter,
-                btBroadphaseProxy::StaticFilter | btBroadphaseProxy::DefaultFilter
-                );
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    removeCharacterObject
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCharacterObject
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The collision object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
-        userPointer -> space = NULL;
-        space->getDynamicsWorld()->removeCollisionObject(collisionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    addAction
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addAction
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (actionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The action object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->addAction(actionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    removeAction
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeAction
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (actionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The action object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->removeAction(actionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    addVehicle
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addVehicle
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (actionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The vehicle object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->addVehicle(actionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    removeVehicle
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeVehicle
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (actionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The action object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->removeVehicle(actionObject);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    addConstraint
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraint
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (constraint == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The constraint object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->addConstraint(constraint);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    addConstraint
-     * Signature: (JJZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraintC
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId, jboolean collision) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (constraint == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The constraint object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->addConstraint(constraint, collision);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    removeConstraint
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeConstraint
-    (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*> (objectId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        if (constraint == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The constraint object does not exist.");
-            return;
-        }
-        space->getDynamicsWorld()->removeConstraint(constraint);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    setGravity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setGravity
-    (JNIEnv * env, jobject object, jlong spaceId, jobject vector) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-        btVector3 gravity = btVector3();
-        jmeBulletUtil::convert(env, vector, &gravity);
-
-        space->getDynamicsWorld()->setGravity(gravity);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    initNativePhysics
-     * Signature: ()V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_initNativePhysics
-    (JNIEnv * env, jclass clazz) {
-        jmeClasses::initJavaClasses(env);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_PhysicsSpace
-     * Method:    finalizeNative
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_finalizeNative
-    (JNIEnv * env, jobject object, jlong spaceId) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        if (space == NULL) {
-            return;
-        }
-        delete(space);
-    }
-
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_rayTest_1native
-    (JNIEnv * env, jobject object, jobject from, jobject to, jlong spaceId, jobject resultlist, jint flags) {
-
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-
-        struct AllRayResultCallback : public btCollisionWorld::RayResultCallback {
-
-            AllRayResultCallback(const btVector3& rayFromWorld, const btVector3 & rayToWorld) : m_rayFromWorld(rayFromWorld), m_rayToWorld(rayToWorld) {
-            }
-            jobject resultlist;
-            JNIEnv* env;
-            btVector3 m_rayFromWorld; //used to calculate hitPointWorld from hitFraction
-            btVector3 m_rayToWorld;
-
-            btVector3 m_hitNormalWorld;
-            btVector3 m_hitPointWorld;
-
-            virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) {
-                if (normalInWorldSpace) {
-                    m_hitNormalWorld = rayResult.m_hitNormalLocal;
-                } else {
-                    m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis() * rayResult.m_hitNormalLocal;
-                }
-                m_hitPointWorld.setInterpolate3(m_rayFromWorld, m_rayToWorld, rayResult.m_hitFraction);
-
-                jmeBulletUtil::addResult(env, resultlist, &m_hitNormalWorld, &m_hitPointWorld, rayResult.m_hitFraction, rayResult.m_collisionObject);
-
-                return 1.f;
-            }
-        };
-
-        btVector3 native_to = btVector3();
-        jmeBulletUtil::convert(env, to, &native_to);
-
-        btVector3 native_from = btVector3();
-        jmeBulletUtil::convert(env, from, &native_from);
-
-        AllRayResultCallback resultCallback(native_from, native_to);
-        resultCallback.env = env;
-        resultCallback.resultlist = resultlist;
-        resultCallback.m_flags = flags;
-        space->getDynamicsWorld()->rayTest(native_from, native_to, resultCallback);
-
-        return;
-    }
-
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_sweepTest_1native
-    (JNIEnv * env, jobject object, jlong shapeId, jobject from, jobject to, jlong spaceId, jobject resultlist, jfloat allowedCcdPenetration) {
-
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-
-        btCollisionShape* shape = reinterpret_cast<btCollisionShape*> (shapeId);
-        if (shape == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The shape does not exist.");
-            return;
-        }
-
-        struct AllConvexResultCallback : public btCollisionWorld::ConvexResultCallback {
-
-            AllConvexResultCallback(const btTransform& convexFromWorld, const btTransform & convexToWorld) : m_convexFromWorld(convexFromWorld), m_convexToWorld(convexToWorld) {
-            }
-            jobject resultlist;
-            JNIEnv* env;
-            btTransform m_convexFromWorld; //used to calculate hitPointWorld from hitFraction
-            btTransform m_convexToWorld;
-
-            btVector3 m_hitNormalWorld;
-            btVector3 m_hitPointWorld;
-
-            virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult, bool normalInWorldSpace) {
-                if (normalInWorldSpace) {
-                    m_hitNormalWorld = convexResult.m_hitNormalLocal;
-                } else {
-                    m_hitNormalWorld = convexResult.m_hitCollisionObject->getWorldTransform().getBasis() * convexResult.m_hitNormalLocal;
-                }
-                m_hitPointWorld.setInterpolate3(m_convexFromWorld.getBasis() * m_convexFromWorld.getOrigin(), m_convexToWorld.getBasis() * m_convexToWorld.getOrigin(), convexResult.m_hitFraction);
-
-                jmeBulletUtil::addSweepResult(env, resultlist, &m_hitNormalWorld, &m_hitPointWorld, convexResult.m_hitFraction, convexResult.m_hitCollisionObject);
-
-                return 1.f;
-            }
-        };
-
-        btTransform native_to = btTransform();
-        jmeBulletUtil::convert(env, to, &native_to);
-
-        btTransform native_from = btTransform();
-        jmeBulletUtil::convert(env, from, &native_from);
-
-        btScalar native_allowed_ccd_penetration = btScalar(allowedCcdPenetration);
-
-        AllConvexResultCallback resultCallback(native_from, native_to);
-        resultCallback.env = env;
-        resultCallback.resultlist = resultlist;
-        space->getDynamicsWorld()->convexSweepTest((btConvexShape *) shape, native_from, native_to, resultCallback, native_allowed_ccd_penetration);
-        return;
-    }
-
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setSolverNumIterations
-    (JNIEnv *env, jobject object, jlong spaceId, jint value) {
-        jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The physics space does not exist.");
-            return;
-        }
-
-        space->getDynamicsWorld()->getSolverInfo().m_numIterations = value;
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 342
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionEvent.cpp

@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "jmeBulletUtil.h"
-#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
-#include "com_jme3_bullet_collision_PhysicsCollisionEvent.h"
-
-// Change to trigger build
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getAppliedImpulse
- * Signature: (J)F
- */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulse
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_appliedImpulse;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getAppliedImpulseLateral1
- * Signature: (J)F
- */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral1
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_appliedImpulseLateral1;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getAppliedImpulseLateral2
- * Signature: (J)F
- */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getAppliedImpulseLateral2
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_appliedImpulseLateral2;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getCombinedFriction
- * Signature: (J)F
- */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedFriction
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_combinedFriction;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getCombinedRestitution
- * Signature: (J)F
- */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getCombinedRestitution
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_combinedRestitution;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getDistance1
- * Signature: (J)F
- */
-JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getDistance1
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_distance1;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getIndex0
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex0
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_index0;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getIndex1
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getIndex1
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_index1;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getLateralFrictionDir1
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir1
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject lateralFrictionDir1) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return;
-    }
-    jmeBulletUtil::convert(env, &mp -> m_lateralFrictionDir1, lateralFrictionDir1);
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getLateralFrictionDir2
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLateralFrictionDir2
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject lateralFrictionDir2) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return;
-    }
-    jmeBulletUtil::convert(env, &mp -> m_lateralFrictionDir2, lateralFrictionDir2);
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    isLateralFrictionInitialized
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_isLateralFrictionInitialized
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return (mp -> m_contactPointFlags) &  BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getLifeTime
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLifeTime
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_lifeTime;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getLocalPointA
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointA
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject localPointA) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return;
-    }
-    jmeBulletUtil::convert(env, &mp -> m_localPointA, localPointA);
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getLocalPointB
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getLocalPointB
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject localPointB) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return;
-    }
-    jmeBulletUtil::convert(env, &mp -> m_localPointB, localPointB);
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getNormalWorldOnB
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getNormalWorldOnB
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject normalWorldOnB) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return;
-    }
-    jmeBulletUtil::convert(env, &mp -> m_normalWorldOnB, normalWorldOnB);
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getPartId0
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId0
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_partId0;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getPartId1
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPartId1
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return 0;
-    }
-    return mp -> m_partId1;
-}
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getPositionWorldOnA
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnA
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject positionWorldOnA) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return;
-    }
-    jmeBulletUtil::convert(env, &mp -> m_positionWorldOnA, positionWorldOnA);
-}
-
-
-/*
- * Class:     com_jme3_bullet_collision_PhysicsCollisionEvent
- * Method:    getPositionWorldOnB
- * Signature: (JLcom/jme3/math/Vector3f;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getPositionWorldOnB
-  (JNIEnv * env, jobject object, jlong manifoldPointObjectId, jobject positionWorldOnB) {
-    btManifoldPoint* mp = reinterpret_cast<btManifoldPoint*>(manifoldPointObjectId);
-    if (mp == NULL) {
-        jclass newExc = env->FindClass("java/lang/NullPointerException");
-        env->ThrowNew(newExc, "The manifoldPoint does not exist.");
-        return;
-    }
-    jmeBulletUtil::convert(env, &mp -> m_positionWorldOnB, positionWorldOnB);
-}

+ 0 - 202
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionObject.cpp

@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2009-2018 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_PhysicsCollisionObject.h"
-#include "jmeBulletUtil.h"
-#include "jmePhysicsSpace.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    attachCollisionShape
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_attachCollisionShape
-    (JNIEnv * env, jobject object, jlong objectId, jlong shapeId) {
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/IllegalStateException");
-            env->ThrowNew(newExc, "The collision object does not exist.");
-            return;
-        }
-        btCollisionShape* collisionShape = reinterpret_cast<btCollisionShape*>(shapeId);
-        if (collisionShape == NULL) {
-            jclass newExc = env->FindClass("java/lang/IllegalStateException");
-            env->ThrowNew(newExc, "The collision shape does not exist.");
-            return;
-        }
-        collisionObject->setCollisionShape(collisionShape);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    finalizeNative
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_finalizeNative
-    (JNIEnv * env, jobject object, jlong objectId) {
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        if (collisionObject -> getUserPointer() != NULL){
-            jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
-            delete(userPointer);
-        }
-        delete(collisionObject);
-    }
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    initUserPointer
-     * Signature: (JII)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_initUserPointer
-      (JNIEnv *env, jobject object, jlong objectId, jint group, jint groups) {
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
-        if (userPointer != NULL) {
-//            delete(userPointer);
-        }
-        userPointer = new jmeUserPointer();
-        userPointer -> javaCollisionObject = env->NewWeakGlobalRef(object);
-        userPointer -> group = group;
-        userPointer -> groups = groups;
-        userPointer -> space = NULL;
-        collisionObject -> setUserPointer(userPointer);
-    }
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    setCollisionGroup
-     * Signature: (JI)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_setCollisionGroup
-      (JNIEnv *env, jobject object, jlong objectId, jint group) {
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
-        if (userPointer != NULL){
-            userPointer -> group = group;
-        }
-    }
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    setCollideWithGroups
-     * Signature: (JI)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_setCollideWithGroups
-      (JNIEnv *env, jobject object, jlong objectId, jint groups) {
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer();
-        if (userPointer != NULL){
-            userPointer -> groups = groups;
-        }
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    getCollisionFlags
-     * Signature: (J)I
-     */
-    JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_getCollisionFlags
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return 0;
-        }
-
-        jint result = collisionObject->getCollisionFlags();
-        return result;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    setCollisionFlags
-     * Signature: (JI)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_setCollisionFlags
-    (JNIEnv *env, jobject object, jlong objectId, jint desiredFlags) {
-        btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
-        if (collisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-
-        collisionObject->setCollisionFlags(desiredFlags);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_PhysicsCollisionObject
-     * Method:    getDeactivationTime
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_getDeactivationTime
-    (JNIEnv *env, jobject object, jlong pcoId) {
-        btCollisionObject *pCollisionObject
-                = reinterpret_cast<btCollisionObject *> (pcoId);
-        if (pCollisionObject == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return 0;
-        }
-
-        jfloat result = pCollisionObject->getDeactivationTime();
-        return result;
-    }    
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 59
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_BoxCollisionShape.cpp

@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_BoxCollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_BoxCollisionShape
-     * Method:    createShape
-     * Signature: (Lcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_BoxCollisionShape_createShape
-    (JNIEnv *env, jobject object, jobject halfExtents) {
-        jmeClasses::initJavaClasses(env);
-        btVector3 extents =  btVector3();
-        jmeBulletUtil::convert(env, halfExtents, &extents);
-        btBoxShape* shape = new btBoxShape(extents);
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 68
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CapsuleCollisionShape.cpp

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_CapsuleCollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CapsuleCollisionShape
-     * Method:    createShape
-     * Signature: (IFF)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CapsuleCollisionShape_createShape
-    (JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
-        jmeClasses::initJavaClasses(env);
-        btCollisionShape* shape;
-        switch(axis){
-            case 0:
-                shape = new btCapsuleShapeX(radius, height);
-                break;
-            case 1:
-                shape = new btCapsuleShape(radius, height);
-                break;
-            case 2:
-                shape = new btCapsuleShapeZ(radius, height);
-                break;
-        }
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 129
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CollisionShape.cpp

@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_CollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
-     * Method:    getMargin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_getMargin
-    (JNIEnv * env, jobject object, jlong shapeId) {
-        btCollisionShape* shape = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
-     * Method:    setLocalScaling
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setLocalScaling
-    (JNIEnv * env, jobject object, jlong shapeId, jobject scale) {
-        btCollisionShape* shape = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, scale, &scl);
-        shape->setLocalScaling(scl);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
-     * Method:    setMargin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_setMargin
-    (JNIEnv * env, jobject object, jlong shapeId, jfloat newMargin) {
-        btCollisionShape* shape = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
-     * Method:    finalizeNative
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_finalizeNative
-    (JNIEnv * env, jobject object, jlong shapeId) {
-        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
-        if (shape == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        delete(shape);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CollisionShape
-     * Method:    isNonMoving
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_collision_shapes_CollisionShape_isNonMoving
-    (JNIEnv *env, jobject object, jlong shapeId) {
-        btCollisionShape *pShape
-                = reinterpret_cast<btCollisionShape *> (shapeId);
-        if (pShape == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return false;
-        }
-
-        return pShape->isNonMoving();
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 107
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CompoundCollisionShape.cpp

@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_CompoundCollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-     * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
-     * Method:    createShape
-     * Signature: ()J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_createShape
-    (JNIEnv *env, jobject object) {
-        jmeClasses::initJavaClasses(env);
-        btCompoundShape* shape = new btCompoundShape();
-        return reinterpret_cast<jlong>(shape);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
-     * Method:    addChildShape
-     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_addChildShape
-    (JNIEnv *env, jobject object, jlong compoundId, jlong childId, jobject childLocation, jobject childRotation) {
-        btCompoundShape* shape = reinterpret_cast<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 = reinterpret_cast<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();
-        btTransform trans = btTransform(mtx);
-        jmeBulletUtil::convert(env, childLocation, &trans.getOrigin());
-        jmeBulletUtil::convert(env, childRotation, &trans.getBasis());
-        shape->addChildShape(trans, child);
-        return 0;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CompoundCollisionShape
-     * Method:    removeChildShape
-     * Signature: (JJ)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CompoundCollisionShape_removeChildShape
-    (JNIEnv * env, jobject object, jlong compoundId, jlong childId) {
-        btCompoundShape* shape = reinterpret_cast<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 = reinterpret_cast<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);
-        return 0;
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 68
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_ConeCollisionShape.cpp

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_ConeCollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_ConeCollisionShape
-     * Method:    createShape
-     * Signature: (IFF)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_ConeCollisionShape_createShape
-    (JNIEnv * env, jobject object, jint axis, jfloat radius, jfloat height) {
-        jmeClasses::initJavaClasses(env);
-        btCollisionShape* shape;
-        switch (axis) {
-            case 0:
-                shape = new btConeShapeX(radius, height);
-                break;
-            case 1:
-                shape = new btConeShape(radius, height);
-                break;
-            case 2:
-                shape = new btConeShapeZ(radius, height);
-                break;
-        }
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 70
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_CylinderCollisionShape.cpp

@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_CylinderCollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_CylinderCollisionShape
-     * Method:    createShape
-     * Signature: (ILcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_CylinderCollisionShape_createShape
-    (JNIEnv * env, jobject object, jint axis, jobject halfExtents) {
-        jmeClasses::initJavaClasses(env);
-        btVector3 extents = btVector3();
-        jmeBulletUtil::convert(env, halfExtents, &extents);
-        btCollisionShape* shape;
-        switch (axis) {
-            case 0:
-                shape = new btCylinderShapeX(extents);
-                break;
-            case 1:
-                shape = new btCylinderShape(extents);
-                break;
-            case 2:
-                shape = new btCylinderShapeZ(extents);
-                break;
-        }
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 83
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_GImpactCollisionShape.cpp

@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_GImpactCollisionShape.h"
-#include "jmeBulletUtil.h"
-#include <BulletCollision/Gimpact/btGImpactShape.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_GImpactCollisionShape
-     * Method:    createShape
-     * Signature: (J)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_createShape
-    (JNIEnv * env, jobject object, jlong meshId) {
-        jmeClasses::initJavaClasses(env);
-        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*>(meshId);
-        btGImpactMeshShape* shape = new btGImpactMeshShape(array);
-        shape->updateBound();
-        return reinterpret_cast<jlong>(shape);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_GImpactCollisionShape
-     * Method:    recalcAabb
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_recalcAabb
-    (JNIEnv *env, jobject object, jlong shapeId) {
-        btGImpactMeshShape *pShape
-                = reinterpret_cast<btGImpactMeshShape *> (shapeId);
-        pShape->updateBound();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_GImpactCollisionShape
-     * Method:    finalizeNative
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_GImpactCollisionShape_finalizeNative
-    (JNIEnv * env, jobject object, jlong meshId) {
-        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*> (meshId);
-        delete(array);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 59
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.cpp

@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_HeightfieldCollisionShape.h"
-#include "jmeBulletUtil.h"
-#include "BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_HeightfieldCollisionShape
-     * Method:    createShape
-     * Signature: (II[FFFFIZ)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HeightfieldCollisionShape_createShape
-    (JNIEnv * env, jobject object, jint heightStickWidth, jint heightStickLength, jobject heightfieldData, jfloat heightScale, jfloat minHeight, jfloat maxHeight, jint upAxis, jboolean flipQuadEdges) {
-        jmeClasses::initJavaClasses(env);
-        void* data = env->GetDirectBufferAddress(heightfieldData);
-        btHeightfieldTerrainShape* shape=new btHeightfieldTerrainShape(heightStickWidth, heightStickLength, data, heightScale, minHeight, maxHeight, upAxis, PHY_FLOAT, flipQuadEdges);
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 71
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_HullCollisionShape.cpp

@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2009-2019 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_HullCollisionShape.h"
-#include "jmeBulletUtil.h"
-#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_HullCollisionShape
-     * Method:    createShape
-     * Signature: ([F)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_HullCollisionShape_createShape
-    (JNIEnv *env, jobject object, jobject array) {
-        jmeClasses::initJavaClasses(env);
-        float* data = (float*) env->GetDirectBufferAddress(array);
-        //TODO: capacity will not always be length!
-        int length = env->GetDirectBufferCapacity(array)/4;
-        btConvexHullShape* shape = new btConvexHullShape();
-        for (int i = 0; i < length; i+=3) {
-            btVector3 vect = btVector3(data[i],
-                    data[i + 1],
-                    data[i + 2]);
-            
-            shape->addPoint(vect);
-        }
-        
-        shape->optimizeConvexHull();
-
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 107
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_MeshCollisionShape.cpp

@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
-* Author: Normen Hansen
-*/
-#include "com_jme3_bullet_collision_shapes_MeshCollisionShape.h"
-#include "jmeBulletUtil.h"
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
-#include "btBulletDynamicsCommon.h"
-#include "BulletCollision/Gimpact/btGImpactShape.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
-     * Method:    createShape
-     * Signature: (J)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_createShape
-    (JNIEnv* env, jobject object,jboolean isMemoryEfficient,jboolean buildBVH, jlong arrayId) {
-        jmeClasses::initJavaClasses(env);
-        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*>(arrayId);
-        btBvhTriangleMeshShape* shape = new btBvhTriangleMeshShape(array, isMemoryEfficient, buildBVH);
-        return reinterpret_cast<jlong>(shape);
-    }
-
-    JNIEXPORT jbyteArray JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_saveBVH(JNIEnv* env, jobject, jlong meshobj){
-        btBvhTriangleMeshShape* mesh = reinterpret_cast<btBvhTriangleMeshShape*>(meshobj);
-         btOptimizedBvh* bvh = mesh->getOptimizedBvh();
-       unsigned int ssize = bvh->calculateSerializeBufferSize();
-       char* buffer = (char*)btAlignedAlloc(ssize, 16);
-       bool success = bvh->serialize(buffer, ssize, true);
-    if(!success){
-      jclass newExc = env->FindClass("java/lang/RuntimeException");
-      env->ThrowNew(newExc, "Unableto Serialize, native error reported");
-    }
-
-         jbyteArray byteArray = env->NewByteArray(ssize);
-         env->SetByteArrayRegion(byteArray, 0, ssize , (jbyte*) buffer);
-   btAlignedFree(buffer);
-         return byteArray;
-    };
-
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_setBVH(JNIEnv* env, jobject,jbyteArray bytearray,jlong meshobj){
-        int len = env->GetArrayLength (bytearray);
-        void* buffer = btAlignedAlloc(len, 16);
-        env->GetByteArrayRegion (bytearray, 0, len, reinterpret_cast<jbyte*>(buffer));
-
-  btOptimizedBvh* bhv = btOptimizedBvh::deSerializeInPlace(buffer, len, true);
-  btBvhTriangleMeshShape* mesh = reinterpret_cast<btBvhTriangleMeshShape*>(meshobj);
-  mesh->setOptimizedBvh(bhv);
-  return reinterpret_cast<jlong>(buffer);
-    };
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_MeshCollisionShape
-     * Method:    finalizeNative
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_finalizeNative
-    (JNIEnv* env, jobject object, jlong arrayId,jlong nativeBVHBuffer){
-        btTriangleIndexVertexArray* array = reinterpret_cast<btTriangleIndexVertexArray*>(arrayId);
-        delete(array);
-  if (nativeBVHBuffer > 0) {
-    void* buffer = reinterpret_cast<void*>(nativeBVHBuffer);
-    btAlignedFree(buffer);
-  }
-    }
-
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 60
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_PlaneCollisionShape.cpp

@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_PlaneCollisionShape.h"
-#include "jmeBulletUtil.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_PlaneCollisionShape
-     * Method:    createShape
-     * Signature: (Lcom/jme3/math/Vector3f;F)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_PlaneCollisionShape_createShape
-    (JNIEnv * env, jobject object, jobject normal, jfloat constant) {
-        jmeClasses::initJavaClasses(env);
-        btVector3 norm = btVector3();
-        jmeBulletUtil::convert(env, normal, &norm);
-        btStaticPlaneShape* shape = new btStaticPlaneShape(norm, constant);
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 110
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SimplexCollisionShape.cpp

@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_SimplexCollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
-     * Method:    createShape
-     * Signature: (Lcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2
-    (JNIEnv *env, jobject object, jobject vector1) {
-        jmeClasses::initJavaClasses(env);
-        btVector3 vec1 = btVector3();
-        jmeBulletUtil::convert(env, vector1, &vec1);
-        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1);
-        return reinterpret_cast<jlong>(simplexShape);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
-     * Method:    createShape
-     * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
-    (JNIEnv *env, jobject object, jobject vector1, jobject vector2) {
-        jmeClasses::initJavaClasses(env);
-        btVector3 vec1 = btVector3();
-        jmeBulletUtil::convert(env, vector1, &vec1);
-        btVector3 vec2 = btVector3();
-        jmeBulletUtil::convert(env, vector2, &vec2);
-        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2);
-        return reinterpret_cast<jlong>(simplexShape);
-    }
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
-     * Method:    createShape
-     * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
-    (JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3) {
-        jmeClasses::initJavaClasses(env);
-        btVector3 vec1 = btVector3();
-        jmeBulletUtil::convert(env, vector1, &vec1);
-        btVector3 vec2 = btVector3();
-        jmeBulletUtil::convert(env, vector2, &vec2);
-        btVector3 vec3 = btVector3();
-        jmeBulletUtil::convert(env, vector3, &vec3);
-        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3);
-        return reinterpret_cast<jlong>(simplexShape);
-    }
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_SimplexCollisionShape
-     * Method:    createShape
-     * Signature: (Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SimplexCollisionShape_createShape__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2
-    (JNIEnv * env, jobject object, jobject vector1, jobject vector2, jobject vector3, jobject vector4) {
-        jmeClasses::initJavaClasses(env);
-        btVector3 vec1 = btVector3();
-        jmeBulletUtil::convert(env, vector1, &vec1);
-        btVector3 vec2 = btVector3();
-        jmeBulletUtil::convert(env, vector2, &vec2);
-        btVector3 vec3 = btVector3();
-        jmeBulletUtil::convert(env, vector3, &vec3);
-        btVector3 vec4 = btVector3();
-        jmeBulletUtil::convert(env, vector4, &vec4);
-        btBU_Simplex1to4* simplexShape = new btBU_Simplex1to4(vec1, vec2, vec3, vec4);
-        return reinterpret_cast<jlong>(simplexShape);
-    }
-#ifdef __cplusplus
-}
-#endif

+ 0 - 57
jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_shapes_SphereCollisionShape.cpp

@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_collision_shapes_SphereCollisionShape.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_collision_shapes_SphereCollisionShape
-     * Method:    createShape
-     * Signature: (F)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_SphereCollisionShape_createShape
-    (JNIEnv *env, jobject object, jfloat radius) {
-        jmeClasses::initJavaClasses(env);
-        btSphereShape* shape=new btSphereShape(radius);
-        return reinterpret_cast<jlong>(shape);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 100
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_ConeJoint.cpp

@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_ConeJoint.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_ConeJoint
-     * Method:    setLimit
-     * Signature: (JFFF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setLimit
-    (JNIEnv * env, jobject object, jlong jointId, jfloat swingSpan1, jfloat swingSpan2, jfloat twistSpan) {
-        btConeTwistConstraint* joint = reinterpret_cast<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!
-        joint->setLimit(swingSpan1, swingSpan2, twistSpan);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_ConeJoint
-     * Method:    setAngularOnly
-     * Signature: (JZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_ConeJoint_setAngularOnly
-    (JNIEnv * env, jobject object, jlong jointId, jboolean angularOnly) {
-        btConeTwistConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_ConeJoint
-     * Method:    createJoint
-     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_ConeJoint_createJoint
-    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB) {
-        jmeClasses::initJavaClasses(env);
-        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
-        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
-        btMatrix3x3 mtx1 = btMatrix3x3();
-        btMatrix3x3 mtx2 = btMatrix3x3();
-        btTransform transA = btTransform(mtx1);
-        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
-        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
-        btTransform transB = btTransform(mtx2);
-        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
-        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
-        btConeTwistConstraint* joint = new btConeTwistConstraint(*bodyA, *bodyB, transA, transB);
-        return reinterpret_cast<jlong>(joint);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 226
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_HingeJoint.cpp

@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_HingeJoint.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    enableMotor
-     * Signature: (JZFF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_enableMotor
-    (JNIEnv * env, jobject object, jlong jointId, jboolean enable, jfloat targetVelocity, jfloat maxMotorImpulse) {
-        btHingeConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    getEnableAngularMotor
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_HingeJoint_getEnableAngularMotor
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btHingeConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    getMotorTargetVelocity
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMotorTargetVelocity
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btHingeConstraint* joint = reinterpret_cast<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->getMotorTargetVelocity();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    getMaxMotorImpulse
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getMaxMotorImpulse
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btHingeConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    setLimit
-     * Signature: (JFF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setLimit__JFF
-    (JNIEnv * env, jobject object, jlong jointId, jfloat low, jfloat high) {
-        btHingeConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    setLimit
-     * Signature: (JFFFFF)V
-     */
-    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) {
-        btHingeConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    getUpperLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getUpperLimit
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btHingeConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    getLowerLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getLowerLimit
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btHingeConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    setAngularOnly
-     * Signature: (JZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_HingeJoint_setAngularOnly
-    (JNIEnv * env, jobject object, jlong jointId, jboolean angular) {
-        btHingeConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    getHingeAngle
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_HingeJoint_getHingeAngle
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btHingeConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_HingeJoint
-     * Method:    createJoint
-     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_HingeJoint_createJoint
-    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject axisA, jobject pivotB, jobject axisB) {
-        jmeClasses::initJavaClasses(env);
-        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
-        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
-        btVector3 vec1 = btVector3();
-        btVector3 vec2 = btVector3();
-        btVector3 vec3 = btVector3();
-        btVector3 vec4 = btVector3();
-        jmeBulletUtil::convert(env, pivotA, &vec1);
-        jmeBulletUtil::convert(env, pivotB, &vec2);
-        jmeBulletUtil::convert(env, axisA, &vec3);
-        jmeBulletUtil::convert(env, axisB, &vec4);
-        btHingeConstraint* joint = new btHingeConstraint(*bodyA, *bodyB, vec1, vec2, vec3, vec4);
-        return reinterpret_cast<jlong>(joint);
-    }
-#ifdef __cplusplus
-}
-#endif

+ 0 - 77
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_PhysicsJoint.cpp

@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2009-2018 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_PhysicsJoint.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_PhysicsJoint
-     * Method:    getAppliedImpulse
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_getAppliedImpulse
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btTypedConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_PhysicsJoint
-     * Method:    finalizeNative
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_finalizeNative
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btTypedConstraint* joint = reinterpret_cast<btTypedConstraint*> (jointId);
-        if (joint == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        delete(joint);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 159
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_Point2PointJoint.cpp

@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_Point2PointJoint.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_Point2PointJoint
-     * Method:    setDamping
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setDamping
-    (JNIEnv * env, jobject object, jlong jointId, jfloat damping) {
-        btPoint2PointConstraint* joint = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_Point2PointJoint
-     * Method:    setImpulseClamp
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setImpulseClamp
-    (JNIEnv * env, jobject object, jlong jointId, jfloat clamp) {
-        btPoint2PointConstraint* joint = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_Point2PointJoint
-     * Method:    setTau
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_setTau
-    (JNIEnv * env, jobject object, jlong jointId, jfloat tau) {
-        btPoint2PointConstraint* joint = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_Point2PointJoint
-     * Method:    getDamping
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getDamping
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btPoint2PointConstraint* joint = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_Point2PointJoint
-     * Method:    getImpulseClamp
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getImpulseClamp
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btPoint2PointConstraint* joint = reinterpret_cast<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_impulseClamp;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_Point2PointJoint
-     * Method:    getTau
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_getTau
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btPoint2PointConstraint* joint = reinterpret_cast<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_tau;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_Point2PointJoint
-     * Method:    createJoint
-     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_Point2PointJoint_createJoint
-    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject pivotB) {
-        jmeClasses::initJavaClasses(env);
-        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
-        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
-        btVector3 pivotAIn;
-        btVector3 pivotBIn;
-        jmeBulletUtil::convert(env, pivotA, &pivotAIn);
-        jmeBulletUtil::convert(env, pivotB, &pivotBIn);
-        btPoint2PointConstraint * joint = new btPoint2PointConstraint(*bodyA, *bodyB, pivotAIn, pivotBIn);
-        return reinterpret_cast<jlong>(joint);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 194
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofJoint.cpp

@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_SixDofJoint.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    getRotationalLimitMotor
-     * Signature: (JI)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getRotationalLimitMotor
-    (JNIEnv * env, jobject object, jlong jointId, jint index) {
-        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
-        if (joint == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return 0;
-        }
-        return reinterpret_cast<jlong>(joint->getRotationalLimitMotor(index));
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    getTranslationalLimitMotor
-     * Signature: (J)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getTranslationalLimitMotor
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btGeneric6DofConstraint* joint = reinterpret_cast<btGeneric6DofConstraint*>(jointId);
-        if (joint == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return 0;
-        }
-        return reinterpret_cast<jlong>(joint->getTranslationalLimitMotor());
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    setLinearUpperLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearUpperLimit
-    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
-        btGeneric6DofConstraint* joint = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, vector, &vec);
-        joint->setLinearUpperLimit(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    setLinearLowerLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setLinearLowerLimit
-    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
-        btGeneric6DofConstraint* joint = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, vector, &vec);
-        joint->setLinearLowerLimit(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    setAngularUpperLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularUpperLimit
-    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
-        btGeneric6DofConstraint* joint = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, vector, &vec);
-        joint->setAngularUpperLimit(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    setAngularLowerLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_setAngularLowerLimit
-    (JNIEnv * env, jobject object, jlong jointId, jobject vector) {
-        btGeneric6DofConstraint* joint = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, vector, &vec);
-        joint->setAngularLowerLimit(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    createJoint
-     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofJoint_createJoint
-    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
-        jmeClasses::initJavaClasses(env);
-        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
-        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
-        btMatrix3x3 mtx1 = btMatrix3x3();
-        btMatrix3x3 mtx2 = btMatrix3x3();
-        btTransform transA = btTransform(mtx1);
-        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
-        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
-        btTransform transB = btTransform(mtx2);
-        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
-        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
-        btGeneric6DofConstraint* joint = new btGeneric6DofConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
-        return reinterpret_cast<jlong>(joint);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SixDofJoint
-     * Method:    getAngles
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofJoint_getAngles
-    (JNIEnv *env, jobject object, jlong jointId, jobject storeVector) {
-        btGeneric6DofConstraint *pJoint
-                = reinterpret_cast<btGeneric6DofConstraint *> (jointId);
-        if (pJoint == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-
-        pJoint->calculateTransforms();
-        btScalar x = pJoint->getAngle(0);
-        btScalar y = pJoint->getAngle(1);
-        btScalar z = pJoint->getAngle(2);
-        const btVector3& angles = btVector3(x, y, z);
-        jmeBulletUtil::convert(env, &angles, storeVector);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 125
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SixDofSpringJoint.cpp

@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_SixDofSpringJoint.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Class:     com_jme3_bullet_joints_SixDofSpringJoint
- * Method:    enableString
- * Signature: (JIZ)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_enableSpring
-  (JNIEnv *env, jobject object, jlong jointId, jint index, jboolean onOff) {
-    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
-    joint -> enableSpring(index, onOff);
-}
-
-
-/*
- * Class:     com_jme3_bullet_joints_SixDofSpringJoint
- * Method:    setStiffness
- * Signature: (JIF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setStiffness
-  (JNIEnv *env, jobject object, jlong jointId, jint index, jfloat stiffness) {
-    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
-    joint -> setStiffness(index, stiffness);
-}
-
-/*
- * Class:     com_jme3_bullet_joints_SixDofSpringJoint
- * Method:    setDamping
- * Signature: (JIF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setDamping
-  (JNIEnv *env, jobject object, jlong jointId, jint index, jfloat damping) {
-    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
-    joint -> setDamping(index, damping);
-}
-
-/*
- * Class:     com_jme3_bullet_joints_SixDofSpringJoint
- * Method:    setEquilibriumPoint
- * Signature: (JIF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setEquilibriumPoint__J
-  (JNIEnv *env, jobject object, jlong jointId) {
-    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
-    joint -> setEquilibriumPoint();
-}
-
-/*
- * Class:     com_jme3_bullet_joints_SixDofSpringJoint
- * Method:    setEquilibriumPoint
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_setEquilibriumPoint__JI
-  (JNIEnv *env, jobject object, jlong jointId, jint index) {
-    btGeneric6DofSpringConstraint* joint = reinterpret_cast<btGeneric6DofSpringConstraint*>(jointId);
-    joint -> setEquilibriumPoint(index);
-}
-
-
-
-
-/*
- * Class:     com_jme3_bullet_joints_SixDofSpringJoint
- * Method:    createJoint
- * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
- */
-JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SixDofSpringJoint_createJoint
-    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
-        jmeClasses::initJavaClasses(env);
-        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
-        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
-        btTransform transA;
-        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
-        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
-        btTransform transB;
-        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
-        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
-
-        btGeneric6DofSpringConstraint* joint = new btGeneric6DofSpringConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
-        return reinterpret_cast<jlong>(joint);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 963
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_SliderJoint.cpp

@@ -1,963 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_SliderJoint.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getLowerLinLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerLinLimit
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setLowerLinLimit
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerLinLimit
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getUpperLinLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperLinLimit
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setUpperLinLimit
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperLinLimit
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getLowerAngLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getLowerAngLimit
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setLowerAngLimit
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setLowerAngLimit
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getUpperAngLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getUpperAngLimit
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setUpperAngLimit
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setUpperAngLimit
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getSoftnessDirLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setSoftnessDirLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getRestitutionDirLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setRestitutionDirLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getDampingDirLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setDampingDirLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getSoftnessDirAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessDirAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setSoftnessDirAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessDirAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getRestitutionDirAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionDirAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setRestitutionDirAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionDirAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getDampingDirAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingDirAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setDampingDirAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingDirAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getSoftnessLimLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setSoftnessLimLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getRestitutionLimLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setRestitutionLimLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getDampingLimLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setDampingLimLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getSoftnessLimAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessLimAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setSoftnessLimAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessLimAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getRestitutionLimAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionLimAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setRestitutionLimAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionLimAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getDampingLimAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingLimAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setDampingLimAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingLimAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getSoftnessOrthoLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setSoftnessOrthoLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getRestitutionOrthoLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setRestitutionOrthoLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getDampingOrthoLin
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoLin
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setDampingOrthoLin
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoLin
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getSoftnessOrthoAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getSoftnessOrthoAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setSoftnessOrthoAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setSoftnessOrthoAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getRestitutionOrthoAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getRestitutionOrthoAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setRestitutionOrthoAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setRestitutionOrthoAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getDampingOrthoAng
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getDampingOrthoAng
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setDampingOrthoAng
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setDampingOrthoAng
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    isPoweredLinMotor
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredLinMotor
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setPoweredLinMotor
-     * Signature: (JZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredLinMotor
-    (JNIEnv * env, jobject object, jlong jointId, jboolean value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getTargetLinMotorVelocity
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetLinMotorVelocity
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setTargetLinMotorVelocity
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetLinMotorVelocity
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getMaxLinMotorForce
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxLinMotorForce
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setMaxLinMotorForce
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxLinMotorForce
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    isPoweredAngMotor
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_SliderJoint_isPoweredAngMotor
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setPoweredAngMotor
-     * Signature: (JZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setPoweredAngMotor
-    (JNIEnv * env, jobject object, jlong jointId, jboolean value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getTargetAngMotorVelocity
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getTargetAngMotorVelocity
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setTargetAngMotorVelocity
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setTargetAngMotorVelocity
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    getMaxAngMotorForce
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_SliderJoint_getMaxAngMotorForce
-    (JNIEnv * env, jobject object, jlong jointId) {
-        btSliderConstraint* joint = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    setMaxAngMotorForce
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_SliderJoint_setMaxAngMotorForce
-    (JNIEnv * env, jobject object, jlong jointId, jfloat value) {
-        btSliderConstraint* joint = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_SliderJoint
-     * Method:    createJoint
-     * Signature: (JJLcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Matrix3f;Z)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_joints_SliderJoint_createJoint
-    (JNIEnv * env, jobject object, jlong bodyIdA, jlong bodyIdB, jobject pivotA, jobject rotA, jobject pivotB, jobject rotB, jboolean useLinearReferenceFrameA) {
-        jmeClasses::initJavaClasses(env);
-        btRigidBody* bodyA = reinterpret_cast<btRigidBody*>(bodyIdA);
-        btRigidBody* bodyB = reinterpret_cast<btRigidBody*>(bodyIdB);
-        btMatrix3x3 mtx1 = btMatrix3x3();
-        btMatrix3x3 mtx2 = btMatrix3x3();
-        btTransform transA = btTransform(mtx1);
-        jmeBulletUtil::convert(env, pivotA, &transA.getOrigin());
-        jmeBulletUtil::convert(env, rotA, &transA.getBasis());
-        btTransform transB = btTransform(mtx2);
-        jmeBulletUtil::convert(env, pivotB, &transB.getOrigin());
-        jmeBulletUtil::convert(env, rotB, &transB.getBasis());
-        btSliderConstraint* joint = new btSliderConstraint(*bodyA, *bodyB, transA, transB, useLinearReferenceFrameA);
-        return reinterpret_cast<jlong>(joint);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 365
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_RotationalLimitMotor.cpp

@@ -1,365 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_motors_RotationalLimitMotor.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getLoLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLoLimit
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setLoLimit
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLoLimit
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getHiLimit
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getHiLimit
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setHiLimit
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setHiLimit
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getTargetVelocity
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getTargetVelocity
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setTargetVelocity
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setTargetVelocity
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getMaxMotorForce
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxMotorForce
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setMaxMotorForce
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxMotorForce
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getMaxLimitForce
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getMaxLimitForce
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setMaxLimitForce
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setMaxLimitForce
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getDamping
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getDamping
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setDamping
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setDamping
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getLimitSoftness
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getLimitSoftness
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setLimitSoftness
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setLimitSoftness
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getERP
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getERP
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setERP
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setERP
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    getBounce
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_getBounce
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setBounce
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setBounce
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    isEnableMotor
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_isEnableMotor
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_RotationalLimitMotor
-     * Method:    setEnableMotor
-     * Signature: (JZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_RotationalLimitMotor_setEnableMotor
-    (JNIEnv *env, jobject object, jlong motorId, jboolean value) {
-        btRotationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 274
jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_motors_TranslationalLimitMotor.cpp

@@ -1,274 +0,0 @@
-/*
- * Copyright (c) 2009-2019 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_joints_motors_TranslationalLimitMotor.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    getLowerLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLowerLimit
-    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    setLowerLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLowerLimit
-    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    getUpperLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getUpperLimit
-    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    setUpperLimit
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setUpperLimit
-    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    getAccumulatedImpulse
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getAccumulatedImpulse
-    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    setAccumulatedImpulse
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setAccumulatedImpulse
-    (JNIEnv *env, jobject object, jlong motorId, jobject vector) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    getLimitSoftness
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getLimitSoftness
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    setLimitSoftness
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setLimitSoftness
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    getDamping
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getDamping
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    setDamping
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setDamping
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    getRestitution
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_getRestitution
-    (JNIEnv *env, jobject object, jlong motorId) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    setRestitution
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setRestitution
-    (JNIEnv *env, jobject object, jlong motorId, jfloat value) {
-        btTranslationalLimitMotor* motor = reinterpret_cast<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;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    setEnabled
-     * Signature: (JIZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_setEnabled
-    (JNIEnv *env, jobject object, jlong motorId, jint axisIndex, jboolean newSetting) {
-        btTranslationalLimitMotor *pMotor
-                = reinterpret_cast<btTranslationalLimitMotor *> (motorId);
-        if (pMotor == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-
-        pMotor->m_enableMotor[axisIndex] = (bool)newSetting;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_joints_motors_TranslationalLimitMotor
-     * Method:    isEnabled
-     * Signature: (JI)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_joints_motors_TranslationalLimitMotor_isEnabled
-    (JNIEnv *env, jobject object, jlong motorId, jint axisIndex) {
-        btTranslationalLimitMotor *pMotor
-                = reinterpret_cast<btTranslationalLimitMotor *> (motorId);
-        if (pMotor == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return 0;
-        }
-
-        bool result = pMotor->m_enableMotor[axisIndex];
-        return (jboolean) result;
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 627
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsCharacter.cpp

@@ -1,627 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-
-#include "com_jme3_bullet_objects_PhysicsCharacter.h"
-#include "jmeBulletUtil.h"
-#include "BulletCollision/CollisionDispatch/btGhostObject.h"
-#include "BulletDynamics/Character/btKinematicCharacterController.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    createGhostObject
-     * Signature: ()J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createGhostObject
-    (JNIEnv * env, jobject object) {
-        jmeClasses::initJavaClasses(env);
-        btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
-        return reinterpret_cast<jlong>(ghost);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setCharacterFlags
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCharacterFlags
-    (JNIEnv *env, jobject object, jlong ghostId) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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_NO_CONTACT_RESPONSE);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    createCharacterObject
-     * Signature: (JJF)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_createCharacterObject
-    (JNIEnv *env, jobject object, jlong objectId, jlong shapeId, jfloat stepHeight) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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!
-        btConvexShape* shape = reinterpret_cast<btConvexShape*>(shapeId);
-        btKinematicCharacterController* character = new btKinematicCharacterController(ghost, shape, stepHeight);
-        return reinterpret_cast<jlong>(character);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    warp
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_warp
-    (JNIEnv *env, jobject object, jlong objectId, jobject vector) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, vector, &vec);
-        character->warp(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setWalkDirection
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setWalkDirection
-    (JNIEnv *env, jobject object, jlong objectId, jobject vector) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, vector, &vec);
-        character->setWalkDirection(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setUp
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setUp
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env,  value, &vec);
-        character->setUp(vec);
-    }
-
-     /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setAngularVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setAngularVelocity
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        character->setAngularVelocity(vec);
-    }
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getAngularVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-     
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getAngularVelocity
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        btVector3 a_vel = character->getAngularVelocity();
-        jmeBulletUtil::convert(env, &a_vel, value);
-    }
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setLinearVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setLinearVelocity
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        character->setLinearVelocity(vec);
-    }
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getLinearVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-     
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getLinearVelocity
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        btVector3 l_vel = character->getLinearVelocity();
-        jmeBulletUtil::convert(env, &l_vel, value);
-    }
-
-
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setFallSpeed
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setFallSpeed
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btKinematicCharacterController* character = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setJumpSpeed
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setJumpSpeed
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btKinematicCharacterController* character = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setGravity
-     * Signature:  (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setGravity
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        character->setGravity(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getGravity
-     * Signature:  (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getGravity
-    (JNIEnv *env, jobject object, jlong objectId,jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        btVector3 g = character->getGravity();
-        jmeBulletUtil::convert(env, &g, value);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setLinearDamping
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setLinearDamping
-    (JNIEnv *env, jobject object, jlong objectId,jfloat value) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return ;
-        }
-        character->setLinearDamping(value);
-    }
-
-
-   /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getLinearDamping
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getLinearDamping
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btKinematicCharacterController* character = reinterpret_cast<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->getLinearDamping();
-    }
-
-
-      /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setAngularDamping
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setAngularDamping
-    (JNIEnv *env, jobject object, jlong objectId,jfloat value) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        character->setAngularDamping(value);
-    }
-
-
-   /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getAngularDamping
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getAngularDamping
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btKinematicCharacterController* character = reinterpret_cast<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->getAngularDamping();
-    }
-
-
-        /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setStepHeight
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setStepHeight
-    (JNIEnv *env, jobject object, jlong objectId,jfloat value) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        character->setStepHeight(value);
-    }
-
-
-   /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getStepHeight
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getStepHeight
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btKinematicCharacterController* character = reinterpret_cast<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->getStepHeight();
-    }
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setMaxSlope
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxSlope
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btKinematicCharacterController* character = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getMaxSlope
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxSlope
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-    }
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setMaxPenetrationDepth
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setMaxPenetrationDepth
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        character->setMaxPenetrationDepth(value);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getMaxPenetrationDepth
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getMaxPenetrationDepth
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btKinematicCharacterController* character = reinterpret_cast<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->getMaxPenetrationDepth();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    onGround
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_onGround
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    jump
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_jump
-    (JNIEnv *env, jobject object, jlong objectId,jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        character->jump(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    applyImpulse
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_applyImpulse
-    (JNIEnv *env, jobject object, jlong objectId,jobject value) {
-        btKinematicCharacterController* character = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        character->applyImpulse(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getPhysicsLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getPhysicsLocation
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setCcdSweptSphereRadius
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdSweptSphereRadius
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
-        if (ghost == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        ghost->setCcdSweptSphereRadius(value);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    setCcdMotionThreshold
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_setCcdMotionThreshold
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(objectId);
-        if (ghost == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        ghost->setCcdMotionThreshold(value);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getCcdSweptSphereRadius
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSweptSphereRadius
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getCcdMotionThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdMotionThreshold
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    getCcdSquareMotionThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_getCcdSquareMotionThreshold
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btGhostObject* ghost = reinterpret_cast<btGhostObject*>(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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsCharacter
-     * Method:    finalizeNativeCharacter
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsCharacter_finalizeNativeCharacter
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btKinematicCharacterController* character = reinterpret_cast<btKinematicCharacterController*>(objectId);
-        if (character == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        delete(character);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 320
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsGhostObject.cpp

@@ -1,320 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-
-#include <BulletCollision/CollisionDispatch/btGhostObject.h>
-
-#include "com_jme3_bullet_objects_PhysicsGhostObject.h"
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
-#include "jmeBulletUtil.h"
-#include "jmePhysicsSpace.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    createGhostObject
-     * Signature: ()J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_createGhostObject
-    (JNIEnv * env, jobject object) {
-        jmeClasses::initJavaClasses(env);
-        btPairCachingGhostObject* ghost = new btPairCachingGhostObject();
-        return reinterpret_cast<jlong>(ghost);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    setGhostFlags
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setGhostFlags
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    setPhysicsLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsLocation
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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());
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    setPhysicsRotation
-     * Signature: (JLcom/jme3/math/Matrix3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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());
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    setPhysicsRotation
-     * Signature: (JLcom/jme3/math/Quaternion;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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());
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getPhysicsLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsLocation
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getPhysicsRotation
-     * Signature: (JLcom/jme3/math/Quaternion;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotation
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getPhysicsRotationMatrix
-     * Signature: (JLcom/jme3/math/Matrix3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getPhysicsRotationMatrix
-    (JNIEnv *env, jobject object, jlong objectId, jobject value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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);
-    }
-
-    class jmeGhostOverlapCallback : public btOverlapCallback {
-        JNIEnv* m_env;
-        jobject m_object;
-        btCollisionObject *m_ghost;
-    public:
-        jmeGhostOverlapCallback(JNIEnv *env, jobject object, btCollisionObject *ghost)
-                :m_env(env),
-                 m_object(object),
-                 m_ghost(ghost)
-        {
-        }
-        virtual ~jmeGhostOverlapCallback() {}
-        virtual bool    processOverlap(btBroadphasePair& pair)
-        {
-            btCollisionObject *other;
-            if(pair.m_pProxy1->m_clientObject == m_ghost){
-                other = (btCollisionObject *)pair.m_pProxy0->m_clientObject;
-            }else{
-                other = (btCollisionObject *)pair.m_pProxy1->m_clientObject;
-            }
-            jmeUserPointer *up1 = (jmeUserPointer*)other -> getUserPointer();
-            jobject javaCollisionObject1 = m_env->NewLocalRef(up1->javaCollisionObject);
-            m_env->CallVoidMethod(m_object, jmeClasses::PhysicsGhostObject_addOverlappingObject, javaCollisionObject1);
-            m_env->DeleteLocalRef(javaCollisionObject1);
-            if (m_env->ExceptionCheck()) {
-                m_env->Throw(m_env->ExceptionOccurred());
-                return false;
-            }
-
-            return false;
-        }
-    };
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getOverlappingObjects
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingObjects
-      (JNIEnv *env, jobject object, jlong objectId) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<btPairCachingGhostObject*>(objectId);
-        if (ghost == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        btHashedOverlappingPairCache * pc = ghost->getOverlappingPairCache();
-        jmeGhostOverlapCallback cb(env, object, ghost);
-        pc -> processAllOverlappingPairs(&cb, NULL);
-    }
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getOverlappingCount
-     * Signature: (J)I
-     */
-    JNIEXPORT jint JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getOverlappingCount
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    setCcdSweptSphereRadius
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdSweptSphereRadius
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    setCcdMotionThreshold
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_setCcdMotionThreshold
-    (JNIEnv *env, jobject object, jlong objectId, jfloat value) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getCcdSweptSphereRadius
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSweptSphereRadius
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getCcdMotionThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdMotionThreshold
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsGhostObject
-     * Method:    getCcdSquareMotionThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsGhostObject_getCcdSquareMotionThreshold
-    (JNIEnv *env, jobject object, jlong objectId) {
-        btPairCachingGhostObject* ghost = reinterpret_cast<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();
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 918
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp

@@ -1,918 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_objects_PhysicsRigidBody.h"
-#include "jmeBulletUtil.h"
-#include "jmeMotionState.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    createRigidBody
-     * Signature: (FJJ)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_createRigidBody
-    (JNIEnv *env, jobject object, jfloat mass, jlong motionstatId, jlong shapeId) {
-        jmeClasses::initJavaClasses(env);
-        btMotionState* motionState = reinterpret_cast<btMotionState*>(motionstatId);
-        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
-        btVector3 localInertia = btVector3();
-        shape->calculateLocalInertia(mass, localInertia);
-        btRigidBody* body = new btRigidBody(mass, motionState, shape, localInertia);
-        body->setUserPointer(NULL);
-        return reinterpret_cast<jlong>(body);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    isInWorld
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isInWorld
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setPhysicsLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsLocation
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
-        if (body == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        //        if (body->isStaticOrKinematicObject() || !body->isInWorld())
-        ((jmeMotionState*) body->getMotionState())->setKinematicLocation(env, value);
-        body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
-        //        else{
-        //            btMatrix3x3* mtx = &btMatrix3x3();
-        //            btTransform* trans = &btTransform(*mtx);
-        //            trans->setBasis(body->getCenterOfMassTransform().getBasis());
-        //            jmeBulletUtil::convert(env, value, &trans->getOrigin());
-        //            body->setCenterOfMassTransform(*trans);
-        //        }
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setPhysicsRotation
-     * Signature: (JLcom/jme3/math/Matrix3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Matrix3f_2
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
-        if (body == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        //        if (body->isStaticOrKinematicObject() || !body->isInWorld())
-        ((jmeMotionState*) body->getMotionState())->setKinematicRotation(env, value);
-        body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
-        //        else{
-        //            btMatrix3x3* mtx = &btMatrix3x3();
-        //            btTransform* trans = &btTransform(*mtx);
-        //            trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
-        //            jmeBulletUtil::convert(env, value, &trans->getBasis());
-        //            body->setCenterOfMassTransform(*trans);
-        //        }
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setPhysicsRotation
-     * Signature: (JLcom/jme3/math/Quaternion;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setPhysicsRotation__JLcom_jme3_math_Quaternion_2
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
-        if (body == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        //        if (body->isStaticOrKinematicObject() || !body->isInWorld())
-        ((jmeMotionState*) body->getMotionState())->setKinematicRotationQuat(env, value);
-        body->setCenterOfMassTransform(((jmeMotionState*) body->getMotionState())->worldTransform);
-        //        else{
-        //            btMatrix3x3* mtx = &btMatrix3x3();
-        //            btTransform* trans = &btTransform(*mtx);
-        //            trans->setOrigin(body->getCenterOfMassTransform().getOrigin());
-        //            jmeBulletUtil::convertQuat(env, value, &trans->getBasis());
-        //            body->setCenterOfMassTransform(*trans);
-        //        }
-    }
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setInverseInertiaLocal
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setInverseInertiaLocal
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        body->setInvInertiaDiagLocal(vec);
-    }
-    
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getInverseInertiaLocal
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getInverseInertiaLocal
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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->getInvInertiaDiagLocal(), value);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getPhysicsLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsLocation
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getPhysicsRotation
-     * Signature: (JLcom/jme3/math/Quaternion;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotation
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getPhysicsRotationMatrix
-     * Signature: (JLcom/jme3/math/Matrix3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getPhysicsRotationMatrix
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setKinematic
-     * Signature: (JZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setKinematic
-    (JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
-        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
-        if (body == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        if (value) {
-            body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
-            body->setActivationState(DISABLE_DEACTIVATION);
-        } else {
-            body->setCollisionFlags(body->getCollisionFlags() & ~btCollisionObject::CF_KINEMATIC_OBJECT);
-	    body->activate(true);
-	    body->forceActivationState(ACTIVE_TAG);
-        }
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setCcdSweptSphereRadius
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdSweptSphereRadius
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setCcdMotionThreshold
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCcdMotionThreshold
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getCcdSweptSphereRadius
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSweptSphereRadius
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getCcdMotionThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdMotionThreshold
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getCcdSquareMotionThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getCcdSquareMotionThreshold
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setStatic
-     * Signature: (JZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setStatic
-    (JNIEnv *env, jobject object, jlong bodyId, jboolean value) {
-        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
-        if (body == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        if (value) {
-            body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_STATIC_OBJECT);
-        } else {
-            body->setCollisionFlags(body->getCollisionFlags() & ~btCollisionObject::CF_STATIC_OBJECT);
-        }
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    updateMassProps
-     * Signature: (JJF)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_updateMassProps
-    (JNIEnv *env, jobject object, jlong bodyId, jlong shapeId, jfloat mass) {
-        btRigidBody* body = reinterpret_cast<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 = reinterpret_cast<btCollisionShape*>(shapeId);
-        btVector3 localInertia = btVector3();
-        shape->calculateLocalInertia(mass, localInertia);
-        body->setMassProps(mass, localInertia);
-        return reinterpret_cast<jlong>(body);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getGravity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getGravity
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setGravity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setGravity
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        body->setGravity(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getFriction
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getFriction
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setFriction
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setFriction
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setDamping
-     * Signature: (JFF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setDamping
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value1, jfloat value2) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setAngularDamping
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularDamping
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getLinearDamping
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearDamping
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getAngularDamping
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularDamping
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getRestitution
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getRestitution
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setRestitution
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setRestitution
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getAngularVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularVelocity
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setAngularVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularVelocity
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        body->setAngularVelocity(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getLinearVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearVelocity
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setLinearVelocity
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearVelocity
-    (JNIEnv *env, jobject object, jlong bodyId, jobject value) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, value, &vec);
-        body->setLinearVelocity(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    applyForce
-     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyForce
-    (JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
-        btRigidBody* body = reinterpret_cast<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 vec2 = btVector3();
-        jmeBulletUtil::convert(env, force, &vec1);
-        jmeBulletUtil::convert(env, location, &vec2);
-        body->applyForce(vec1, vec2);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    applyCentralForce
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyCentralForce
-    (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, force, &vec1);
-        body->applyCentralForce(vec1);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    applyTorque
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorque
-    (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, force, &vec1);
-        body->applyTorque(vec1);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    applyImpulse
-     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyImpulse
-    (JNIEnv *env, jobject object, jlong bodyId, jobject force, jobject location) {
-        btRigidBody* body = reinterpret_cast<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 vec2 = btVector3();
-        jmeBulletUtil::convert(env, force, &vec1);
-        jmeBulletUtil::convert(env, location, &vec2);
-        body->applyImpulse(vec1, vec2);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    applyTorqueImpulse
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_applyTorqueImpulse
-    (JNIEnv *env, jobject object, jlong bodyId, jobject force) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, force, &vec1);
-        body->applyTorqueImpulse(vec1);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    clearForces
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_clearForces
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
-        if (body == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        body->clearForces();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setCollisionShape
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setCollisionShape
-    (JNIEnv *env, jobject object, jlong bodyId, jlong shapeId) {
-        btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
-        if (body == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
-        body->setCollisionShape(shape);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    activate
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_activate
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    isActive
-     * Signature: (J)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_isActive
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setSleepingThresholds
-     * Signature: (JFF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setSleepingThresholds
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat linear, jfloat angular) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setLinearSleepingThreshold
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearSleepingThreshold
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
-        btRigidBody* body = reinterpret_cast<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());
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setAngularSleepingThreshold
-     * Signature: (JF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularSleepingThreshold
-    (JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
-        btRigidBody* body = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getLinearSleepingThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearSleepingThreshold
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getAngularSleepingThreshold
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularSleepingThreshold
-    (JNIEnv *env, jobject object, jlong bodyId) {
-        btRigidBody* body = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getAngularFactor
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
-    (JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
-        btRigidBody* body = reinterpret_cast<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->getAngularFactor(), factor);
-    }
-
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setAngularFactor
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
-    (JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, factor, &vec);
-        body->setAngularFactor(vec);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    getLinearFactor
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearFactor
-    (JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
-        btRigidBody* body = reinterpret_cast<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->getLinearFactor(), factor);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsRigidBody
-     * Method:    setLinearFactor
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearFactor
-    (JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
-        btRigidBody* body = reinterpret_cast<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();
-        jmeBulletUtil::convert(env, factor, &vec);
-        body->setLinearFactor(vec);
-    }
-    
-#ifdef __cplusplus
-}
-#endif

+ 0 - 272
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsVehicle.cpp

@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-
-#include "com_jme3_bullet_objects_PhysicsVehicle.h"
-#include "jmeBulletUtil.h"
-#include "jmePhysicsSpace.h"
-#include "BulletDynamics/Vehicle/btRaycastVehicle.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    updateWheelTransform
-     * Signature: (JIZ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_updateWheelTransform
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jboolean interpolated) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    createVehicleRaycaster
-     * Signature: (JJ)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createVehicleRaycaster
-    (JNIEnv *env, jobject object, jlong bodyId, jlong spaceId) {
-        //btRigidBody* body = reinterpret_cast<btRigidBody*> bodyId;
-        jmeClasses::initJavaClasses(env);
-        jmePhysicsSpace *space = reinterpret_cast<jmePhysicsSpace*>(spaceId);
-        if (space == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return 0;
-        }
-        btDefaultVehicleRaycaster* caster = new btDefaultVehicleRaycaster(space->getDynamicsWorld());
-        return reinterpret_cast<jlong>(caster);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    createRaycastVehicle
-     * Signature: (JJ)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_createRaycastVehicle
-    (JNIEnv *env, jobject object, jlong objectId, jlong casterId) {
-        jmeClasses::initJavaClasses(env);
-        btRigidBody* body = reinterpret_cast<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);
-        btVehicleRaycaster* caster = reinterpret_cast<btDefaultVehicleRaycaster*>(casterId);
-        if (caster == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return 0;
-        }
-        btRaycastVehicle::btVehicleTuning tuning;
-        btRaycastVehicle* vehicle = new btRaycastVehicle(tuning, body, caster);
-        return reinterpret_cast<jlong>(vehicle);
-
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    setCoordinateSystem
-     * Signature: (JIII)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_setCoordinateSystem
-    (JNIEnv *env, jobject object, jlong vehicleId, jint right, jint up, jint forward) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    addWheel
-     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;FFLcom/jme3/bullet/objects/infos/VehicleTuning;Z)J
-     */
-    JNIEXPORT jint 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) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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 vec2 = btVector3();
-        btVector3 vec3 = btVector3();
-        jmeBulletUtil::convert(env, location, &vec1);
-        jmeBulletUtil::convert(env, direction, &vec2);
-        jmeBulletUtil::convert(env, axle, &vec3);
-        btRaycastVehicle::btVehicleTuning tune;
-        btWheelInfo* info = &vehicle->addWheel(vec1, vec2, vec3, restLength, radius, tune, frontWheel);
-        int idx = vehicle->getNumWheels();
-        return idx-1;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    resetSuspension
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_resetSuspension
-    (JNIEnv *env, jobject object, jlong vehicleId) {
-        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
-        if (vehicle == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        vehicle->resetSuspension();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    applyEngineForce
-     * Signature: (JIF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_applyEngineForce
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat force) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    steer
-     * Signature: (JIF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_steer
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    brake
-     * Signature: (JIF)F
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_brake
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheel, jfloat value) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    getCurrentVehicleSpeedKmHour
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getCurrentVehicleSpeedKmHour
-    (JNIEnv *env, jobject object, jlong vehicleId) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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();
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    getForwardVector
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_getForwardVector
-    (JNIEnv *env, jobject object, jlong vehicleId, jobject out) {
-        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
-        if (vehicle == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        btVector3 forwardVector = vehicle->getForwardVector();
-        jmeBulletUtil::convert(env, &forwardVector, out);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_PhysicsVehicle
-     * Method:    finalizeNative
-     * Signature: (JJ)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsVehicle_finalizeNative
-    (JNIEnv *env, jobject object, jlong casterId, jlong vehicleId) {
-        btVehicleRaycaster* rayCaster = reinterpret_cast<btVehicleRaycaster*>(casterId);
-        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
-        if (vehicle == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        delete(vehicle);
-        if (rayCaster == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        delete(rayCaster);
-    }
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 163
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_VehicleWheel.cpp

@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-
-#include "com_jme3_bullet_objects_VehicleWheel.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_objects_VehicleWheel
-     * Method:    getWheelLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelLocation
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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->getWheelInfo(wheelIndex).m_worldTransform.getOrigin(), out);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_VehicleWheel
-     * Method:    getWheelRotation
-     * Signature: (JLcom/jme3/math/Matrix3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getWheelRotation
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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->getWheelInfo(wheelIndex).m_worldTransform.getBasis(), out);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_VehicleWheel
-     * Method:    applyInfo
-     * Signature: (JFFFFFFFFZF)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_applyInfo
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jfloat suspensionStiffness, jfloat wheelsDampingRelaxation, jfloat wheelsDampingCompression, jfloat frictionSlip, jfloat rollInfluence, jfloat maxSuspensionTravelCm, jfloat maxSuspensionForce, jfloat radius, jboolean frontWheel, jfloat restLength) {
-        btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
-        vehicle->getWheelInfo(wheelIndex).m_suspensionStiffness = suspensionStiffness;
-        vehicle->getWheelInfo(wheelIndex).m_wheelsDampingRelaxation = wheelsDampingRelaxation;
-        vehicle->getWheelInfo(wheelIndex).m_wheelsDampingCompression = wheelsDampingCompression;
-        vehicle->getWheelInfo(wheelIndex).m_frictionSlip = frictionSlip;
-        vehicle->getWheelInfo(wheelIndex).m_rollInfluence = rollInfluence;
-        vehicle->getWheelInfo(wheelIndex).m_maxSuspensionTravelCm = maxSuspensionTravelCm;
-        vehicle->getWheelInfo(wheelIndex).m_maxSuspensionForce = maxSuspensionForce;
-        vehicle->getWheelInfo(wheelIndex).m_wheelsRadius = radius;
-        vehicle->getWheelInfo(wheelIndex).m_bIsFrontWheel = frontWheel;
-        vehicle->getWheelInfo(wheelIndex).m_suspensionRestLength1 = restLength;
-
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_VehicleWheel
-     * Method:    getCollisionLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionLocation
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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->getWheelInfo(wheelIndex).m_raycastInfo.m_contactPointWS, out);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_VehicleWheel
-     * Method:    getCollisionNormal
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getCollisionNormal
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex, jobject out) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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->getWheelInfo(wheelIndex).m_raycastInfo.m_contactNormalWS, out);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_VehicleWheel
-     * Method:    getSkidInfo
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getSkidInfo
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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->getWheelInfo(wheelIndex).m_skidInfo;
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_VehicleWheel
-     * Method:    getDeltaRotation
-     * Signature: (J)F
-     */
-    JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_VehicleWheel_getDeltaRotation
-    (JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex) {
-        btRaycastVehicle* vehicle = reinterpret_cast<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->getWheelInfo(wheelIndex).m_deltaRotation;
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 138
jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_infos_RigidBodyMotionState.cpp

@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_objects_infos_RigidBodyMotionState.h"
-#include "jmeBulletUtil.h"
-#include "jmeMotionState.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
-     * Method:    createMotionState
-     * Signature: ()J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_createMotionState
-    (JNIEnv *env, jobject object) {
-        jmeClasses::initJavaClasses(env);
-        jmeMotionState* motionState = new jmeMotionState();
-        return reinterpret_cast<jlong>(motionState);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
-     * Method:    applyTransform
-     * Signature: (JLcom/jme3/math/Vector3f;Lcom/jme3/math/Quaternion;)Z
-     */
-    JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_applyTransform
-    (JNIEnv *env, jobject object, jlong stateId, jobject location, jobject rotation) {
-        jmeMotionState* motionState = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
-     * Method:    getWorldLocation
-     * Signature: (JLcom/jme3/math/Vector3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldLocation
-    (JNIEnv *env, jobject object, jlong stateId, jobject value) {
-        jmeMotionState* motionState = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
-     * Method:    getWorldRotation
-     * Signature: (JLcom/jme3/math/Matrix3f;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotation
-    (JNIEnv *env, jobject object, jlong stateId, jobject value) {
-        jmeMotionState* motionState = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
-     * Method:    getWorldRotationQuat
-     * Signature: (JLcom/jme3/math/Quaternion;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_getWorldRotationQuat
-    (JNIEnv *env, jobject object, jlong stateId, jobject value) {
-        jmeMotionState* motionState = reinterpret_cast<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);
-    }
-
-    /*
-     * Class:     com_jme3_bullet_objects_infos_RigidBodyMotionState
-     * Method:    finalizeNative
-     * Signature: (J)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_infos_RigidBodyMotionState_finalizeNative
-    (JNIEnv *env, jobject object, jlong stateId) {
-        jmeMotionState* motionState = reinterpret_cast<jmeMotionState*>(stateId);
-        if (motionState == NULL) {
-            jclass newExc = env->FindClass("java/lang/NullPointerException");
-            env->ThrowNew(newExc, "The native object does not exist.");
-            return;
-        }
-        delete(motionState);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 152
jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_DebugShapeFactory.cpp

@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen, CJ Hare
- */
-#include "com_jme3_bullet_util_DebugShapeFactory.h"
-#include "jmeBulletUtil.h"
-#include "BulletCollision/CollisionShapes/btShapeHull.h"
-
-class DebugCallback : public btTriangleCallback, public btInternalTriangleIndexCallback {
-public:
-    JNIEnv* env;
-    jobject callback;
-
-    DebugCallback(JNIEnv* env, jobject object) {
-        this->env = env;
-        this->callback = object;
-    }
-
-    virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex) {
-        processTriangle(triangle, partId, triangleIndex);
-    }
-
-    virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) {
-        btVector3 vertexA, vertexB, vertexC;
-        vertexA = triangle[0];
-        vertexB = triangle[1];
-        vertexC = triangle[2];
-        env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexA.getX(), vertexA.getY(), vertexA.getZ(), partId, triangleIndex);
-        if (env->ExceptionCheck()) {
-            env->Throw(env->ExceptionOccurred());
-            return;
-        }
-//        triangle = 
-        env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexB.getX(), vertexB.getY(), vertexB.getZ(), partId, triangleIndex);
-        if (env->ExceptionCheck()) {
-            env->Throw(env->ExceptionOccurred());
-            return;
-        }
-        env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexC.getX(), vertexC.getY(), vertexC.getZ(), partId, triangleIndex);
-        if (env->ExceptionCheck()) {
-            env->Throw(env->ExceptionOccurred());
-            return;
-        }
-    }
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /* Inaccessible static: _00024assertionsDisabled */
-
-    /*
-     * Class:     com_jme3_bullet_util_DebugShapeFactory
-     * Method:    getVertices
-     * Signature: (JLcom/jme3/bullet/util/DebugMeshCallback;)V
-     */
-    JNIEXPORT void JNICALL Java_com_jme3_bullet_util_DebugShapeFactory_getVertices
-    (JNIEnv *env, jclass clazz, jlong shapeId, jobject callback) {
-        btCollisionShape* shape = reinterpret_cast<btCollisionShape*>(shapeId);
-        if (shape->isConcave()) {
-            btConcaveShape* concave = reinterpret_cast<btConcaveShape*>(shape);
-            DebugCallback* clb = new DebugCallback(env, callback);
-            btVector3 min = btVector3(-1e30, -1e30, -1e30);
-            btVector3 max = btVector3(1e30, 1e30, 1e30);
-            concave->processAllTriangles(clb, min, max);
-            delete(clb);
-        } else if (shape->isConvex()) {
-            btConvexShape* convexShape = reinterpret_cast<btConvexShape*>(shape);
-            // Check there is a hull shape to render
-            if (convexShape->getUserPointer() == NULL) {
-                // create a hull approximation
-                btShapeHull* hull = new btShapeHull(convexShape);
-                float margin = convexShape->getMargin();
-                hull->buildHull(margin);
-                convexShape->setUserPointer(hull);
-            }
-
-            btShapeHull* hull = (btShapeHull*) convexShape->getUserPointer();
-
-            int numberOfTriangles = hull->numTriangles();
-            int numberOfFloats = 3 * 3 * numberOfTriangles;
-            int byteBufferSize = numberOfFloats * 4;
-            
-            // Loop variables
-            const unsigned int* hullIndices = hull->getIndexPointer();
-            const btVector3* hullVertices = hull->getVertexPointer();
-            btVector3 vertexA, vertexB, vertexC;
-            int index = 0;
-
-            for (int i = 0; i < numberOfTriangles; i++) {
-                // Grab the data for this triangle from the hull
-                vertexA = hullVertices[hullIndices[index++]];
-                vertexB = hullVertices[hullIndices[index++]];
-                vertexC = hullVertices[hullIndices[index++]];
-
-                // Put the verticies into the vertex buffer
-                env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexA.getX(), vertexA.getY(), vertexA.getZ());
-                if (env->ExceptionCheck()) {
-                    env->Throw(env->ExceptionOccurred());
-                    return;
-                }
-                env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexB.getX(), vertexB.getY(), vertexB.getZ());
-                if (env->ExceptionCheck()) {
-                    env->Throw(env->ExceptionOccurred());
-                    return;
-                }
-                env->CallVoidMethod(callback, jmeClasses::DebugMeshCallback_addVector, vertexC.getX(), vertexC.getY(), vertexC.getZ());
-                if (env->ExceptionCheck()) {
-                    env->Throw(env->ExceptionOccurred());
-                    return;
-                }
-            }
-            delete hull;
-            convexShape->setUserPointer(NULL);
-        }
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 59
jme3-bullet-native/src/native/cpp/com_jme3_bullet_util_NativeMeshUtil.cpp

@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Author: Normen Hansen
- */
-#include "com_jme3_bullet_util_NativeMeshUtil.h"
-#include "jmeBulletUtil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    /*
-     * Class:     com_jme3_bullet_util_NativeMeshUtil
-     * Method:    createTriangleIndexVertexArray
-     * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIII)J
-     */
-    JNIEXPORT jlong JNICALL Java_com_jme3_bullet_util_NativeMeshUtil_createTriangleIndexVertexArray
-    (JNIEnv * env, jclass cls, jobject triangleIndexBase, jobject vertexIndexBase, jint numTriangles, jint numVertices, jint vertexStride, jint triangleIndexStride) {
-        jmeClasses::initJavaClasses(env);
-        int* triangles = (int*) env->GetDirectBufferAddress(triangleIndexBase);
-        float* vertices = (float*) env->GetDirectBufferAddress(vertexIndexBase);
-        btTriangleIndexVertexArray* array = new btTriangleIndexVertexArray(numTriangles, triangles, triangleIndexStride, numVertices, vertices, vertexStride);
-        return reinterpret_cast<jlong>(array);
-    }
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 48
jme3-bullet-native/src/native/cpp/fake_win32/jni_md.h

@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JNI_MD_H
-#define JNI_MD_H
-
-#ifndef __has_attribute
-#define __has_attribute(x) 0
-#endif
-
-#define JNIEXPORT __declspec(dllexport)
-#define JNIIMPORT __declspec(dllimport)
-#define JNICALL
-
-typedef int jint;
-typedef long long jlong;
-typedef signed char jbyte;
-
-#endif

+ 0 - 417
jme3-bullet-native/src/native/cpp/jmeBulletUtil.cpp

@@ -1,417 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include <math.h>
-#include "jmeBulletUtil.h"
-
-/**
- * Author: Normen Hansen,Empire Phoenix, Lutherion
- */
-void jmeBulletUtil::convert(JNIEnv* env, jobject in, btVector3* out) {
-    if (in == NULL || out == NULL) {
-        jmeClasses::throwNPE(env);
-    }
-    float x = env->GetFloatField(in, jmeClasses::Vector3f_x); //env->CallFloatMethod(in, jmeClasses::Vector3f_getX);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float y = env->GetFloatField(in, jmeClasses::Vector3f_y); //env->CallFloatMethod(in, jmeClasses::Vector3f_getY);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float z = env->GetFloatField(in, jmeClasses::Vector3f_z); //env->CallFloatMethod(in, jmeClasses::Vector3f_getZ);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    out->setX(x);
-    out->setY(y);
-    out->setZ(z);
-}
-
-void jmeBulletUtil::convert(JNIEnv* env, jobject in, btQuaternion* out) {
-	if (in == NULL || out == NULL) {
-		jmeClasses::throwNPE(env);
-	}
-	float x = env->GetFloatField(in, jmeClasses::Quaternion_x); 
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-	float y = env->GetFloatField(in, jmeClasses::Quaternion_y); //env->CallFloatMethod(in, jmeClasses::Vector3f_getY);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-	float z = env->GetFloatField(in, jmeClasses::Quaternion_z); //env->CallFloatMethod(in, jmeClasses::Vector3f_getZ);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-	float w = env->GetFloatField(in, jmeClasses::Quaternion_w); //env->CallFloatMethod(in, jmeClasses::Vector3f_getZ);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-	out->setX(x);
-	out->setY(y);
-	out->setZ(z);
-	out->setW(w);
-}
-
-
-void jmeBulletUtil::convert(JNIEnv* env, const btVector3* in, jobject out) {
-    if (in == NULL || out == NULL) {
-        jmeClasses::throwNPE(env);
-    }
-    float x = in->getX();
-    float y = in->getY();
-    float z = in->getZ();
-    env->SetFloatField(out, jmeClasses::Vector3f_x, x);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Vector3f_y, y);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Vector3f_z, z);
-    //    env->CallObjectMethod(out, jmeClasses::Vector3f_set, x, y, z);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-}
-
-void jmeBulletUtil::convert(JNIEnv* env, jobject in, btMatrix3x3* out) {
-    if (in == NULL || out == NULL) {
-        jmeClasses::throwNPE(env);
-    }
-    float m00 = env->GetFloatField(in, jmeClasses::Matrix3f_m00);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m01 = env->GetFloatField(in, jmeClasses::Matrix3f_m01);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m02 = env->GetFloatField(in, jmeClasses::Matrix3f_m02);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m10 = env->GetFloatField(in, jmeClasses::Matrix3f_m10);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m11 = env->GetFloatField(in, jmeClasses::Matrix3f_m11);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m12 = env->GetFloatField(in, jmeClasses::Matrix3f_m12);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m20 = env->GetFloatField(in, jmeClasses::Matrix3f_m20);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m21 = env->GetFloatField(in, jmeClasses::Matrix3f_m21);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float m22 = env->GetFloatField(in, jmeClasses::Matrix3f_m22);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    out->setValue(m00, m01, m02, m10, m11, m12, m20, m21, m22);
-}
-
-void jmeBulletUtil::convert(JNIEnv* env, const btMatrix3x3* in, jobject out) {
-    if (in == NULL || out == NULL) {
-        jmeClasses::throwNPE(env);
-    }
-    float m00 = in->getRow(0).m_floats[0];
-    float m01 = in->getRow(0).m_floats[1];
-    float m02 = in->getRow(0).m_floats[2];
-    float m10 = in->getRow(1).m_floats[0];
-    float m11 = in->getRow(1).m_floats[1];
-    float m12 = in->getRow(1).m_floats[2];
-    float m20 = in->getRow(2).m_floats[0];
-    float m21 = in->getRow(2).m_floats[1];
-    float m22 = in->getRow(2).m_floats[2];
-    env->SetFloatField(out, jmeClasses::Matrix3f_m00, m00);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m01, m01);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m02, m02);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m10, m10);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m11, m11);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m12, m12);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m20, m20);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m21, m21);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Matrix3f_m22, m22);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-}
-
-void jmeBulletUtil::convertQuat(JNIEnv* env, jobject in, btMatrix3x3* out) {
-    if (in == NULL || out == NULL) {
-        jmeClasses::throwNPE(env);
-    }
-    float x = env->GetFloatField(in, jmeClasses::Quaternion_x);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float y = env->GetFloatField(in, jmeClasses::Quaternion_y);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float z = env->GetFloatField(in, jmeClasses::Quaternion_z);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    float w = env->GetFloatField(in, jmeClasses::Quaternion_w);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    float norm = w * w + x * x + y * y + z * z;
-    float s = (norm == 1.0) ? 2.0 : (norm > 0.1) ? 2.0 / norm : 0.0;
-
-    // compute xs/ys/zs first to save 6 multiplications, since xs/ys/zs
-    // will be used 2-4 times each.
-    float xs = x * s;
-    float ys = y * s;
-    float zs = z * s;
-    float xx = x * xs;
-    float xy = x * ys;
-    float xz = x * zs;
-    float xw = w * xs;
-    float yy = y * ys;
-    float yz = y * zs;
-    float yw = w * ys;
-    float zz = z * zs;
-    float zw = w * zs;
-
-    // using s=2/norm (instead of 1/norm) saves 9 multiplications by 2 here
-    out->setValue(1.0 - (yy + zz), (xy - zw), (xz + yw),
-            (xy + zw), 1 - (xx + zz), (yz - xw),
-            (xz - yw), (yz + xw), 1.0 - (xx + yy));
-}
-
-void jmeBulletUtil::convertQuat(JNIEnv* env, const btMatrix3x3* in, jobject out) {
-    if (in == NULL || out == NULL) {
-        jmeClasses::throwNPE(env);
-    }
-    // the trace is the sum of the diagonal elements; see
-    // http://mathworld.wolfram.com/MatrixTrace.html
-    float t = in->getRow(0).m_floats[0] + in->getRow(1).m_floats[1] + in->getRow(2).m_floats[2];
-    float w, x, y, z;
-    // we protect the division by s by ensuring that s>=1
-    if (t >= 0) { // |w| >= .5
-        float s = sqrt(t + 1); // |s|>=1 ...
-        w = 0.5f * s;
-        s = 0.5f / s; // so this division isn't bad
-        x = (in->getRow(2).m_floats[1] - in->getRow(1).m_floats[2]) * s;
-        y = (in->getRow(0).m_floats[2] - in->getRow(2).m_floats[0]) * s;
-        z = (in->getRow(1).m_floats[0] - in->getRow(0).m_floats[1]) * s;
-    } else if ((in->getRow(0).m_floats[0] > in->getRow(1).m_floats[1]) && (in->getRow(0).m_floats[0] > in->getRow(2).m_floats[2])) {
-        float s = sqrt(1.0f + in->getRow(0).m_floats[0] - in->getRow(1).m_floats[1] - in->getRow(2).m_floats[2]); // |s|>=1
-        x = s * 0.5f; // |x| >= .5
-        s = 0.5f / s;
-        y = (in->getRow(1).m_floats[0] + in->getRow(0).m_floats[1]) * s;
-        z = (in->getRow(0).m_floats[2] + in->getRow(2).m_floats[0]) * s;
-        w = (in->getRow(2).m_floats[1] - in->getRow(1).m_floats[2]) * s;
-    } else if (in->getRow(1).m_floats[1] > in->getRow(2).m_floats[2]) {
-        float s = sqrt(1.0f + in->getRow(1).m_floats[1] - in->getRow(0).m_floats[0] - in->getRow(2).m_floats[2]); // |s|>=1
-        y = s * 0.5f; // |y| >= .5
-        s = 0.5f / s;
-        x = (in->getRow(1).m_floats[0] + in->getRow(0).m_floats[1]) * s;
-        z = (in->getRow(2).m_floats[1] + in->getRow(1).m_floats[2]) * s;
-        w = (in->getRow(0).m_floats[2] - in->getRow(2).m_floats[0]) * s;
-    } else {
-        float s = sqrt(1.0f + in->getRow(2).m_floats[2] - in->getRow(0).m_floats[0] - in->getRow(1).m_floats[1]); // |s|>=1
-        z = s * 0.5f; // |z| >= .5
-        s = 0.5f / s;
-        x = (in->getRow(0).m_floats[2] + in->getRow(2).m_floats[0]) * s;
-        y = (in->getRow(2).m_floats[1] + in->getRow(1).m_floats[2]) * s;
-        w = (in->getRow(1).m_floats[0] - in->getRow(0).m_floats[1]) * s;
-    }
-
-    env->SetFloatField(out, jmeClasses::Quaternion_x, x);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Quaternion_y, y);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Quaternion_z, z);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    env->SetFloatField(out, jmeClasses::Quaternion_w, w);
-    //    env->CallObjectMethod(out, jmeClasses::Quaternion_set, x, y, z, w);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-}
-
-void jmeBulletUtil::addResult(JNIEnv* env, jobject resultlist, btVector3* hitnormal, btVector3* m_hitPointWorld, btScalar m_hitFraction, const btCollisionObject* hitobject) {
-
-    jobject singleresult = env->AllocObject(jmeClasses::PhysicsRay_Class);
-    jobject hitnormalvec = env->AllocObject(jmeClasses::Vector3f);
-
-    convert(env, hitnormal, hitnormalvec);
-    jmeUserPointer *up1 = (jmeUserPointer*) hitobject -> getUserPointer();
-
-    env->SetObjectField(singleresult, jmeClasses::PhysicsRay_normalInWorldSpace, hitnormalvec);
-    env->SetFloatField(singleresult, jmeClasses::PhysicsRay_hitfraction, m_hitFraction);
-
-    env->SetObjectField(singleresult, jmeClasses::PhysicsRay_collisionObject, up1->javaCollisionObject);
-    env->CallBooleanMethod(resultlist, jmeClasses::PhysicsRay_addmethod, singleresult);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-}
-
-
-void jmeBulletUtil::addSweepResult(JNIEnv* env, jobject resultlist, btVector3* hitnormal, btVector3* m_hitPointWorld, btScalar m_hitFraction, const btCollisionObject* hitobject) {
-
-	jobject singleresult = env->AllocObject(jmeClasses::PhysicsSweep_Class);
-	jobject hitnormalvec = env->AllocObject(jmeClasses::Vector3f);
-
-	convert(env, hitnormal, hitnormalvec);
-	jmeUserPointer *up1 = (jmeUserPointer*)hitobject->getUserPointer();
-
-	env->SetObjectField(singleresult, jmeClasses::PhysicsSweep_normalInWorldSpace, hitnormalvec);
-	env->SetFloatField(singleresult, jmeClasses::PhysicsSweep_hitfraction, m_hitFraction);
-
-	env->SetObjectField(singleresult, jmeClasses::PhysicsSweep_collisionObject, up1->javaCollisionObject);
-	env->CallBooleanMethod(resultlist, jmeClasses::PhysicsSweep_addmethod, singleresult);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-}
-
-void jmeBulletUtil::convert(JNIEnv* env, jobject in, btTransform* out) {
-	if (in == NULL || out == NULL) {
-		jmeClasses::throwNPE(env);
-	}
-
-	jobject translation_vec = env->CallObjectMethod(in, jmeClasses::Transform_translation);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-	jobject rot_quat = env->CallObjectMethod(in, jmeClasses::Transform_rotation);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-	
-	/*
-	//Scale currently not supported by bullet
-	//@TBD: Create an assertion somewhere to avoid scale values
-	jobject scale_vec = env->GetObjectField(in, jmeClasses::Transform_scale);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-	*/
-	btVector3 native_translation_vec = btVector3();
-	//btVector3 native_scale_vec = btVector3();
-	btQuaternion native_rot_quat = btQuaternion();
-	
-	convert(env, translation_vec, &native_translation_vec);
-	//convert(env, scale_vec, native_scale_vec);
-	convert(env, rot_quat, &native_rot_quat);
-
-	out->setRotation(native_rot_quat);
-	out->setOrigin(native_translation_vec);
-}

+ 0 - 64
jme3-bullet-native/src/native/cpp/jmeBulletUtil.h

@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "jmeClasses.h"
-#include "btBulletDynamicsCommon.h"
-#include "btBulletCollisionCommon.h"
-#include "LinearMath/btVector3.h"
-
-/**
- * Author: Normen Hansen
- */
-class jmeBulletUtil{
-public:
-    static void convert(JNIEnv* env, jobject in, btVector3* out);
-    static void convert(JNIEnv* env, const btVector3* in, jobject out);
-    static void convert(JNIEnv* env, jobject in, btMatrix3x3* out);
-    static void convert(JNIEnv* env, jobject in, btQuaternion* out);
-    static void convert(JNIEnv* env, const btMatrix3x3* in, jobject out);
-    static void convertQuat(JNIEnv* env, jobject in, btMatrix3x3* out);
-    static void convertQuat(JNIEnv* env, const btMatrix3x3* in, jobject out);
-    static void convert(JNIEnv* env, jobject in, btTransform* out);
-    static void addResult(JNIEnv* env, jobject resultlist, btVector3* hitnormal, btVector3* m_hitPointWorld,const btScalar  m_hitFraction,const btCollisionObject* hitobject);
-    static void addSweepResult(JNIEnv* env, jobject resultlist, btVector3* hitnormal, btVector3* m_hitPointWorld, const btScalar  m_hitFraction, const btCollisionObject* hitobject);
-private:
-    jmeBulletUtil(){};
-    ~jmeBulletUtil(){};
-    
-};
-
-class jmeUserPointer {
-public:
-    jobject javaCollisionObject;
-    jint group;
-    jint groups;
-    void *space;
-};

+ 0 - 331
jme3-bullet-native/src/native/cpp/jmeClasses.cpp

@@ -1,331 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "jmeClasses.h"
-#include <stdio.h>
-
-/**
- * Author: Normen Hansen,Empire Phoenix, Lutherion
- */
-//public fields
-jclass jmeClasses::PhysicsSpace;
-jmethodID jmeClasses::PhysicsSpace_preTick;
-jmethodID jmeClasses::PhysicsSpace_postTick;
-jmethodID jmeClasses::PhysicsSpace_addCollisionEvent;
-jmethodID jmeClasses::PhysicsSpace_notifyCollisionGroupListeners;
-
-jclass jmeClasses::PhysicsGhostObject;
-jmethodID jmeClasses::PhysicsGhostObject_addOverlappingObject;
-
-jclass jmeClasses::Vector3f;
-jmethodID jmeClasses::Vector3f_set;
-jmethodID jmeClasses::Vector3f_toArray;
-jmethodID jmeClasses::Vector3f_getX;
-jmethodID jmeClasses::Vector3f_getY;
-jmethodID jmeClasses::Vector3f_getZ;
-jfieldID jmeClasses::Vector3f_x;
-jfieldID jmeClasses::Vector3f_y;
-jfieldID jmeClasses::Vector3f_z;
-
-jclass jmeClasses::Quaternion;
-jmethodID jmeClasses::Quaternion_set;
-jmethodID jmeClasses::Quaternion_getX;
-jmethodID jmeClasses::Quaternion_getY;
-jmethodID jmeClasses::Quaternion_getZ;
-jmethodID jmeClasses::Quaternion_getW;
-jfieldID jmeClasses::Quaternion_x;
-jfieldID jmeClasses::Quaternion_y;
-jfieldID jmeClasses::Quaternion_z;
-jfieldID jmeClasses::Quaternion_w;
-
-jclass jmeClasses::Matrix3f;
-jmethodID jmeClasses::Matrix3f_set;
-jmethodID jmeClasses::Matrix3f_get;
-jfieldID jmeClasses::Matrix3f_m00;
-jfieldID jmeClasses::Matrix3f_m01;
-jfieldID jmeClasses::Matrix3f_m02;
-jfieldID jmeClasses::Matrix3f_m10;
-jfieldID jmeClasses::Matrix3f_m11;
-jfieldID jmeClasses::Matrix3f_m12;
-jfieldID jmeClasses::Matrix3f_m20;
-jfieldID jmeClasses::Matrix3f_m21;
-jfieldID jmeClasses::Matrix3f_m22;
-
-jclass jmeClasses::DebugMeshCallback;
-jmethodID jmeClasses::DebugMeshCallback_addVector;
-
-jclass jmeClasses::PhysicsRay_Class;
-jmethodID jmeClasses::PhysicsRay_newSingleResult;
-
-jfieldID jmeClasses::PhysicsRay_normalInWorldSpace;
-jfieldID jmeClasses::PhysicsRay_hitfraction;
-jfieldID jmeClasses::PhysicsRay_collisionObject;
-
-jclass jmeClasses::PhysicsRay_listresult;
-jmethodID jmeClasses::PhysicsRay_addmethod;
-
-jclass jmeClasses::PhysicsSweep_Class;
-jmethodID jmeClasses::PhysicsSweep_newSingleResult;
-
-jfieldID jmeClasses::PhysicsSweep_normalInWorldSpace;
-jfieldID jmeClasses::PhysicsSweep_hitfraction;
-jfieldID jmeClasses::PhysicsSweep_collisionObject;
-
-jclass jmeClasses::PhysicsSweep_listresult;
-jmethodID jmeClasses::PhysicsSweep_addmethod;
-
-
-jclass jmeClasses::Transform;
-jmethodID jmeClasses::Transform_rotation;
-jmethodID jmeClasses::Transform_translation;
-
-//private fields
-//JNIEnv* jmeClasses::env;
-JavaVM* jmeClasses::vm;
-
-void jmeClasses::initJavaClasses(JNIEnv* env) {
-//    if (env != NULL) {
-//        fprintf(stdout, "Check Java VM state\n");
-//        fflush(stdout);
-//        int res = vm->AttachCurrentThread((void**) &jmeClasses::env, NULL);
-//        if (res < 0) {
-//            fprintf(stdout, "** ERROR: getting Java env!\n");
-//            if (res == JNI_EVERSION) fprintf(stdout, "GetEnv Error because of different JNI Version!\n");
-//            fflush(stdout);
-//        }
-//        return;
-//    }
-    if(PhysicsSpace!=NULL) return;
-    fprintf(stdout, "Bullet-Native: Initializing java classes\n");
-    fflush(stdout);
-//    jmeClasses::env = env;
-    env->GetJavaVM(&vm);
-
-    PhysicsSpace = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/PhysicsSpace"));
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    PhysicsSpace_preTick = env->GetMethodID(PhysicsSpace, "preTick_native", "(F)V");
-    PhysicsSpace_postTick = env->GetMethodID(PhysicsSpace, "postTick_native", "(F)V");
-    PhysicsSpace_addCollisionEvent = env->GetMethodID(PhysicsSpace, "addCollisionEvent_native","(Lcom/jme3/bullet/collision/PhysicsCollisionObject;Lcom/jme3/bullet/collision/PhysicsCollisionObject;J)V");
-    PhysicsSpace_notifyCollisionGroupListeners = env->GetMethodID(PhysicsSpace, "notifyCollisionGroupListeners_native","(Lcom/jme3/bullet/collision/PhysicsCollisionObject;Lcom/jme3/bullet/collision/PhysicsCollisionObject;)Z");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    PhysicsGhostObject = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/objects/PhysicsGhostObject"));
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    PhysicsGhostObject_addOverlappingObject = env->GetMethodID(PhysicsGhostObject, "addOverlappingObject_native","(Lcom/jme3/bullet/collision/PhysicsCollisionObject;)V");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    Vector3f = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/math/Vector3f"));
-    Vector3f_set = env->GetMethodID(Vector3f, "set", "(FFF)Lcom/jme3/math/Vector3f;");
-    Vector3f_toArray = env->GetMethodID(Vector3f, "toArray", "([F)[F");
-    Vector3f_getX = env->GetMethodID(Vector3f, "getX", "()F");
-    Vector3f_getY = env->GetMethodID(Vector3f, "getY", "()F");
-    Vector3f_getZ = env->GetMethodID(Vector3f, "getZ", "()F");
-    Vector3f_x = env->GetFieldID(Vector3f, "x", "F");
-    Vector3f_y = env->GetFieldID(Vector3f, "y", "F");
-    Vector3f_z = env->GetFieldID(Vector3f, "z", "F");
-
-    Quaternion = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/math/Quaternion"));
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    Quaternion_set = env->GetMethodID(Quaternion, "set", "(FFFF)Lcom/jme3/math/Quaternion;");
-    Quaternion_getW = env->GetMethodID(Quaternion, "getW", "()F");
-    Quaternion_getX = env->GetMethodID(Quaternion, "getX", "()F");
-    Quaternion_getY = env->GetMethodID(Quaternion, "getY", "()F");
-    Quaternion_getZ = env->GetMethodID(Quaternion, "getZ", "()F");
-    Quaternion_x = env->GetFieldID(Quaternion, "x", "F");
-    Quaternion_y = env->GetFieldID(Quaternion, "y", "F");
-    Quaternion_z = env->GetFieldID(Quaternion, "z", "F");
-    Quaternion_w = env->GetFieldID(Quaternion, "w", "F");
-
-    Matrix3f = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/math/Matrix3f"));
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    Matrix3f_set = env->GetMethodID(Matrix3f, "set", "(IIF)Lcom/jme3/math/Matrix3f;");
-    Matrix3f_get = env->GetMethodID(Matrix3f, "get", "(II)F");
-    Matrix3f_m00 = env->GetFieldID(Matrix3f, "m00", "F");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-    Matrix3f_m01 = env->GetFieldID(Matrix3f, "m01", "F");
-    Matrix3f_m02 = env->GetFieldID(Matrix3f, "m02", "F");
-    Matrix3f_m10 = env->GetFieldID(Matrix3f, "m10", "F");
-    Matrix3f_m11 = env->GetFieldID(Matrix3f, "m11", "F");
-    Matrix3f_m12 = env->GetFieldID(Matrix3f, "m12", "F");
-    Matrix3f_m20 = env->GetFieldID(Matrix3f, "m20", "F");
-    Matrix3f_m21 = env->GetFieldID(Matrix3f, "m21", "F");
-    Matrix3f_m22 = env->GetFieldID(Matrix3f, "m22", "F");
-
-    DebugMeshCallback = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/util/DebugMeshCallback"));
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    DebugMeshCallback_addVector = env->GetMethodID(DebugMeshCallback, "addVector", "(FFFII)V");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    PhysicsRay_Class = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/collision/PhysicsRayTestResult"));
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    PhysicsRay_newSingleResult = env->GetMethodID(PhysicsRay_Class,"<init>","()V");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    PhysicsRay_normalInWorldSpace = env->GetFieldID(PhysicsRay_Class,"hitNormalLocal","Lcom/jme3/math/Vector3f;");
-        if (env->ExceptionCheck()) {
-            env->Throw(env->ExceptionOccurred());
-            return;
-        }
-
-
-    PhysicsRay_hitfraction = env->GetFieldID(PhysicsRay_Class,"hitFraction","F");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-
-    PhysicsRay_collisionObject = env->GetFieldID(PhysicsRay_Class,"collisionObject","Lcom/jme3/bullet/collision/PhysicsCollisionObject;");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    PhysicsRay_listresult = env->FindClass("java/util/List");
-    PhysicsRay_listresult = (jclass)env->NewGlobalRef(PhysicsRay_listresult);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-    PhysicsRay_addmethod = env->GetMethodID(PhysicsRay_listresult,"add","(Ljava/lang/Object;)Z");
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-
-	PhysicsSweep_Class = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/bullet/collision/PhysicsSweepTestResult"));
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-}
-
-	PhysicsSweep_newSingleResult = env->GetMethodID(PhysicsSweep_Class, "<init>", "()V");
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-	PhysicsSweep_normalInWorldSpace = env->GetFieldID(PhysicsSweep_Class, "hitNormalLocal", "Lcom/jme3/math/Vector3f;");
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-
-	PhysicsSweep_hitfraction = env->GetFieldID(PhysicsSweep_Class, "hitFraction", "F");
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-
-	PhysicsSweep_collisionObject = env->GetFieldID(PhysicsSweep_Class, "collisionObject", "Lcom/jme3/bullet/collision/PhysicsCollisionObject;");
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-	PhysicsSweep_listresult = env->FindClass("java/util/List");
-	PhysicsSweep_listresult = (jclass)env->NewGlobalRef(PhysicsSweep_listresult);
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-	PhysicsSweep_addmethod = env->GetMethodID(PhysicsSweep_listresult, "add", "(Ljava/lang/Object;)Z");
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-	Transform = (jclass)env->NewGlobalRef(env->FindClass("com/jme3/math/Transform"));
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-	Transform_rotation = env->GetMethodID(Transform, "getRotation", "()Lcom/jme3/math/Quaternion;");
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-	
-	Transform_translation = env->GetMethodID(Transform, "getTranslation", "()Lcom/jme3/math/Vector3f;");
-	if (env->ExceptionCheck()) {
-		env->Throw(env->ExceptionOccurred());
-		return;
-	}
-
-}
-
-void jmeClasses::throwNPE(JNIEnv* env) {
-    if (env == NULL) return;
-    jclass newExc = env->FindClass("java/lang/NullPointerException");
-    env->ThrowNew(newExc, "");
-    return;
-}

+ 0 - 112
jme3-bullet-native/src/native/cpp/jmeClasses.h

@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include <jni.h>
-
-/**
- * Author: Normen Hansen
- */
-
-class jmeClasses {
-public:
-    static void initJavaClasses(JNIEnv* env);
-//    static JNIEnv* env;
-    static JavaVM* vm;
-    static jclass PhysicsSpace;
-    static jmethodID PhysicsSpace_preTick;
-    static jmethodID PhysicsSpace_postTick;
-    static jmethodID PhysicsSpace_addCollisionEvent;
-    static jclass PhysicsGhostObject;
-    static jmethodID PhysicsGhostObject_addOverlappingObject;
-    static jmethodID PhysicsSpace_notifyCollisionGroupListeners;
-
-    static jclass Vector3f;
-    static jmethodID Vector3f_set;
-    static jmethodID Vector3f_getX;
-    static jmethodID Vector3f_getY;
-    static jmethodID Vector3f_getZ;
-    static jmethodID Vector3f_toArray;
-    static jfieldID Vector3f_x;
-    static jfieldID Vector3f_y;
-    static jfieldID Vector3f_z;
-    
-    static jclass Quaternion;
-    static jmethodID Quaternion_set;
-    static jmethodID Quaternion_getX;
-    static jmethodID Quaternion_getY;
-    static jmethodID Quaternion_getZ;
-    static jmethodID Quaternion_getW;
-    static jfieldID Quaternion_x;
-    static jfieldID Quaternion_y;
-    static jfieldID Quaternion_z;
-    static jfieldID Quaternion_w;
-
-    static jclass Matrix3f;
-    static jmethodID Matrix3f_get;
-    static jmethodID Matrix3f_set;
-    static jfieldID Matrix3f_m00;
-    static jfieldID Matrix3f_m01;
-    static jfieldID Matrix3f_m02;
-    static jfieldID Matrix3f_m10;
-    static jfieldID Matrix3f_m11;
-    static jfieldID Matrix3f_m12;
-    static jfieldID Matrix3f_m20;
-    static jfieldID Matrix3f_m21;
-    static jfieldID Matrix3f_m22;
-
-    static jclass PhysicsRay_Class;
-    static jmethodID PhysicsRay_newSingleResult;
-    static jfieldID PhysicsRay_normalInWorldSpace;
-    static jfieldID PhysicsRay_hitfraction;
-    static jfieldID PhysicsRay_collisionObject;
-    static jclass PhysicsRay_listresult;
-    static jmethodID PhysicsRay_addmethod;
-
-	static jclass PhysicsSweep_Class;
-	static jmethodID PhysicsSweep_newSingleResult;
-	static jfieldID PhysicsSweep_normalInWorldSpace;
-	static jfieldID PhysicsSweep_hitfraction;
-	static jfieldID PhysicsSweep_collisionObject;
-	static jclass PhysicsSweep_listresult;
-	static jmethodID PhysicsSweep_addmethod;
-
-	static jclass Transform;
-	static jmethodID Transform_rotation;
-	static jmethodID Transform_translation;
-
-    static jclass DebugMeshCallback;
-    static jmethodID DebugMeshCallback_addVector;
-
-    static void throwNPE(JNIEnv* env);
-private:
-    jmeClasses(){};
-    ~jmeClasses(){};
-};

+ 0 - 89
jme3-bullet-native/src/native/cpp/jmeMotionState.cpp

@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "jmeMotionState.h"
-#include "jmeBulletUtil.h"
-
-/**
- * Author: Normen Hansen
- */
-
-jmeMotionState::jmeMotionState() {
-    trans = new btTransform();
-    trans -> setIdentity();
-    worldTransform = *trans;
-    dirty = true;
-}
-
-void jmeMotionState::getWorldTransform(btTransform& worldTrans) const {
-    worldTrans = worldTransform;
-}
-
-void jmeMotionState::setWorldTransform(const btTransform& worldTrans) {
-    worldTransform = worldTrans;
-    dirty = true;
-}
-
-void jmeMotionState::setKinematicTransform(const btTransform& worldTrans) {
-    worldTransform = worldTrans;
-    dirty = true;
-}
-
-void jmeMotionState::setKinematicLocation(JNIEnv* env, jobject location) {
-    jmeBulletUtil::convert(env, location, &worldTransform.getOrigin());
-    dirty = true;
-}
-
-void jmeMotionState::setKinematicRotation(JNIEnv* env, jobject rotation) {
-    jmeBulletUtil::convert(env, rotation, &worldTransform.getBasis());
-    dirty = true;
-}
-
-void jmeMotionState::setKinematicRotationQuat(JNIEnv* env, jobject rotation) {
-    jmeBulletUtil::convertQuat(env, rotation, &worldTransform.getBasis());
-    dirty = true;
-}
-
-bool jmeMotionState::applyTransform(JNIEnv* env, jobject location, jobject rotation) {
-    if (dirty) {
-        //        fprintf(stdout, "Apply world translation\n");
-        //        fflush(stdout);
-        jmeBulletUtil::convert(env, &worldTransform.getOrigin(), location);
-        jmeBulletUtil::convertQuat(env, &worldTransform.getBasis(), rotation);
-        dirty = false;
-        return true;
-    }
-    return false;
-}
-
-jmeMotionState::~jmeMotionState() {
-    free(trans);
-}

+ 0 - 57
jme3-bullet-native/src/native/cpp/jmeMotionState.h

@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include <jni.h>
-
-/**
- * Author: Normen Hansen
- */
-
-#include "btBulletDynamicsCommon.h"
-//#include "btBulletCollisionCommon.h"
-
-class jmeMotionState : public btMotionState {
-private:
-    bool dirty;
-    btTransform* trans;
-public:
-    jmeMotionState();
-    virtual ~jmeMotionState();
-
-    btTransform worldTransform;
-    virtual void getWorldTransform(btTransform& worldTrans) const;
-    virtual void setWorldTransform(const btTransform& worldTrans);
-    void setKinematicTransform(const btTransform& worldTrans);
-    void setKinematicLocation(JNIEnv*, jobject);
-    void setKinematicRotation(JNIEnv*, jobject);
-    void setKinematicRotationQuat(JNIEnv*, jobject);
-    bool applyTransform(JNIEnv* env, jobject location, jobject rotation);
-};

+ 0 - 222
jme3-bullet-native/src/native/cpp/jmePhysicsSpace.cpp

@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2009-2019 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "jmePhysicsSpace.h"
-#include "jmeBulletUtil.h"
-
-/**
- * Author: Normen Hansen
- */
-jmePhysicsSpace::jmePhysicsSpace(JNIEnv* env, jobject javaSpace) {
-    //TODO: global ref? maybe not -> cleaning, rather callback class?
-    this->javaPhysicsSpace = env->NewWeakGlobalRef(javaSpace);
-    this->env = env;
-    env->GetJavaVM(&vm);
-    if (env->ExceptionCheck()) {
-        env->Throw(env->ExceptionOccurred());
-        return;
-    }
-}
-
-void jmePhysicsSpace::attachThread() {
-#ifdef ANDROID
-    vm->AttachCurrentThread((JNIEnv**) &env, NULL);
-#elif defined (JNI_VERSION_1_2)
-    vm->AttachCurrentThread((void**) &env, NULL);
-#else
-    vm->AttachCurrentThread(&env, NULL);
-#endif
-}
-
-JNIEnv* jmePhysicsSpace::getEnv() {
-    attachThread();
-    return this->env;
-}
-
-void jmePhysicsSpace::stepSimulation(jfloat tpf, jint maxSteps, jfloat accuracy) {
-    dynamicsWorld->stepSimulation(tpf, maxSteps, accuracy);
-}
-
-void jmePhysicsSpace::createPhysicsSpace(jfloat minX, jfloat minY, jfloat minZ, jfloat maxX, jfloat maxY, jfloat maxZ, jint broadphaseId, jboolean threading /*unused*/) {
-    btCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
-
-    btVector3 min = btVector3(minX, minY, minZ);
-    btVector3 max = btVector3(maxX, maxY, maxZ);
-
-    btBroadphaseInterface* broadphase;
-
-    switch (broadphaseId) {
-        case 0: // SIMPLE
-            broadphase = new btSimpleBroadphase();
-            break;
-        case 1: // AXIS_SWEEP_3
-            broadphase = new btAxisSweep3(min, max);
-            break;
-        case 2: // AXIS_SWEEP_3_32
-            broadphase = new bt32BitAxisSweep3(min, max);
-            break;
-        case 3: // DBVT
-            broadphase = new btDbvtBroadphase();
-            break;
-    }
-
-    btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);
-    btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher);
-
-    btConstraintSolver* solver = new btSequentialImpulseConstraintSolver();
-
-    //create dynamics world
-    btDiscreteDynamicsWorld* world = new btDiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
-    dynamicsWorld = world;
-    dynamicsWorld->setWorldUserInfo(this);
-
-    broadphase->getOverlappingPairCache()->setInternalGhostPairCallback(new btGhostPairCallback());
-    dynamicsWorld->setGravity(btVector3(0, -9.81f, 0));
-
-    struct jmeFilterCallback : public btOverlapFilterCallback {
-        // return true when pairs need collision
-
-        virtual bool needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy * proxy1) const {
-            //            bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
-            //            collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
-            bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
-            collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
-            if (collides) {
-                btCollisionObject* co0 = (btCollisionObject*) proxy0->m_clientObject;
-                btCollisionObject* co1 = (btCollisionObject*) proxy1->m_clientObject;
-                jmeUserPointer *up0 = (jmeUserPointer*) co0 -> getUserPointer();
-                jmeUserPointer *up1 = (jmeUserPointer*) co1 -> getUserPointer();
-                if (up0 != NULL && up1 != NULL) {
-                    collides = (up0->group & up1->groups) != 0 || (up1->group & up0->groups) != 0;
-
-                    if(collides){
-                        jmePhysicsSpace *dynamicsWorld = (jmePhysicsSpace *)up0->space;
-                        JNIEnv* env = dynamicsWorld->getEnv();
-                        jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
-                        jobject javaCollisionObject0 = env->NewLocalRef(up0->javaCollisionObject);
-                        jobject javaCollisionObject1 = env->NewLocalRef(up1->javaCollisionObject);
-
-                        jboolean notifyResult = env->CallBooleanMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_notifyCollisionGroupListeners, javaCollisionObject0, javaCollisionObject1);
-
-                        env->DeleteLocalRef(javaPhysicsSpace);
-                        env->DeleteLocalRef(javaCollisionObject0);
-                        env->DeleteLocalRef(javaCollisionObject1);
-
-                        if (env->ExceptionCheck()) {
-                            env->Throw(env->ExceptionOccurred());
-                            return collides;
-                        }
-
-                        collides = (bool) notifyResult;
-                    }
-
-                    //add some additional logic here that modified 'collides'
-                    return collides;
-                }
-                return false;
-            }
-            return collides;
-        }
-    };
-    dynamicsWorld->getPairCache()->setOverlapFilterCallback(new jmeFilterCallback());
-    dynamicsWorld->setInternalTickCallback(&jmePhysicsSpace::preTickCallback, static_cast<void *> (this), true);
-    dynamicsWorld->setInternalTickCallback(&jmePhysicsSpace::postTickCallback, static_cast<void *> (this));
-    if (gContactStartedCallback == NULL) {
-        gContactStartedCallback = &jmePhysicsSpace::contactStartedCallback;
-    }
-}
-
-void jmePhysicsSpace::preTickCallback(btDynamicsWorld *world, btScalar timeStep) {
-    jmePhysicsSpace* dynamicsWorld = (jmePhysicsSpace*) world->getWorldUserInfo();
-    JNIEnv* env = dynamicsWorld->getEnv();
-    jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
-    if (javaPhysicsSpace != NULL) {
-        env->CallVoidMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_preTick, timeStep);
-        env->DeleteLocalRef(javaPhysicsSpace);
-        if (env->ExceptionCheck()) {
-            env->Throw(env->ExceptionOccurred());
-            return;
-        }
-    }
-}
-
-void jmePhysicsSpace::postTickCallback(btDynamicsWorld *world, btScalar timeStep) {
-    jmePhysicsSpace* dynamicsWorld = (jmePhysicsSpace*) world->getWorldUserInfo();
-    JNIEnv* env = dynamicsWorld->getEnv();
-    jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
-    if (javaPhysicsSpace != NULL) {
-        env->CallVoidMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_postTick, timeStep);
-        env->DeleteLocalRef(javaPhysicsSpace);
-        if (env->ExceptionCheck()) {
-            env->Throw(env->ExceptionOccurred());
-            return;
-        }
-    }
-}
-
-void jmePhysicsSpace::contactStartedCallback(btPersistentManifold* const &pm) {
-    const btCollisionObject* co0 = pm->getBody0();
-    const btCollisionObject* co1 = pm->getBody1();
-    jmeUserPointer *up0 = (jmeUserPointer*) co0 -> getUserPointer();
-    jmeUserPointer *up1 = (jmeUserPointer*) co1 -> getUserPointer();
-    if (up0 != NULL) {
-        jmePhysicsSpace *dynamicsWorld = (jmePhysicsSpace *)up0->space;
-        if (dynamicsWorld != NULL) {
-            JNIEnv* env = dynamicsWorld->getEnv();
-            jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
-            if (javaPhysicsSpace != NULL) {
-                jobject javaCollisionObject0 = env->NewLocalRef(up0->javaCollisionObject);
-                jobject javaCollisionObject1 = env->NewLocalRef(up1->javaCollisionObject);
-                for(int i=0;i<pm->getNumContacts();i++){
-                    env->CallVoidMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_addCollisionEvent, javaCollisionObject0, javaCollisionObject1, (jlong) & pm->getContactPoint(i));
-                    if (env->ExceptionCheck()) {
-                        env->Throw(env->ExceptionOccurred());
-                    }
-                }
-                env->DeleteLocalRef(javaPhysicsSpace);
-                env->DeleteLocalRef(javaCollisionObject0);
-                env->DeleteLocalRef(javaCollisionObject1);
-            }
-        }
-    }
-}
-
-btDynamicsWorld* jmePhysicsSpace::getDynamicsWorld() {
-    return dynamicsWorld;
-}
-
-jobject jmePhysicsSpace::getJavaPhysicsSpace() {
-    return javaPhysicsSpace;
-}
-
-jmePhysicsSpace::~jmePhysicsSpace() {
-    delete(dynamicsWorld);
-}

+ 0 - 66
jme3-bullet-native/src/native/cpp/jmePhysicsSpace.h

@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- *   may be used to endorse or promote products derived from this software
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include <jni.h>
-#include "btBulletDynamicsCommon.h"
-#include "btBulletCollisionCommon.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionDispatch/btGhostObject.h"
-#include "BulletDynamics/Character/btKinematicCharacterController.h"
-#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
-#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-#include "BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h"
-
-/**
- * Author: Normen Hansen
- */
-class jmePhysicsSpace {
-private:
-	JNIEnv* env;
-	JavaVM* vm;
-	btDynamicsWorld* dynamicsWorld;
-	jobject javaPhysicsSpace;
-        void attachThread();
-public:
-	jmePhysicsSpace(){};
-	~jmePhysicsSpace();
-        jmePhysicsSpace(JNIEnv*, jobject);
-	void stepSimulation(jfloat, jint, jfloat);
-        void createPhysicsSpace(jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jint, jboolean);
-        btDynamicsWorld* getDynamicsWorld();
-        jobject getJavaPhysicsSpace();
-        JNIEnv* getEnv();
-        static void preTickCallback(btDynamicsWorld*, btScalar);
-        static void postTickCallback(btDynamicsWorld*, btScalar);
-        static void contactStartedCallback(btPersistentManifold* const &);
-};