PhysicsCollisionObject: add getDeactivationTime() and test buildscript

fix-openal-soft-deadlink
Stephen Gold 5 years ago
parent 2c2f76cca1
commit 42530de219
  1. 18
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_collision_PhysicsCollisionObject.cpp
  2. 12
      jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java

@ -178,6 +178,24 @@ extern "C" {
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
}

@ -158,6 +158,18 @@ public abstract class PhysicsCollisionObject implements Savable {
return collisionShape;
}
/**
* Read the deactivation time.
*
* @return the time (in seconds)
*/
public float getDeactivationTime() {
float time = getDeactivationTime(objectId);
return time;
}
native private float getDeactivationTime(long objectId);
/**
* Read the collision group for this physics object.
*

Loading…
Cancel
Save