PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/away3d/animators/data/NullAnimation.as

http://github.com/away3d/away3d-core-fp11
ActionScript | 47 lines | 27 code | 6 blank | 14 comment | 1 complexity | a16f8ae8ec77d622449f793282cca458 MD5 | raw file
 1package away3d.animators.data
 2{
 3	import away3d.arcane;
 4	import away3d.materials.passes.MaterialPassBase;
 5
 6	use namespace arcane;
 7
 8	/**
 9	 * The NullAnimation class provides a null object to indicate no animation is performed. This is usually set as default.
10	 */
11	public class NullAnimation extends AnimationBase
12	{
13		/**
14		 * @inheritDoc
15		 */
16		override arcane function getAGALVertexCode(pass : MaterialPassBase) : String
17		{
18			var attributes : Array = pass.getAnimationSourceRegisters();
19			var targets : Array = pass.getAnimationTargetRegisters();
20			var len : uint = attributes.length;
21			var code : String = "";
22
23			// simply write attributes to targets, do not animate them
24			// projection will pick up on targets[0] to do the projection
25			for (var i : uint = 0; i < len; ++i)
26				code += "mov " + targets[i] + ", " + attributes[i] + "\n";
27
28			return code;
29		}
30
31		/**
32		 * @inheritDoc
33		 */
34		override arcane function createAnimationState() : AnimationStateBase
35		{
36			return null;
37		}
38
39		/**
40		 * @inheritDoc
41		 */
42		override arcane function equals(animation : AnimationBase) : Boolean
43		{
44			return animation is NullAnimation;
45		}
46	}
47}