@ -626,11 +626,13 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
private native float getAngularSleepingThreshold ( long objectId ) ;
public float getAngularFactor ( ) {
return getAngularFactor ( objectId ) ;
public Vector3f getAngularFactor ( ) {
Vector3f vec = new Vector3f ( ) ;
getAngularFactor ( objectId , vec ) ;
return vec ;
}
private native float getAngularFactor ( long objectId ) ;
private native void getAngularFactor ( long objectId , Vector3f vec ) ;
public void setAngularFactor ( float factor ) {
setAngularFactor ( objectId , factor ) ;
@ -638,6 +640,27 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
private native void setAngularFactor ( long objectId , float factor ) ;
public void setAngularFactor ( Vector3f factor ) {
setAngularFactor ( objectId , factor ) ;
}
private native void setAngularFactor ( long objectId , Vector3f factor ) ;
public Vector3f getLinearFactor ( ) {
Vector3f vec = new Vector3f ( ) ;
getLinearFactor ( objectId , vec ) ;
return vec ;
}
private native void getLinearFactor ( long objectId , Vector3f vec ) ;
public void setLinearFactor ( Vector3f factor ) {
setLinearFactor ( objectId , factor ) ;
}
private native void setLinearFactor ( long objectId , Vector3f factor ) ;
/ * *
* do not use manually , joints are added automatically
* /
@ -673,7 +696,8 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
capsule . write ( getGravity ( ) , "gravity" , Vector3f . ZERO ) ;
capsule . write ( getFriction ( ) , "friction" , 0 . 5f ) ;
capsule . write ( getRestitution ( ) , "restitution" , 0 ) ;
capsule . write ( getAngularFactor ( ) , "angularFactor" , 1 ) ;
capsule . write ( getAngularFactor ( ) , "angularFactor" , Vector3f . UNIT_XYZ ) ;
capsule . write ( getLinearFactor ( ) , "linearFactor" , Vector3f . UNIT_XYZ ) ;
capsule . write ( kinematic , "kinematic" , false ) ;
capsule . write ( getLinearDamping ( ) , "linearDamping" , 0 ) ;
@ -703,7 +727,8 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
setKinematic ( capsule . readBoolean ( "kinematic" , false ) ) ;
setRestitution ( capsule . readFloat ( "restitution" , 0 ) ) ;
setAngularFactor ( capsule . readFloat ( "angularFactor" , 1 ) ) ;
setAngularFactor ( ( Vector3f ) capsule . readSavable ( "angularFactor" , Vector3f . UNIT_XYZ . clone ( ) ) ) ;
setLinearFactor ( ( Vector3f ) capsule . readSavable ( "linearFactor" , Vector3f . UNIT_XYZ . clone ( ) ) ) ;
setDamping ( capsule . readFloat ( "linearDamping" , 0 ) , capsule . readFloat ( "angularDamping" , 0 ) ) ;
setSleepingThresholds ( capsule . readFloat ( "linearSleepingThreshold" , 0 . 8f ) , capsule . readFloat ( "angularSleepingThreshold" , 1 . 0f ) ) ;
setCcdMotionThreshold ( capsule . readFloat ( "ccdMotionThreshold" , 0 ) ) ;