PageRenderTime 627ms CodeModel.GetById 218ms app.highlight 103ms RepoModel.GetById 185ms app.codeStats 1ms

/src/away3d/animators/skeleton/SkeletonTreeNode.as

http://github.com/away3d/away3d-core-fp11
ActionScript | 79 lines | 47 code | 11 blank | 21 comment | 0 complexity | c045b014c9bf7a3d704f612d4f2ef837 MD5 | raw file
 1/**
 2 * Author: David Lenaerts
 3 */
 4package away3d.animators.skeleton
 5{
 6	import away3d.errors.AbstractMethodError;
 7
 8	import flash.geom.Vector3D;
 9
10	/**
11	 * SkeletonTreeNode provides an abstract base class for nodes in a skeleton blend tree.
12	 */
13	public class SkeletonTreeNode
14	{
15		protected var _time : Number = 0;
16		protected var _direction : Number = 0;
17		protected var _duration : Number = 0;
18		public var name : String;
19		public var skeletonPose : SkeletonPose;
20
21		public var rootDelta : Vector3D;
22
23		/**
24		 * Creates a new SkeletonTreeNode object.
25		 * @param numJoints The amount of joint in the target skeleton.
26		 */
27		public function SkeletonTreeNode()
28		{
29			rootDelta = new Vector3D();
30			skeletonPose = new SkeletonPose();
31		}
32
33		/**
34		 * The time ratio between 0 and 1.
35		 */
36		public function get time() : Number
37		{
38			return _time;
39		}
40
41		public function set time(value : Number) : void
42		{
43			_time = value;
44		}
45
46		public function get direction() : Number
47		{
48			return _direction;
49		}
50
51		public function set direction(value : Number) : void
52		{
53			_direction = value;
54		}
55
56		public function get duration() : Number
57		{
58			return _duration;
59		}
60
61		/**
62		 * Updates the node's skeleton pose
63		 */
64		public function updatePose(skeleton : Skeleton) : void
65		{
66			throw new AbstractMethodError();
67		}
68
69		/**
70		 * Updates the s root delta position and bounds
71		 *
72		 * todo: support bounds
73		 */
74		public function updatePositionData() : void
75		{
76			throw new AbstractMethodError();
77		}
78	}
79}