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);
}
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);
}
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);
}
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);
});
});
}
Aggregations