/src/away3d/primitives/Cone.as

http://github.com/away3d/away3d-core-fp11 · ActionScript · 37 lines · 18 code · 4 blank · 15 comment · 0 complexity · 3f4ecc9b69af28675049d8e7ade7d867 MD5 · raw file

  1. package away3d.primitives {
  2. import away3d.materials.MaterialBase;
  3. /**
  4. * A UV Cone primitive mesh.
  5. */
  6. public class Cone extends Cylinder {
  7. /**
  8. * The radius of the bottom end of the cone.
  9. */
  10. public function get radius() : Number
  11. {
  12. return _bottomRadius;
  13. }
  14. public function set radius(value : Number) : void
  15. {
  16. _bottomRadius = value;
  17. invalidateGeometry();
  18. }
  19. /**
  20. * Creates a new Cone object.
  21. * @param material The material with which to render the cone.
  22. * @param radius The radius of the bottom end of the cone
  23. * @param height The height of the cone
  24. * @param segmentsW Defines the number of horizontal segments that make up the cone. Defaults to 16.
  25. * @param segmentsH Defines the number of vertical segments that make up the cone. Defaults to 1.
  26. * @param yUp Defines whether the cone poles should lay on the Y-axis (true) or on the Z-axis (false).
  27. */
  28. public function Cone(material : MaterialBase = null, radius : Number = 50, height : Number = 100, segmentsW : uint = 16, segmentsH : uint = 1, closed:Boolean = true, yUp : Boolean = true)
  29. {
  30. super(material, 0, radius, height, segmentsW, segmentsH, false, closed, yUp);
  31. }
  32. }
  33. }