Search in sources :

Example 61 with InputCapsule

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

the class GhostControl method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
    applyLocal = ic.readBoolean("applyLocalPhysics", false);
    setUserObject(spatial);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 62 with InputCapsule

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

the class RigidBodyControl method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    kinematicSpatial = ic.readBoolean("kinematicSpatial", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
    motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
    setUserObject(spatial);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 63 with InputCapsule

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

the class VehicleControl method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    enabled = ic.readBoolean("enabled", true);
    spatial = (Spatial) ic.readSavable("spatial", null);
    motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
    setUserObject(spatial);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 64 with InputCapsule

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

the class TrackInfo method read.

public void read(JmeImporter im) throws IOException {
    InputCapsule c = im.getCapsule(this);
    tracks = c.readSavableArrayList("tracks", null);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 65 with InputCapsule

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

the class AudioNode method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    // to "audio_key" in case Spatial's key will be written as "key".
    if (ic.getSavableVersion(AudioNode.class) == 0) {
        audioKey = (AudioKey) ic.readSavable("key", null);
    } else {
        audioKey = (AudioKey) ic.readSavable("audio_key", null);
    }
    loop = ic.readBoolean("looping", false);
    volume = ic.readFloat("volume", 1);
    pitch = ic.readFloat("pitch", 1);
    timeOffset = ic.readFloat("time_offset", 0);
    dryFilter = (Filter) ic.readSavable("dry_filter", null);
    velocity = (Vector3f) ic.readSavable("velocity", null);
    reverbEnabled = ic.readBoolean("reverb_enabled", false);
    reverbFilter = (Filter) ic.readSavable("reverb_filter", null);
    maxDistance = ic.readFloat("max_distance", 20);
    refDistance = ic.readFloat("ref_distance", 10);
    directional = ic.readBoolean("directional", false);
    direction = (Vector3f) ic.readSavable("direction", null);
    innerAngle = ic.readFloat("inner_angle", 360);
    outerAngle = ic.readFloat("outer_angle", 360);
    positional = ic.readBoolean("positional", false);
    velocityFromTranslation = ic.readBoolean("velocity_from_translation", false);
    if (audioKey != null) {
        try {
            data = im.getAssetManager().loadAsset(audioKey);
        } catch (AssetNotFoundException ex) {
            Logger.getLogger(AudioNode.class.getName()).log(Level.FINE, "Cannot locate {0} for audio node {1}", new Object[] { audioKey, key });
            data = PlaceholderAssets.getPlaceholderAudio();
        }
    }
}
Also used : InputCapsule(com.jme3.export.InputCapsule) AssetNotFoundException(com.jme3.asset.AssetNotFoundException)

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