Search in sources :

Example 1 with LoopMode

use of com.jme3.animation.LoopMode in project jmonkeyengine by jMonkeyEngine.

the class AbstractCinematicEvent method write.

/**
     * Used for serialization only.
     * @param ex exporter
     * @throws IOException 
     */
public void write(JmeExporter ex) throws IOException {
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(playState, "playState", PlayState.Stopped);
    oc.write(speed, "speed", 1);
    oc.write(initialDuration, "initalDuration", 10);
    oc.write(loopMode, "loopMode", LoopMode.DontLoop);
}
Also used : OutputCapsule(com.jme3.export.OutputCapsule)

Example 2 with LoopMode

use of com.jme3.animation.LoopMode in project jmonkeyengine by jMonkeyEngine.

the class AbstractCinematicEvent method read.

/**
     * Used for serialization only.
     * @param im importer
     * @throws IOException 
     */
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    playState = ic.readEnum("playState", PlayState.class, PlayState.Stopped);
    speed = ic.readFloat("speed", 1);
    initialDuration = ic.readFloat("initalDuration", 10);
    loopMode = ic.readEnum("loopMode", LoopMode.class, LoopMode.DontLoop);
}
Also used : LoopMode(com.jme3.animation.LoopMode) InputCapsule(com.jme3.export.InputCapsule) PlayState(com.jme3.cinematic.PlayState)

Example 3 with LoopMode

use of com.jme3.animation.LoopMode in project jmonkeyengine by jMonkeyEngine.

the class SoundEvent method initEvent.

@Override
public void initEvent(Application app, Cinematic cinematic) {
    super.initEvent(app, cinematic);
    audioNode = new AudioNode(app.getAssetManager(), path, stream);
    audioNode.setPositional(false);
    setLoopMode(loopMode);
}
Also used : AudioNode(com.jme3.audio.AudioNode)

Example 4 with LoopMode

use of com.jme3.animation.LoopMode in project TeachingInSimulation by ScOrPiOzzy.

the class AnimUtil method simplePlay.

public static void simplePlay(@NotNull Spatial spatial, LoopMode mode, float speed) {
    getAnimControlSpatials(spatial).forEach(sp -> {
        AnimControl animControl = sp.getControl(AnimControl.class);
        AnimChannel animChannel;
        if (animControl.getNumChannels() == 0) {
            animChannel = animControl.createChannel();
        } else {
            animChannel = animControl.getChannel(0);
        }
        animControl.getAnimationNames().forEach(animName -> {
            animChannel.setAnim(animName);
            animChannel.setLoopMode(mode);
            animChannel.setSpeed(speed);
        });
    });
}
Also used : AnimChannel(com.jme3.animation.AnimChannel) AnimControl(com.jme3.animation.AnimControl)

Aggregations

AnimChannel (com.jme3.animation.AnimChannel)1 AnimControl (com.jme3.animation.AnimControl)1 LoopMode (com.jme3.animation.LoopMode)1 AudioNode (com.jme3.audio.AudioNode)1 PlayState (com.jme3.cinematic.PlayState)1 InputCapsule (com.jme3.export.InputCapsule)1 OutputCapsule (com.jme3.export.OutputCapsule)1