Search in sources :

Example 51 with InputCapsule

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

the class VehicleWheel method read.

@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule capsule = im.getCapsule(this);
    wheelSpatial = (Spatial) capsule.readSavable("wheelSpatial", null);
    frontWheel = capsule.readBoolean("frontWheel", false);
    location = (Vector3f) capsule.readSavable("wheelLocation", new Vector3f());
    direction = (Vector3f) capsule.readSavable("wheelDirection", new Vector3f());
    axle = (Vector3f) capsule.readSavable("wheelAxle", new Vector3f());
    suspensionStiffness = capsule.readFloat("suspensionStiffness", 20.0f);
    wheelsDampingRelaxation = capsule.readFloat("wheelsDampingRelaxation", 2.3f);
    wheelsDampingCompression = capsule.readFloat("wheelsDampingCompression", 4.4f);
    frictionSlip = capsule.readFloat("frictionSlip", 10.5f);
    rollInfluence = capsule.readFloat("rollInfluence", 1.0f);
    maxSuspensionTravelCm = capsule.readFloat("maxSuspensionTravelCm", 500f);
    maxSuspensionForce = capsule.readFloat("maxSuspensionForce", 6000f);
    radius = capsule.readFloat("wheelRadius", 0.5f);
    restLength = capsule.readFloat("restLength", 1f);
}
Also used : Vector3f(com.jme3.math.Vector3f)

Example 52 with InputCapsule

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

the class AnimationEvent method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    if (im.getFormatVersion() == 0) {
        modelName = ic.readString("modelName", "");
    }
    //FIXME always the same issue, because of the clonning of assets, this won't work
    //we have to somehow store userdata in the spatial and then recurse the 
    //scene sub scenegraph to find the correct instance of the model
    //This brings a reflaxion about the cinematic being an appstate, 
    //shouldn't it be a control over the scene
    // this would allow to use the cloneForSpatial method and automatically 
    //rebind cloned references of original objects.
    //for now as nobody probably ever saved a cinematic, this is not a critical issue
    model = (Spatial) ic.readSavable("model", null);
    animationName = ic.readString("animationName", "");
    blendTime = ic.readFloat("blendTime", 0f);
    channelIndex = ic.readInt("channelIndex", 0);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 53 with InputCapsule

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

the class SpatialTrack method read.

@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    translations = (CompactVector3Array) ic.readSavable("translations", null);
    rotations = (CompactQuaternionArray) ic.readSavable("rotations", null);
    times = ic.readFloatArray("times", null);
    scales = (CompactVector3Array) ic.readSavable("scales", null);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 54 with InputCapsule

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

the class TextureKey method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    flipY = ic.readBoolean("flip_y", false);
    generateMips = ic.readBoolean("generate_mips", false);
    anisotropy = ic.readInt("anisotropy", 0);
    boolean asCube = ic.readBoolean("as_cubemap", false);
    if (asCube) {
        // Backwards compat
        textureTypeHint = Type.CubeMap;
    } else {
        textureTypeHint = ic.readEnum("tex_type", Texture.Type.class, Type.TwoDimensional);
    }
}
Also used : Type(com.jme3.texture.Texture.Type) InputCapsule(com.jme3.export.InputCapsule)

Example 55 with InputCapsule

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

the class AudioKey method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    stream = ic.readBoolean("do_stream", false);
    streamCache = ic.readBoolean("use_stream_cache", false);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

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