Search in sources :

Example 46 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class SphereCollisionShape method read.

public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule capsule = im.getCapsule(this);
    radius = capsule.readFloat("radius", 0.5f);
    createShape();
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 47 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class Point2PointJoint method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    createJoint();
    InputCapsule cap = im.getCapsule(this);
    setDamping(cap.readFloat("damping", 1.0f));
    setDamping(cap.readFloat("tau", 0.3f));
    setDamping(cap.readFloat("impulseClamp", 0f));
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 48 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class PhysicsGhostObject method read.

@Override
public void read(JmeImporter e) throws IOException {
    super.read(e);
    InputCapsule capsule = e.getCapsule(this);
    buildObject();
    setPhysicsLocation((Vector3f) capsule.readSavable("physicsLocation", new Vector3f()));
    setPhysicsRotation(((Matrix3f) capsule.readSavable("physicsRotation", new Matrix3f())));
    setCcdMotionThreshold(capsule.readFloat("ccdMotionThreshold", 0));
    setCcdSweptSphereRadius(capsule.readFloat("ccdSweptSphereRadius", 0));
}
Also used : Matrix3f(com.jme3.math.Matrix3f) InputCapsule(com.jme3.export.InputCapsule) Vector3f(com.jme3.math.Vector3f)

Example 49 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class PhysicsVehicle method read.

@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule capsule = im.getCapsule(this);
    tuning = new VehicleTuning();
    tuning.frictionSlip = capsule.readFloat("frictionSlip", 10.5f);
    tuning.maxSuspensionTravelCm = capsule.readFloat("maxSuspensionTravelCm", 500f);
    tuning.maxSuspensionForce = capsule.readFloat("maxSuspensionForce", 6000f);
    tuning.suspensionCompression = capsule.readFloat("suspensionCompression", 0.83f);
    tuning.suspensionDamping = capsule.readFloat("suspensionDamping", 0.88f);
    tuning.suspensionStiffness = capsule.readFloat("suspensionStiffness", 5.88f);
    wheels = capsule.readSavableArrayList("wheelsList", new ArrayList<VehicleWheel>());
    motionState.setVehicle(this);
    super.read(im);
}
Also used : InputCapsule(com.jme3.export.InputCapsule) ArrayList(java.util.ArrayList)

Example 50 with InputCapsule

use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.

the class CollisionShape method read.

public void read(JmeImporter im) throws IOException {
    InputCapsule capsule = im.getCapsule(this);
    this.scale = (Vector3f) capsule.readSavable("scale", new Vector3f(1, 1, 1));
    this.margin = capsule.readFloat("margin", 0.0f);
}
Also used : Vector3f(com.jme3.math.Vector3f)

Aggregations

InputCapsule (com.jme3.export.InputCapsule)123 Vector3f (com.jme3.math.Vector3f)18 Matrix3f (com.jme3.math.Matrix3f)5 ArrayList (java.util.ArrayList)5 AssetNotFoundException (com.jme3.asset.AssetNotFoundException)2 PhysicsRigidBody (com.jme3.bullet.objects.PhysicsRigidBody)2 Mesh (com.jme3.scene.Mesh)2 ShadowCompareMode (com.jme3.texture.Texture.ShadowCompareMode)2 ConvexShape (com.bulletphysics.collision.shapes.ConvexShape)1 KinematicCharacterController (com.bulletphysics.dynamics.character.KinematicCharacterController)1 Generic6DofConstraint (com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint)1 HingeConstraint (com.bulletphysics.dynamics.constraintsolver.HingeConstraint)1 SliderConstraint (com.bulletphysics.dynamics.constraintsolver.SliderConstraint)1 Transform (com.bulletphysics.linearmath.Transform)1 LinkerMsg (com.cas.circuit.msg.LinkerMsg)1 LoopMode (com.jme3.animation.LoopMode)1 AssetInfo (com.jme3.asset.AssetInfo)1 AssetKey (com.jme3.asset.AssetKey)1 AssetManager (com.jme3.asset.AssetManager)1 ModelKey (com.jme3.asset.ModelKey)1