Class BaseAnimationController
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.utils.BaseAnimationController
-
- Direct Known Subclasses:
AnimationController
public class BaseAnimationController extends java.lang.Object
Base class for applying one or moreAnimation
s to aModelInstance
. This class only applies the actualNode
transformations, it does not manage animations or keep track of animation states. SeeAnimationController
for an implementation of this class which does manage animations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseAnimationController.Transform
-
Field Summary
Fields Modifier and Type Field Description ModelInstance
target
TheModelInstance
on which the animations are being performed.
-
Constructor Summary
Constructors Constructor Description BaseAnimationController(ModelInstance target)
Construct a new BaseAnimationController.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
apply(Animation animation, float time, float weight)
protected void
applyAnimation(Animation animation, float time)
Apply a single animation to theModelInstance
and update the it to reflect the changes.protected static void
applyAnimation(ObjectMap<Node,BaseAnimationController.Transform> out, Pool<BaseAnimationController.Transform> pool, float alpha, Animation animation, float time)
Helper method to apply one animation to either an objectmap for blending or directly to the bones.protected void
applyAnimations(Animation anim1, float time1, Animation anim2, float time2, float weight)
Apply two animations, blending the second onto to first using weight.protected void
begin()
Begin applying multiple animations to the instance, must followed by one or more calls to {apply(Animation, float, float)
and finally {end()
.protected void
end()
End applying multiple animations to the instance and update it to reflect the changes.protected void
removeAnimation(Animation animation)
Remove the specified animation, by marking the affected nodes as not animated.
-
-
-
Field Detail
-
target
public final ModelInstance target
TheModelInstance
on which the animations are being performed.
-
-
Constructor Detail
-
BaseAnimationController
public BaseAnimationController(ModelInstance target)
Construct a new BaseAnimationController.- Parameters:
target
- TheModelInstance
on which the animations are being performed.
-
-
Method Detail
-
begin
protected void begin()
Begin applying multiple animations to the instance, must followed by one or more calls to {apply(Animation, float, float)
and finally {end()
.
-
apply
protected void apply(Animation animation, float time, float weight)
- Parameters:
weight
- The blend weight of this animation relative to the previous applied animations.
-
end
protected void end()
End applying multiple animations to the instance and update it to reflect the changes.
-
applyAnimation
protected void applyAnimation(Animation animation, float time)
Apply a single animation to theModelInstance
and update the it to reflect the changes.
-
applyAnimations
protected void applyAnimations(Animation anim1, float time1, Animation anim2, float time2, float weight)
Apply two animations, blending the second onto to first using weight.
-
applyAnimation
protected static void applyAnimation(ObjectMap<Node,BaseAnimationController.Transform> out, Pool<BaseAnimationController.Transform> pool, float alpha, Animation animation, float time)
Helper method to apply one animation to either an objectmap for blending or directly to the bones.
-
removeAnimation
protected void removeAnimation(Animation animation)
Remove the specified animation, by marking the affected nodes as not animated. When switching animation, this should be call prior to applyAnimation(s).
-
-