/** * @return The length of the currently playing animation, or zero * if no animation is playing. * * @see AnimChannel#getTime() */ public float getAnimMaxTime(){ return animation != null ? animation.getLength() : 0f; }
/** * @param speed Set the speed of the animation channel. The speed * is a scale value starting from 0.0, at 1.0 the animation will play * at its default speed. */ public void setSpeed(float speed) { this.speed = speed; if(blendTime>0){ this.speedBlendFrom = speed; blendTime = Math.min(blendTime, animation.getLength() / speed); blendRate = 1/ blendTime; } }
/** * Returns the length of the given named animation. * @param name The name of the animation * @return The length of time, in seconds, of the named animation. */ public float getAnimationLength(String name) { Animation a = animationMap.get(name); if (a == null) { throw new IllegalArgumentException("The animation " + name + " does not exist in this AnimControl"); } return a.getLength(); }
this.blendTime = blendTime; blendTime = Math.min(blendTime, anim.getLength() / speed); blendFrom = animation; timeBlendFrom = time;
/** * @return The length of the currently playing animation, or zero * if no animation is playing. * * @see AnimChannel#getTime() */ public float getAnimMaxTime(){ return animation != null ? animation.getLength() : 0f; }
/** * @return The length of the currently playing animation, or zero * if no animation is playing. * * @see AnimChannel#getTime() */ public float getAnimMaxTime(){ return animation != null ? animation.getLength() : 0f; }
/** * @param speed Set the speed of the animation channel. The speed * is a scale value starting from 0.0, at 1.0 the animation will play * at its default speed. */ public void setSpeed(float speed) { this.speed = speed; if(blendTime>0){ this.speedBlendFrom = speed; blendTime = Math.min(blendTime, animation.getLength() / speed); blendRate = 1/ blendTime; } }
/** * Returns the length of the given named animation. * @param name The name of the animation * @return The length of time, in seconds, of the named animation. */ public float getAnimationLength(String name) { Animation a = animationMap.get(name); if (a == null) { throw new IllegalArgumentException("The animation " + name + " does not exist in this AnimControl"); } return a.getLength(); }
/** * Returns the length of the given named animation. * @param name The name of the animation * @return The length of time, in seconds, of the named animation. */ public float getAnimationLength(String name) { Animation a = animationMap.get(name); if (a == null) { throw new IllegalArgumentException("The animation " + name + " does not exist in this AnimControl"); } return a.getLength(); }
this.blendTime = blendTime; blendTime = Math.min(blendTime, anim.getLength() / speed); blendFrom = animation; timeBlendFrom = time;