PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/away3d/primitives/RegularPolygon.as

http://github.com/away3d/away3d-core-fp11
ActionScript | 61 lines | 33 code | 9 blank | 19 comment | 0 complexity | 5d2a88852b60d9e95db65a30ca88bf99 MD5 | raw file
 1package away3d.primitives {
 2	import away3d.materials.MaterialBase;
 3
 4	/**
 5	 * A UV RegularPolygon primitive mesh.
 6	 */
 7	public class RegularPolygon extends Cylinder {
 8
 9		/**
10		 * The radius of the regular polygon.
11		 */
12		public function get radius() : Number
13		{
14			return _bottomRadius;
15		}
16		
17		public function set radius(value : Number) : void
18		{
19			_bottomRadius = value;
20			invalidateGeometry();
21		}
22
23
24		/**
25		 * The number of sides of the regular polygon.
26		 */
27		public function get sides() : uint
28		{
29			return _segmentsW;
30		}
31		
32		public function set sides(value : uint) : void
33		{
34			segmentsW = value;
35		}
36		
37		/**
38		 * The number of subdivisions from the edge to the center of the regular polygon.
39		 */
40		public function get subdivisions() : uint
41		{
42			return _segmentsH;
43		}
44		
45		public function set subdivisions(value : uint) : void
46		{
47			segmentsH = value;
48		}
49		
50		/**
51		 * Creates a new RegularPolygon disc object.
52		 * @param material The material with which to render the regular polygon.
53		 * @param radius The radius of the regular polygon
54		 * @param sides Defines the number of sides of the regular polygon. Defaults to 16.
55		 * @param yUp Defines whether the regular polygon should lay on the Y-axis (true) or on the Z-axis (false).
56		 */
57		public function RegularPolygon(material : MaterialBase = null, radius : Number = 100, sides : uint = 16, yUp : Boolean = true) {
58			super(material, radius, 0, 0, sides, 1, true, false, false, yUp);
59		}
60	}
61}