use of com.jme3.math.Matrix3f in project jmonkeyengine by jMonkeyEngine.
the class PhysicsGhostObject method write.
@Override
public void write(JmeExporter e) throws IOException {
super.write(e);
OutputCapsule capsule = e.getCapsule(this);
capsule.write(getPhysicsLocation(new Vector3f()), "physicsLocation", new Vector3f());
capsule.write(getPhysicsRotationMatrix(new Matrix3f()), "physicsRotation", new Matrix3f());
capsule.write(getCcdMotionThreshold(), "ccdMotionThreshold", 0);
capsule.write(getCcdSweptSphereRadius(), "ccdSweptSphereRadius", 0);
}
use of com.jme3.math.Matrix3f in project jmonkeyengine by jMonkeyEngine.
the class PhysicsRigidBody method read.
@Override
public void read(JmeImporter e) throws IOException {
super.read(e);
InputCapsule capsule = e.getCapsule(this);
float mass = capsule.readFloat("mass", 1.0f);
this.mass = mass;
rebuildRigidBody();
setGravity((Vector3f) capsule.readSavable("gravity", Vector3f.ZERO.clone()));
setFriction(capsule.readFloat("friction", 0.5f));
setKinematic(capsule.readBoolean("kinematic", false));
setRestitution(capsule.readFloat("restitution", 0));
setAngularFactor(capsule.readFloat("angularFactor", 1));
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));
setCcdSweptSphereRadius(capsule.readFloat("ccdSweptSphereRadius", 0));
setPhysicsLocation((Vector3f) capsule.readSavable("physicsLocation", new Vector3f()));
setPhysicsRotation((Matrix3f) capsule.readSavable("physicsRotation", new Matrix3f()));
joints = capsule.readSavableArrayList("joints", null);
}
use of com.jme3.math.Matrix3f in project jmonkeyengine by jMonkeyEngine.
the class PhysicsRigidBody method write.
@Override
public void write(JmeExporter e) throws IOException {
super.write(e);
OutputCapsule capsule = e.getCapsule(this);
capsule.write(getMass(), "mass", 1.0f);
capsule.write(getGravity(), "gravity", Vector3f.ZERO);
capsule.write(getFriction(), "friction", 0.5f);
capsule.write(getRestitution(), "restitution", 0);
capsule.write(getAngularFactor(), "angularFactor", 1);
capsule.write(kinematic, "kinematic", false);
capsule.write(constructionInfo.linearDamping, "linearDamping", 0);
capsule.write(constructionInfo.angularDamping, "angularDamping", 0);
capsule.write(constructionInfo.linearSleepingThreshold, "linearSleepingThreshold", 0.8f);
capsule.write(constructionInfo.angularSleepingThreshold, "angularSleepingThreshold", 1.0f);
capsule.write(getCcdMotionThreshold(), "ccdMotionThreshold", 0);
capsule.write(getCcdSweptSphereRadius(), "ccdSweptSphereRadius", 0);
capsule.write(getPhysicsLocation(new Vector3f()), "physicsLocation", new Vector3f());
capsule.write(getPhysicsRotationMatrix(new Matrix3f()), "physicsRotation", new Matrix3f());
capsule.writeSavableArrayList(joints, "joints", null);
}
use of com.jme3.math.Matrix3f in project jmonkeyengine by jMonkeyEngine.
the class ConeJoint method write.
@Override
public void write(JmeExporter ex) throws IOException {
super.write(ex);
OutputCapsule capsule = ex.getCapsule(this);
capsule.write(rotA, "rotA", new Matrix3f());
capsule.write(rotB, "rotB", new Matrix3f());
capsule.write(angularOnly, "angularOnly", false);
capsule.write(swingSpan1, "swingSpan1", 1e30f);
capsule.write(swingSpan2, "swingSpan2", 1e30f);
capsule.write(twistSpan, "twistSpan", 1e30f);
}
use of com.jme3.math.Matrix3f in project jmonkeyengine by jMonkeyEngine.
the class ConeJoint method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule capsule = im.getCapsule(this);
this.rotA = (Matrix3f) capsule.readSavable("rotA", new Matrix3f());
this.rotB = (Matrix3f) capsule.readSavable("rotB", new Matrix3f());
this.angularOnly = capsule.readBoolean("angularOnly", false);
this.swingSpan1 = capsule.readFloat("swingSpan1", 1e30f);
this.swingSpan2 = capsule.readFloat("swingSpan2", 1e30f);
this.twistSpan = capsule.readFloat("twistSpan", 1e30f);
createJoint();
}
Aggregations