Bullet PhysicsRididBody : compile time error fix

experimental
Maselbas 10 years ago
parent 878f2cbbbc
commit 3780061863
  1. 28
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.cpp
  2. 4
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_objects_PhysicsRigidBody.h
  3. 4
      jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java

@ -829,20 +829,20 @@ extern "C" {
* Method: setAngularFactor
* Signature: (JF)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
(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;
}
btVector3 vec1 = btVector3();
vec1.setX(value);
vec1.setY(value);
vec1.setZ(value);
body->setAngularFactor(vec1);
}
// JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
// (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;
// }
// btVector3 vec1 = btVector3();
// vec1.setX(value);
// vec1.setY(value);
// vec1.setZ(value);
// body->setAngularFactor(vec1);
// }
/*
* Class: com_jme3_bullet_objects_PhysicsRigidBody

@ -406,8 +406,8 @@ JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularF
* Method: setAngularFactor
* Signature: (JF)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
(JNIEnv *, jobject, jlong, jfloat);
//JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
// (JNIEnv *, jobject, jlong, jfloat);
/*
* Class: com_jme3_bullet_objects_PhysicsRigidBody

@ -635,11 +635,9 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
private native void getAngularFactor(long objectId, Vector3f vec);
public void setAngularFactor(float factor) {
setAngularFactor(objectId, factor);
setAngularFactor(objectId, new Vector3f(factor, factor, factor));
}
private native void setAngularFactor(long objectId, float factor);
public void setAngularFactor(Vector3f factor) {
setAngularFactor(objectId, factor);
}

Loading…
Cancel
Save