Bullet RigidBody : prevent from breaking the API & reverted
This commit is contained in:
parent
5de3163fb8
commit
7f2c7c5d35
@ -626,10 +626,16 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
|
|||||||
|
|
||||||
private native float getAngularSleepingThreshold(long objectId);
|
private native float getAngularSleepingThreshold(long objectId);
|
||||||
|
|
||||||
public Vector3f getAngularFactor() {
|
public float getAngularFactor() {
|
||||||
Vector3f vec = new Vector3f();
|
return getAngularFactor(null).getX();
|
||||||
getAngularFactor(objectId, vec);
|
}
|
||||||
return vec;
|
|
||||||
|
public Vector3f getAngularFactor(Vector3f store) {
|
||||||
|
// doing like this prevent from breaking the API
|
||||||
|
if(store == null)
|
||||||
|
store = new Vector3f();
|
||||||
|
getAngularFactor(objectId, store);
|
||||||
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
private native void getAngularFactor(long objectId, Vector3f vec);
|
private native void getAngularFactor(long objectId, Vector3f vec);
|
||||||
@ -694,8 +700,7 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
|
|||||||
capsule.write(getGravity(), "gravity", Vector3f.ZERO);
|
capsule.write(getGravity(), "gravity", Vector3f.ZERO);
|
||||||
capsule.write(getFriction(), "friction", 0.5f);
|
capsule.write(getFriction(), "friction", 0.5f);
|
||||||
capsule.write(getRestitution(), "restitution", 0);
|
capsule.write(getRestitution(), "restitution", 0);
|
||||||
capsule.write(getAngularFactor(), "angularFactor", Vector3f.UNIT_XYZ);
|
capsule.write(getAngularFactor(), "angularFactor", 1);
|
||||||
capsule.write(getLinearFactor(), "linearFactor", Vector3f.UNIT_XYZ);
|
|
||||||
capsule.write(kinematic, "kinematic", false);
|
capsule.write(kinematic, "kinematic", false);
|
||||||
|
|
||||||
capsule.write(getLinearDamping(), "linearDamping", 0);
|
capsule.write(getLinearDamping(), "linearDamping", 0);
|
||||||
@ -725,8 +730,7 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
|
|||||||
setKinematic(capsule.readBoolean("kinematic", false));
|
setKinematic(capsule.readBoolean("kinematic", false));
|
||||||
|
|
||||||
setRestitution(capsule.readFloat("restitution", 0));
|
setRestitution(capsule.readFloat("restitution", 0));
|
||||||
setAngularFactor((Vector3f) capsule.readSavable("angularFactor", Vector3f.UNIT_XYZ.clone()));
|
setAngularFactor(capsule.readFloat("angularFactor", 1));
|
||||||
setLinearFactor((Vector3f) capsule.readSavable("linearFactor", Vector3f.UNIT_XYZ.clone()));
|
|
||||||
setDamping(capsule.readFloat("linearDamping", 0), capsule.readFloat("angularDamping", 0));
|
setDamping(capsule.readFloat("linearDamping", 0), capsule.readFloat("angularDamping", 0));
|
||||||
setSleepingThresholds(capsule.readFloat("linearSleepingThreshold", 0.8f), capsule.readFloat("angularSleepingThreshold", 1.0f));
|
setSleepingThresholds(capsule.readFloat("linearSleepingThreshold", 0.8f), capsule.readFloat("angularSleepingThreshold", 1.0f));
|
||||||
setCcdMotionThreshold(capsule.readFloat("ccdMotionThreshold", 0));
|
setCcdMotionThreshold(capsule.readFloat("ccdMotionThreshold", 0));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user