PhysicsSpace.cpp: whitespace changes to trigger an AppVeyor build (#963)

* Edit gradle.properties to trigger a rebuild

* PhysicsSpace.cpp: whitespace changes to trigger an AppVeyor build
accellbaker
Stephen Gold 6 years ago committed by GitHub
parent 772af5ac60
commit e9069a0276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 113
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_PhysicsSpace.cpp

@ -46,16 +46,21 @@ extern "C" {
* Signature: (FFFFFFI)J * Signature: (FFFFFFI)J
*/ */
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_PhysicsSpace_createPhysicsSpace 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) { (JNIEnv * env, jobject object, jfloat minX, jfloat minY, jfloat minZ,
jfloat maxX, jfloat maxY, jfloat maxZ, jint broadphase,
jboolean threading) {
jmeClasses::initJavaClasses(env); jmeClasses::initJavaClasses(env);
jmePhysicsSpace* space = new jmePhysicsSpace(env, object); jmePhysicsSpace* space = new jmePhysicsSpace(env, object);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space has not been created."); env->ThrowNew(newExc, "The physics space has not been created.");
return 0; return 0;
} }
space->createPhysicsSpace(minX, minY, minZ, maxX, maxY, maxZ, broadphase, threading);
return reinterpret_cast<jlong>(space); space->createPhysicsSpace(minX, minY, minZ, maxX, maxY, maxZ,
broadphase, threading);
return reinterpret_cast<jlong> (space);
} }
/* /*
@ -64,8 +69,9 @@ extern "C" {
* Signature: (JFIF)V * Signature: (JFIF)V
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_stepSimulation JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_stepSimulation
(JNIEnv * env, jobject object, jlong spaceId, jfloat tpf, jint maxSteps, jfloat accuracy) { (JNIEnv * env, jobject object, jlong spaceId, jfloat tpf, jint maxSteps,
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jfloat accuracy) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -81,8 +87,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCollisionObject JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCollisionObject
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId); btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -93,7 +99,7 @@ extern "C" {
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer(); jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
userPointer -> space = space; userPointer -> space = space;
space->getDynamicsWorld()->addCollisionObject(collisionObject); space->getDynamicsWorld()->addCollisionObject(collisionObject);
@ -106,8 +112,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCollisionObject JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCollisionObject
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId); btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -119,7 +125,7 @@ extern "C" {
return; return;
} }
space->getDynamicsWorld()->removeCollisionObject(collisionObject); space->getDynamicsWorld()->removeCollisionObject(collisionObject);
jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer(); jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
userPointer -> space = NULL; userPointer -> space = NULL;
} }
@ -130,8 +136,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addRigidBody JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addRigidBody
(JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) { (JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btRigidBody* collisionObject = reinterpret_cast<btRigidBody*>(rigidBodyId); btRigidBody* collisionObject = reinterpret_cast<btRigidBody*> (rigidBodyId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -142,7 +148,7 @@ extern "C" {
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer(); jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
userPointer -> space = space; userPointer -> space = space;
space->getDynamicsWorld()->addRigidBody(collisionObject); space->getDynamicsWorld()->addRigidBody(collisionObject);
} }
@ -154,8 +160,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeRigidBody JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeRigidBody
(JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) { (JNIEnv * env, jobject object, jlong spaceId, jlong rigidBodyId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btRigidBody* collisionObject = reinterpret_cast<btRigidBody*>(rigidBodyId); btRigidBody* collisionObject = reinterpret_cast<btRigidBody*> (rigidBodyId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -166,7 +172,7 @@ extern "C" {
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer(); jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
userPointer -> space = NULL; userPointer -> space = NULL;
space->getDynamicsWorld()->removeRigidBody(collisionObject); space->getDynamicsWorld()->removeRigidBody(collisionObject);
} }
@ -178,8 +184,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCharacterObject JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addCharacterObject
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId); btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -190,12 +196,12 @@ extern "C" {
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer(); jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
userPointer -> space = space; userPointer -> space = space;
space->getDynamicsWorld()->addCollisionObject(collisionObject, space->getDynamicsWorld()->addCollisionObject(collisionObject,
btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::CharacterFilter,
btBroadphaseProxy::StaticFilter | btBroadphaseProxy::DefaultFilter btBroadphaseProxy::StaticFilter | btBroadphaseProxy::DefaultFilter
); );
} }
/* /*
@ -205,8 +211,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCharacterObject JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeCharacterObject
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId); btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -217,7 +223,7 @@ extern "C" {
env->ThrowNew(newExc, "The collision object does not exist."); env->ThrowNew(newExc, "The collision object does not exist.");
return; return;
} }
jmeUserPointer *userPointer = (jmeUserPointer*)collisionObject->getUserPointer(); jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
userPointer -> space = NULL; userPointer -> space = NULL;
space->getDynamicsWorld()->removeCollisionObject(collisionObject); space->getDynamicsWorld()->removeCollisionObject(collisionObject);
} }
@ -229,8 +235,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addAction JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addAction
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId); btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -251,8 +257,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeAction JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeAction
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId); btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -273,8 +279,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addVehicle JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addVehicle
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId); btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -295,8 +301,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeVehicle JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeVehicle
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btActionInterface* actionObject = reinterpret_cast<btActionInterface*>(objectId); btActionInterface* actionObject = reinterpret_cast<btActionInterface*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -317,8 +323,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraint JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraint
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*>(objectId); btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -339,8 +345,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraintC JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_addConstraintC
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId, jboolean collision) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId, jboolean collision) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*>(objectId); btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -361,8 +367,8 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeConstraint JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_removeConstraint
(JNIEnv * env, jobject object, jlong spaceId, jlong objectId) { (JNIEnv * env, jobject object, jlong spaceId, jlong objectId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*>(objectId); btTypedConstraint* constraint = reinterpret_cast<btTypedConstraint*> (objectId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -383,7 +389,7 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setGravity JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setGravity
(JNIEnv * env, jobject object, jlong spaceId, jobject vector) { (JNIEnv * env, jobject object, jlong spaceId, jobject vector) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");
@ -391,6 +397,7 @@ extern "C" {
} }
btVector3 gravity = btVector3(); btVector3 gravity = btVector3();
jmeBulletUtil::convert(env, vector, &gravity); jmeBulletUtil::convert(env, vector, &gravity);
space->getDynamicsWorld()->setGravity(gravity); space->getDynamicsWorld()->setGravity(gravity);
} }
@ -411,7 +418,7 @@ extern "C" {
*/ */
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_finalizeNative JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_finalizeNative
(JNIEnv * env, jobject object, jlong spaceId) { (JNIEnv * env, jobject object, jlong spaceId) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
if (space == NULL) { if (space == NULL) {
return; return;
} }
@ -465,13 +472,12 @@ extern "C" {
resultCallback.resultlist = resultlist; resultCallback.resultlist = resultlist;
resultCallback.m_flags = flags; resultCallback.m_flags = flags;
space->getDynamicsWorld()->rayTest(native_from, native_to, resultCallback); space->getDynamicsWorld()->rayTest(native_from, native_to, resultCallback);
return; return;
} }
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_sweepTest_1native 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) { (JNIEnv * env, jobject object, jlong shapeId, jobject from, jobject to, jlong spaceId, jobject resultlist, jfloat allowedCcdPenetration) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
if (space == NULL) { if (space == NULL) {
@ -489,7 +495,7 @@ extern "C" {
struct AllConvexResultCallback : public btCollisionWorld::ConvexResultCallback { struct AllConvexResultCallback : public btCollisionWorld::ConvexResultCallback {
AllConvexResultCallback(const btTransform& convexFromWorld, const btTransform & convexToWorld) : m_convexFromWorld(convexFromWorld), m_convexToWorld(convexToWorld) { AllConvexResultCallback(const btTransform& convexFromWorld, const btTransform & convexToWorld) : m_convexFromWorld(convexFromWorld), m_convexToWorld(convexToWorld) {
} }
jobject resultlist; jobject resultlist;
JNIEnv* env; JNIEnv* env;
@ -500,17 +506,16 @@ extern "C" {
btVector3 m_hitPointWorld; btVector3 m_hitPointWorld;
virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult, bool normalInWorldSpace) { virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult, bool normalInWorldSpace) {
if (normalInWorldSpace) { if (normalInWorldSpace) {
m_hitNormalWorld = convexResult.m_hitNormalLocal; m_hitNormalWorld = convexResult.m_hitNormalLocal;
} } else {
else { m_hitNormalWorld = convexResult.m_hitCollisionObject->getWorldTransform().getBasis() * convexResult.m_hitNormalLocal;
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);
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); jmeBulletUtil::addSweepResult(env, resultlist, &m_hitNormalWorld, &m_hitPointWorld, convexResult.m_hitFraction, convexResult.m_hitCollisionObject);
return 1.f; return 1.f;
} }
}; };
@ -531,7 +536,7 @@ extern "C" {
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setSolverNumIterations JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_setSolverNumIterations
(JNIEnv *env, jobject object, jlong spaceId, jint value) { (JNIEnv *env, jobject object, jlong spaceId, jint value) {
jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*>(spaceId); jmePhysicsSpace* space = reinterpret_cast<jmePhysicsSpace*> (spaceId);
if (space == NULL) { if (space == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException"); jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The physics space does not exist."); env->ThrowNew(newExc, "The physics space does not exist.");

Loading…
Cancel
Save