com.threerings.opengl.model.config
Class AnimationConfig.Imported

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.opengl.model.config.AnimationConfig.Implementation
          extended by com.threerings.opengl.model.config.AnimationConfig.Original
              extended by com.threerings.opengl.model.config.AnimationConfig.Imported
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Enclosing class:
AnimationConfig

public static class AnimationConfig.Imported
extends AnimationConfig.Original

A frame-based animation imported from an export file.


Field Summary
 AnimationConfig.FrameAction[] actions
          Actions to perform at specific times within the animation.
 boolean loop
          Whether or not the animation loops.
 FloatVariable offset
          A (possibly random) offset to apply when the animation starts.
 float rate
          The base animation frame rate.
 float scale
          The global animation scale.
 boolean skipLastFrame
          Whether or not to skip the last frame when looping (because it's the same as the first).
 float speed
          The speed of the animation.
 String[] targets
          The targets of the animation.
 Transform3D[][] transforms
          The transforms for each target, each frame.
 float transition
          The interval over which to transition into the first frame.
 
Fields inherited from class com.threerings.opengl.model.config.AnimationConfig.Original
blendIn, blendOut, override, priority, weight
 
Constructor Summary
AnimationConfig.Imported()
           
 
Method Summary
 Animation.Implementation getAnimationImplementation(GlContext ctx, Scope scope, Animation.Implementation impl)
          Creates or updates an animation implementation for this configuration.
 float getDuration()
          Returns the duration of the animation (assuming it doesn't loop).
 float getScaledRate()
          Returns the frame rate as scaled by the speed.
 String getSource()
          Returns the source resource.
 void setDuration(float duration)
          Included in order to make duration appear as an editable property.
 void setSource(String source)
          Sets the source file from which to load the animation data.
 void updateFromSource(EditorContext ctx, boolean force)
          Updates this implementation from its external source, if any.
 
Methods inherited from class com.threerings.opengl.model.config.AnimationConfig.Implementation
getUpdateReferences, invalidate
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

transition

@Editable(min=0.0,
          step=0.01,
          hgroup="t")
public float transition
The interval over which to transition into the first frame.


speed

@Editable(min=0.0,
          step=0.01,
          hgroup="t")
public float speed
The speed of the animation.


scale

@Editable(min=0.0,
          step=0.01,
          hgroup="t")
public float scale
The global animation scale.


loop

@Editable(hgroup="l")
public boolean loop
Whether or not the animation loops.


skipLastFrame

@Editable(hgroup="l")
public boolean skipLastFrame
Whether or not to skip the last frame when looping (because it's the same as the first).


offset

@Editable(min=0.0,
          step=0.01,
          weight=2.0)
public FloatVariable offset
A (possibly random) offset to apply when the animation starts.


actions

@Editable(weight=2.0)
public AnimationConfig.FrameAction[] actions
Actions to perform at specific times within the animation.


rate

public float rate
The base animation frame rate.


targets

@Shallow
public String[] targets
The targets of the animation.


transforms

@Shallow
public Transform3D[][] transforms
The transforms for each target, each frame.

Constructor Detail

AnimationConfig.Imported

public AnimationConfig.Imported()
Method Detail

setSource

@Editable(editor="resource",
          weight=-1.0,
          nullable=true)
@FileConstraints(description="m.exported_anims",
                 extensions=".mxml",
                 directory="exported_anim_dir")
public void setSource(String source)
Sets the source file from which to load the animation data.


getSource

@Editable
public String getSource()
Returns the source resource.


setDuration

@Editable(step=0.01,
          hgroup="l",
          weight=1.0,
          depends={"transition","source","speed","duration"})
public void setDuration(float duration)
Included in order to make duration appear as an editable property.


getDuration

@Editable
public float getDuration()
Returns the duration of the animation (assuming it doesn't loop).


getScaledRate

public float getScaledRate()
Returns the frame rate as scaled by the speed.


updateFromSource

public void updateFromSource(EditorContext ctx,
                             boolean force)
Description copied from class: AnimationConfig.Implementation
Updates this implementation from its external source, if any.

Overrides:
updateFromSource in class AnimationConfig.Implementation
force - if true, reload the source data even if it has already been loaded.

getAnimationImplementation

public Animation.Implementation getAnimationImplementation(GlContext ctx,
                                                           Scope scope,
                                                           Animation.Implementation impl)
Description copied from class: AnimationConfig.Implementation
Creates or updates an animation implementation for this configuration.

Specified by:
getAnimationImplementation in class AnimationConfig.Implementation
scope - the animation's expression scope.
impl - an existing implementation to reuse, if possible.
Returns:
either a reference to the existing implementation (if reused), a new implementation, or null if no implementation could be created.


Copyright © 2011. All Rights Reserved.