/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

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