Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Oct 13, 2018
1 parent 30b42ee commit 7eca64c
Show file tree
Hide file tree
Showing 36 changed files with 685 additions and 700 deletions.
105 changes: 51 additions & 54 deletions src/native/glue/com_jme3_bullet_PhysicsSpace.cpp

Large diffs are not rendered by default.

79 changes: 39 additions & 40 deletions src/native/glue/com_jme3_bullet_collision_PhysicsCollisionEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
* 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);
(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.");
Expand All @@ -58,8 +58,8 @@ JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_ge
* 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);
(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.");
Expand All @@ -74,8 +74,8 @@ JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_ge
* 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);
(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.");
Expand All @@ -90,8 +90,8 @@ JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_ge
* 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);
(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.");
Expand All @@ -106,8 +106,8 @@ JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_ge
* 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);
(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.");
Expand All @@ -122,8 +122,8 @@ JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_ge
* 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);
(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.");
Expand All @@ -138,8 +138,8 @@ JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_ge
* 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);
(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.");
Expand All @@ -154,8 +154,8 @@ JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getI
* 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);
(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.");
Expand All @@ -170,8 +170,8 @@ JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getI
* 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);
(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.");
Expand All @@ -186,8 +186,8 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getL
* 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);
(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.");
Expand All @@ -202,14 +202,14 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getL
* 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);
(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;
return (mp -> m_contactPointFlags) & BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED;
}

/*
Expand All @@ -218,8 +218,8 @@ JNIEXPORT jboolean JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_
* 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);
(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.");
Expand All @@ -234,8 +234,8 @@ JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getL
* 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);
(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.");
Expand All @@ -250,8 +250,8 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getL
* 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);
(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.");
Expand All @@ -266,8 +266,8 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getL
* 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);
(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.");
Expand All @@ -282,8 +282,8 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getN
* 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);
(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.");
Expand All @@ -298,8 +298,8 @@ JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getP
* 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);
(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.");
Expand All @@ -314,8 +314,8 @@ JNIEXPORT jint JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getP
* 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);
(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.");
Expand All @@ -324,15 +324,14 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionEvent_getP
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);
(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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ extern "C" {
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_attachCollisionShape
(JNIEnv * env, jobject object, jlong objectId, jlong shapeId) {
btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(objectId);
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);
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.");
Expand All @@ -70,34 +70,35 @@ extern "C" {
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_collision_PhysicsCollisionObject_finalizeNative
(JNIEnv * env, jobject object, jlong objectId) {
btCollisionObject* collisionObject = reinterpret_cast<btCollisionObject*>(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();
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);
(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();
jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
if (userPointer != NULL) {
// delete(userPointer);
// delete(userPointer);
}
userPointer = new jmeUserPointer();
userPointer -> javaCollisionObject = env->NewWeakGlobalRef(object);
Expand All @@ -106,39 +107,41 @@ extern "C" {
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);
(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){
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);
(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){
jmeUserPointer *userPointer = (jmeUserPointer*) collisionObject->getUserPointer();
if (userPointer != NULL) {
userPointer -> groups = groups;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_com_jme3_bullet_collision_shapes_BoxCollisionShape_createShape
(JNIEnv *env, jobject object, jobject halfExtents) {
jmeClasses::initJavaClasses(env);
btVector3 extents = btVector3();
btVector3 extents = btVector3();
jmeBulletUtil::convert(env, halfExtents, &extents);
btBoxShape* shape = new btBoxShape(extents);
return reinterpret_cast<jlong>(shape);
return reinterpret_cast<jlong> (shape);
}

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit 7eca64c

Please sign in to comment.