-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
PhysicsIssues with all kinds of Physics and their BindingsIssues with all kinds of Physics and their BindingsbugSomething that is supposed to work, but doesn't. More severe than a "defect".Something that is supposed to work, but doesn't. More severe than a "defect".
Milestone
Description
Looks like more copy-and-paste errors, combined with confusion about the order of the arguments to setSleepingThresholds():
JNIEXPORT void JNICALL
Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearSleepingThreshold(
JNIEnv *env,
jobject object,
jlong bodyId,
jfloat value) {
...
body->setSleepingThresholds(value, body->getLinearSleepingThreshold());
What this actually does is to set the linear threshold to value while setting the angular threshold to the former value of the linear threshold.
Similarly:
JNIEXPORT void JNICALL
Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularSleepingThreshold(
JNIEnv *env,
jobject object,
jlong bodyId,
jfloat value) {
...
body->setSleepingThresholds(body->getAngularSleepingThreshold(), value);
What this actually does is to set the angular threshold to value while setting the linear threshold to the former value of the angular threshold.
Unsurprisingly, this issue is only found in Native Bullet, not in JBullet.
Here's my test case:
public void simpleInitApp() {
CollisionShape capsule = new SphereCollisionShape(1f);
PhysicsRigidBody body = new PhysicsRigidBody(capsule, 1f);
assert body.getAngularSleepingThreshold() == 1f;
assert body.getLinearSleepingThreshold() == 0.8f;
body.setAngularSleepingThreshold(0.03f);
assert body.getAngularSleepingThreshold() == 0.03f;
float lst = body.getLinearSleepingThreshold();
assert lst == 0.8f : lst; // fails, actual value is 1f
body.setLinearSleepingThreshold(0.17f);
float ast = body.getAngularSleepingThreshold();
assert ast == 0.03f : ast; // fails, actual value is 1f
stop();
}
Metadata
Metadata
Assignees
Labels
PhysicsIssues with all kinds of Physics and their BindingsIssues with all kinds of Physics and their BindingsbugSomething that is supposed to work, but doesn't. More severe than a "defect".Something that is supposed to work, but doesn't. More severe than a "defect".