PageRenderTime 364ms CodeModel.GetById 181ms app.highlight 3ms RepoModel.GetById 178ms app.codeStats 0ms

/src/away3d/core/base/data/UV.as

http://github.com/away3d/away3d-core-fp11
ActionScript | 67 lines | 37 code | 9 blank | 21 comment | 0 complexity | b270c2b125431a139673871ae4f6c361 MD5 | raw file
 1package away3d.core.base.data
 2{
 3	
 4	/**
 5	 * Texture coordinates value object.
 6	 */
 7	public class UV
 8	{
 9		private var _u:Number;
10		private var _v:Number;
11		
12		/**
13		 * Creates a new <code>UV</code> object.
14		 *
15		 * @param    u        [optional]    The horizontal coordinate of the texture value. Defaults to 0.
16		 * @param    v        [optional]    The vertical coordinate of the texture value. Defaults to 0.
17		 */
18		public function UV(u:Number = 0, v:Number = 0)
19		{
20			_u = u;
21			_v = v;
22		}
23		
24		/**
25		 * Defines the vertical coordinate of the texture value.
26		 */
27		public function get v():Number
28		{
29			return _v;
30		}
31		
32		public function set v(value:Number):void
33		{
34			_v = value;
35		}
36		
37		/**
38		 * Defines the horizontal coordinate of the texture value.
39		 */
40		public function get u():Number
41		{
42			return _u;
43		}
44		
45		public function set u(value:Number):void
46		{
47			_u = value;
48		}
49		
50		/**
51		 * returns a new UV value Object
52		 */
53		public function clone():UV
54		{
55			return new UV(_u, _v);
56		}
57		
58		/**
59		 * returns the value object as a string for trace/debug purpose
60		 */
61		public function toString():String
62		{
63			return _u + "," + _v;
64		}
65	
66	}
67}