/src/away3d/primitives/Cone.as
ActionScript | 37 lines | 18 code | 4 blank | 15 comment | 0 complexity | 3f4ecc9b69af28675049d8e7ade7d867 MD5 | raw file
1package away3d.primitives { 2 import away3d.materials.MaterialBase; 3 4 /** 5 * A UV Cone primitive mesh. 6 */ 7 public class Cone extends Cylinder { 8 9 /** 10 * The radius of the bottom end of the cone. 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 * Creates a new Cone object. 25 * @param material The material with which to render the cone. 26 * @param radius The radius of the bottom end of the cone 27 * @param height The height of the cone 28 * @param segmentsW Defines the number of horizontal segments that make up the cone. Defaults to 16. 29 * @param segmentsH Defines the number of vertical segments that make up the cone. Defaults to 1. 30 * @param yUp Defines whether the cone poles should lay on the Y-axis (true) or on the Z-axis (false). 31 */ 32 public function Cone(material : MaterialBase = null, radius : Number = 50, height : Number = 100, segmentsW : uint = 16, segmentsH : uint = 1, closed:Boolean = true, yUp : Boolean = true) 33 { 34 super(material, 0, radius, height, segmentsW, segmentsH, false, closed, yUp); 35 } 36 } 37}