| Package | sandy.primitive |
| Class | public class Cylinder |
| Inheritance | Cylinder Shape3D ATransformable Node |
| Implements | Primitive3D |
| Subclasses | Cone |
All credits go to Tim Knipt from suite75.net who created the AS2 implementation. Original sources available at : http://www.suite75.net/svn/papervision3d/tim/as2/org/papervision3d/objects/Cylinder.as
var cyl:Cylinder = new Cylinder( "theCylinder", 150, 300 );
var tCone:Cylinder = new Cylinder( "trunkCone", 150, 300, 0, 0, 40 );
| Property | Defined by | ||
|---|---|---|---|
![]() | aPolygons : Array
The array of polygons building this object.
| Shape3D | |
![]() | appearance : Appearance
The appearance of this object.
| Shape3D | |
![]() | boundingBox : BBox
The bounding box of this node
IMPORTANT: Do not modify it unless you perfectly know what you are doing
| Node | |
![]() | boundingSphere : BSphere
The bounding sphere of this node
IMPORTANT: Do not modify it unless you perfectly know what you are doing
| Node | |
![]() | broadcaster : BubbleEventBroadcaster
The broadcaster
The broadcaster is used to send events to listeners. | Node | |
![]() | changed : Boolean = false
This property set the cache status of the current node.
| Node | |
![]() | children : Array
The children of this node are stored inside this array.
| Node | |
![]() | container : Sprite
The contianer for this object.
| Shape3D | |
![]() | culled : CullingState
This property represent the culling state of the current node.
| Node | |
![]() | DEFAULT_APPEARANCE : Appearance
[static]
Default appearance for Shape3D instances.
| Shape3D | |
| DEFAULT_HEIGHT : Number = 100 [static]
Default height
| Cylinder | ||
![]() | DEFAULT_MATERIAL : Material
[static]
Default material for the DEFAULT_APPEARANCE object
| Shape3D | |
| DEFAULT_RADIUS : Number = 100 [static]
Default radius
| Cylinder | ||
| DEFAULT_SCALE : Number = 1 [static]
Default scale of Cylinder texture
| Cylinder | ||
| DEFAULT_SEGMENTSH : Number = 6 [static]
Default for number of segments vertically
| Cylinder | ||
| DEFAULT_SEGMENTSW : Number = 8 [static]
Default value for number of segments horizontally
| Cylinder | ||
![]() | depth : Number
The depth of this object.
| Shape3D | |
![]() | disable : Boolean = false
Disable the local transformations applied to this Node if set to false.
| ATransformable | |
![]() | enableBackFaceCulling : Boolean
Should back face culling be enabled for this object?.
| Shape3D | |
![]() | enableClipping : Boolean = false Enable the Frustum clipping on the visible polygons. | Shape3D | |
![]() | enableEvents : Boolean
Enables the event system for mouse events.
| Shape3D | |
![]() | enableForcedDepth : Boolean = false
Should forced depth be enable for this object?.
| Shape3D | |
![]() | enableInteractivity : Boolean | Shape3D | |
![]() | enableNearClipping : Boolean = false Enable the Frustum near plane clipping on the visible polygons. | Shape3D | |
![]() | forcedDepth : Number = 0
The forced depth for this object.
| Shape3D | |
![]() | geometry : Geometry3D
The geometry of this object.
| Shape3D | |
![]() | geometryCenter : Vector
This property call allows you to get the geometryCenter offset vector of the Shape.
| Shape3D | |
![]() | matrix : Matrix4 | ATransformable | |
| MIN_SEGMENTSH : Number = 2 [static]
Minimum value for number of segments hoizontally
| Cylinder | ||
| MIN_SEGMENTSW : Number = 3 [static]
Minimum value for number of segments horizontally
| Cylinder | ||
![]() | modelMatrix : Matrix4
Cached matrix corresponding to the transformation to the 0,0,0 frame system
| Node | |
![]() | name : String
Name of this node.
| Node | |
![]() | out : Vector
Forward direction ( local z ) in parent coordinates.
| ATransformable | |
![]() | pan : Number
Pans this object around the local y axis.
| ATransformable | |
![]() | parent : Node
The parent node of this node.
| Node | |
![]() | roll : Number
Rolls this object around the local z axis.
| ATransformable | |
![]() | rotateX : Number
Rotates this object around an axis parallel to the parents x axis.
| ATransformable | |
![]() | rotateY : Number
Rotates this object around an axis parallel to the parents y axis.
| ATransformable | |
![]() | rotateZ : Number
Rotates this object around an axis paralell to the parents z axis.
| ATransformable | |
![]() | scaleX : Number
x scale of this object.
| ATransformable | |
![]() | scaleY : Number
y scale of this object.
| ATransformable | |
![]() | scaleZ : Number
z scale of this object.
| ATransformable | |
![]() | scene : Scene3D = null
Reference to the scene is it linked to.
| Node | |
| segmentsH : Number
Number of segments vertically.
| Cylinder | ||
| segmentsW : Number
Number of segments horizontally.
| Cylinder | ||
![]() | side : Vector
Side direction ( local x ) in parent coordinates.
| ATransformable | |
![]() | target : Vector
The position in the parent frame this object should "look at".
| ATransformable | |
![]() | tilt : Number
Getter for the tilt value
| ATransformable | |
![]() | up : Vector
Up direction ( local y ) in parent coordinates.
| ATransformable | |
![]() | useSingleContainer : Boolean
setter that allow user to change the way to render this object.
| Shape3D | |
![]() | viewMatrix : Matrix4
Cached matrix corresponding to the transformation to the camera frame system
| Node | |
![]() | visible : Boolean = true
Specify the visibility of this node.
| Node | |
![]() | x : Number
x position of this object in its parent frame.
| ATransformable | |
![]() | y : Number
y position of this object in its parent frame.
| ATransformable | |
![]() | z : Number
z position of the node in its parent frame.
| ATransformable | |
| Method | Defined by | ||
|---|---|---|---|
|
Cylinder(p_sName:String = null, p_nRadius:Number = 100, p_nHeight:Number = 100, p_nSegmentsW:Number = 8, p_nSegmentsH:Number = 6, p_nTopRadius:Number, p_bExcludeBottom:Boolean = false, p_bExludeTop:Boolean = false, p_bWholeMapping:Boolean = true)
Creates a Cylinder primitive or truncated cone.
| Cylinder | ||
![]() |
Adds a new child to this node.
| Node | |
![]() |
addEventListener(p_sEvt:String, p_oL:*):void
Adds a listener for the specified event.
| Node | |
|
CALCUL_RADIUS_FROM_SIDE(p_nSideNumber:uint, p_nSideWidth:uint):Number
[static]
Calculates the radius depending on the number of sides you want and their width.
| Cylinder | ||
![]() |
clear():void
Clears the graphics object of this object's container.
| Shape3D | |
![]() |
This method returns a clone of this Shape3D.
| Shape3D | |
![]() |
Tests this node against the camera frustum to get its visibility.
| Shape3D | |
![]() |
destroy():void
Destroy this object and all its faces
container object is removed, and graphics cleared.
| Shape3D | |
![]() |
Performs a z-sorting and renders the objects visible polygons.
| Shape3D | |
|
generate(... arguments):Geometry3D
Generates the geometry for this Shape3D.
| Cylinder | ||
|
Returns an array of polygons defining the bottom of the cylinder.
| Cylinder | ||
![]() |
getChildByName(p_sName:String, p_bRecurs:Boolean = false):Node
Returns the child node with the specified name.
| Node | |
![]() |
getChildFromId(p_nId:uint, p_bRecurs:Boolean = false):Node
Returns the child node with the specified id.
| Node | |
![]() |
getChildList():Array
Returns an array with all child nodes of this node.
| Node | |
|
getFace(p_nFace:uint):PrimitiveFace
Returns an array of polygons defining the specified face
| Cylinder | ||
![]() |
getPosition(p_sMode:String = "local"):Vector
Returns the position of this group or object.
| ATransformable | |
|
Returns an array of polygons defining the top of the cylinder.
| Cylinder | ||
![]() |
hasParent():Boolean
Tests if this node has a parent.
| Node | |
![]() |
initFrame():void
Initiates the local coordinate system for this object.
| ATransformable | |
![]() |
Tests if the node passed in the argument is parent of this node.
| Node | |
![]() |
lookAt(p_nX:Number, p_nY:Number, p_nZ:Number):void
Makes this object "look at" the specified position in the parent frame.
| ATransformable | |
![]() |
moveForward(p_nD:Number):void
Translates this object along its forward vector ( local z ) in the parent frame.
| ATransformable | |
![]() |
moveHorizontally(p_nD:Number):void
Translates this object parallel to its parent zx plane and in its forward direction.
| ATransformable | |
![]() |
moveLateraly(p_nD:Number):void
Translates this object laterally in its parent frame.
| ATransformable | |
![]() |
moveSideways(p_nD:Number):void
Translates this object along its side vector ( local x ) in the parent frame.
| ATransformable | |
![]() |
moveUpwards(p_nD:Number):void
Translates this object along its up vector ( local y ) in the parent frame.
| ATransformable | |
![]() |
moveVertically(p_nD:Number):void
Translates this object vertically in ots parent frame.
| ATransformable | |
![]() |
remove():void
Removes this node from the node tree, saving its child nodes.
| Node | |
![]() |
removeChildById(p_nId:Number):Boolean
Removes the child node with the specified id.
| Node | |
![]() |
removeChildByName(p_sName:String):Boolean
Removes the child node with the specified name.
| Node | |
![]() |
removeEventListener(p_sEvt:String, p_oL:*):void
Removes a listener for the specified event.
| Node | |
![]() |
Renders this 3D object.
| Shape3D | |
![]() |
rotateAxis(p_nX:Number, p_nY:Number, p_nZ:Number, p_nAngle:Number):void
Rotate this object around the specified axis in the parent frame by the specified angle.
| ATransformable | |
![]() |
setPosition(p_nX:Number, p_nY:Number, p_nZ:Number):void
Sets the position of this object in coordinates of its parent frame.
| ATransformable | |
![]() |
swapCulling():void
Changes the backface culling side.
| Shape3D | |
![]() |
swapParent(p_oNewParent:Node):void
Moves this node to another parent node.
| Node | |
|
toString():String
| Cylinder | ||
![]() |
translate(p_nX:Number, p_nY:Number, p_nZ:Number):void
Translate this object from it's current position with the specified offsets.
| ATransformable | |
![]() |
Updates this node or object.
| ATransformable | |
![]() |
updateBoundingVolumes():void
Updates the bounding volumes of this object.
| Shape3D | |
![]() |
updateTransform():void
Updates the transform matrix of the current object/node before it is rendered.
| ATransformable | |
| DEFAULT_HEIGHT | property |
public static var DEFAULT_HEIGHT:Number = 100Default height
| DEFAULT_RADIUS | property |
public static var DEFAULT_RADIUS:Number = 100Default radius
| DEFAULT_SCALE | property |
public static var DEFAULT_SCALE:Number = 1Default scale of Cylinder texture
| DEFAULT_SEGMENTSH | property |
public static var DEFAULT_SEGMENTSH:Number = 6Default for number of segments vertically
| DEFAULT_SEGMENTSW | property |
public static var DEFAULT_SEGMENTSW:Number = 8Default value for number of segments horizontally
| MIN_SEGMENTSH | property |
public static var MIN_SEGMENTSH:Number = 2Minimum value for number of segments hoizontally
| MIN_SEGMENTSW | property |
public static var MIN_SEGMENTSW:Number = 3Minimum value for number of segments horizontally
| segmentsH | property |
public var segmentsH:NumberNumber of segments vertically. Defaults to 6.
| segmentsW | property |
public var segmentsW:NumberNumber of segments horizontally. Defaults to 8.
| Cylinder | () | constructor |
public function Cylinder(p_sName:String = null, p_nRadius:Number = 100, p_nHeight:Number = 100, p_nSegmentsW:Number = 8, p_nSegmentsH:Number = 6, p_nTopRadius:Number, p_bExcludeBottom:Boolean = false, p_bExludeTop:Boolean = false, p_bWholeMapping:Boolean = true)Creates a Cylinder primitive or truncated cone.
The cylinder is created at the origin of the world coordinate system, with its axis along the y axis, and with the bottom and top surfaces paralell to the zx plane
All arguments to the constructor have default values, and are optional. If you pass in a top radius, that is different from the bottom radius, a truncated cone is created.
By passing true values to one or both of p_bExcludeBottom and p_bExludeTop, you exclude the bottom and/or top surfaces from being created.
Parametersp_sName:String (default = null) — A String identifier of this object
|
|
p_nRadius:Number (default = 100) — Radius. Defaults to 100
|
|
p_nHeight:Number (default = 100) — Height. Defaults to 100
|
|
p_nSegmentsW:Number (default = 8) — Number of segments horizontally. Defaults to 8.
|
|
p_nSegmentsH:Number (default = 6) — Number of segments vertically. Defaults to 6.
|
|
p_nTopRadius:Number — An optional parameter for cone - or diverging cylinders
|
|
p_bExcludeBottom:Boolean (default = false) — Exclude the creation of the bottom surface. Defaults to false
|
|
p_bExludeTop:Boolean (default = false) — Exclude the creation of the top surface. Defaults to false
|
|
p_bWholeMapping:Boolean (default = true) — Specifies if the material applied to the cylinder will
map to the whole cylinder (true and default) or each face separately (false)
|
| CALCUL_RADIUS_FROM_SIDE | () | method |
public static function CALCUL_RADIUS_FROM_SIDE(p_nSideNumber:uint, p_nSideWidth:uint):NumberCalculates the radius depending on the number of sides you want and their width.
[ToDo: Elaborate on this a bit ]
Parametersp_nSideNumber:uint — The number of sides the cylinder has
|
|
p_nSideWidth:uint — Width of a side
|
Number — The radius
|
| generate | () | method |
public function generate(... arguments):Geometry3DGenerates the geometry for this Shape3D.
Parameters... arguments |
Geometry3D |
See also
| getBottom | () | method |
public function getBottom():PrimitiveFaceReturns an array of polygons defining the bottom of the cylinder.
ReturnsPrimitiveFace —
The bottom polygons
|
| getFace | () | method |
public function getFace(p_nFace:uint):PrimitiveFaceReturns an array of polygons defining the specified face
Parametersp_nFace:uint — The requested face
|
PrimitiveFace —
The arry of polygons
|
| getTop | () | method |
public function getTop():PrimitiveFaceReturns an array of polygons defining the top of the cylinder.
ReturnsPrimitiveFace —
The top polygons
|
| toString | () | method |
public override function toString():String
Returns
String |