@Override public void setSpeed(float speed) { super.setSpeed(speed); if (channel != null) { channel.setSpeed(speed); } }
public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { if (animName.equals("Dodge")){ channel.setAnim("stand", 0.50f); channel.setLoopMode(LoopMode.DontLoop); channel.setSpeed(1f); } }
@Override public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { if (animName.equals("Punches")) { channel.setAnim("Idle", 0.5f); channel.setLoopMode(LoopMode.DontLoop); channel.setSpeed(1f); } }
/** Use this listener to trigger something after an animation is done. */ public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { if (animName.equals("Walk")) { /** After "walk", reset to "stand". */ channel.setAnim("stand", 0.50f); channel.setLoopMode(LoopMode.DontLoop); channel.setSpeed(1f); } }
if (value) { animChannel.setAnim("SliceHorizontal"); animChannel.setSpeed(0.3f);
public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Attack") && value){ if (!channel.getAnimationName().equals("Dodge")){ channel.setAnim("Dodge", 0.50f); channel.setLoopMode(LoopMode.Cycle); channel.setSpeed(0.10f); } } }
@Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Attack") && value) { if (!channel.getAnimationName().equals("Punches")) { channel.setAnim("Punches", 0.5f); channel.setLoopMode(LoopMode.Cycle); channel.setSpeed(0.5f); } } } }
@Override public void onPlay() { channel.getControl().setEnabled(true); if (playState == PlayState.Stopped) { channel.setAnim(animationName, blendTime); channel.setSpeed(speed); channel.setLoopMode(loopMode); channel.setTime(0); } }
@Override public void setSpeed(float speed) { super.setSpeed(speed); if (channel != null) { channel.setSpeed(speed); } }
private static void setAnimSpeeds(Node node, float speed) { for (Spatial child : node.getChildren()) { AnimControl animControl = child.getControl(AnimControl.class); if (animControl != null) { animControl.getChannel(0).setSpeed(speed); } } }
public void onAction(String string, boolean bln, float f) { if (controlledAnimation != null) { AnimChannel channel = controlledAnimation.createChannel(); channel.setSpeed(0.001f); channel.setAnim("l_hip_rotateY"); controlledAnimation.setEnabled(!controlledAnimation.isEnabled()); } } }, "animate");
@Override public void onPlay() { channel.getControl().setEnabled(true); if (playState == PlayState.Stopped) { channel.setAnim(animationName, blendTime); channel.setSpeed(speed); channel.setLoopMode(loopMode); channel.setTime(0); } }
@Override public void visit(Spatial spatial) { AnimControl animControl = spatial.getControl(AnimControl.class); if (animControl != null) { AnimChannel channel = animControl.createChannel(); channel.setAnim("anim"); channel.setLoopMode(LoopMode.Loop); if (randomizeAnimation) { channel.setSpeed(FastMath.nextRandomInt(6, 10) / 10f); channel.setTime(FastMath.nextRandomFloat() * channel.getAnimMaxTime()); } // Don't batch animated objects, seems not to work object.setBatchHint(Spatial.BatchHint.Never); } } });
chan.setSpeed(a.getSpeed());
channel.setAnim("test animation"); channel.setLoopMode(LoopMode.Loop); channel.setSpeed(0.5f);