| Package | sandy.primitive |
| Class | public class Torus |
| Inheritance | Torus Shape3D ATransformable Node |
| Implements | Primitive3D |
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/Torus.as
var torus:Torus = new Torus( "theTorus", 250, 80 );
| 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_LARGE_RADIUS : Number = 100 [static]
Default large radius of Torus
| Torus | ||
![]() | DEFAULT_MATERIAL : Material
[static]
Default material for the DEFAULT_APPEARANCE object
| Shape3D | |
| DEFAULT_SCALE : Number = 1 [static]
Default scale of Torus texture
| Torus | ||
| DEFAULT_SEGMENTSH : Number = 8 [static]
Default value for number of segments vertically
| Torus | ||
| DEFAULT_SEGMENTSW : Number = 12 [static]
Default value for number of segments horizontally
| Torus | ||
| DEFAULT_SMALL_RADIUS : Number = 50 [static]
Default small radius of Torus
| Torus | ||
![]() | 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 | |
| largeRadius : Number
Large radius.
| Torus | ||
![]() | matrix : Matrix4 | ATransformable | |
| MIN_SEGMENTSH : Number = 2 [static]
Minimum value for number of segments vertically
| Torus | ||
| MIN_SEGMENTSW : Number = 3 [static]
Minimum value for number of segments horizontally
| Torus | ||
![]() | modelMatrix : Matrix4
Cached matrix corresponding to the transformation to the 0,0,0 frame system
| Node | |
![]() | name : String
Name of this node.
| Node | |
| normals : Array
vertex normals
| Torus | ||
![]() | 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.
| Torus | ||
| segmentsW : Number
Number of segments horizontally.
| Torus | ||
![]() | side : Vector
Side direction ( local x ) in parent coordinates.
| ATransformable | |
| smallRadius : Number
Small radius.
| Torus | ||
![]() | 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 | ||
|---|---|---|---|
|
Torus(p_sName:String = null, p_nLargeRadius:Number = 100, p_nSmallRadius:Number = 50, p_nSegmentsW:Number = 12, p_nSegmentsH:Number = 8)
Creates a Torus primitive ( a donut )
The Torus is created centered at the origin of the world coordinate system, with its axis along the y axis. | Torus | ||
![]() |
Adds a new child to this node.
| Node | |
![]() |
addEventListener(p_sEvt:String, p_oL:*):void
Adds a listener for the specified event.
| Node | |
![]() |
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
| Torus | ||
![]() |
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 | |
![]() |
getPosition(p_sMode:String = "local"):Vector
Returns the position of this group or object.
| ATransformable | |
![]() |
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
| Torus | ||
![]() |
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_LARGE_RADIUS | property |
public static var DEFAULT_LARGE_RADIUS:Number = 100Default large radius of Torus
| DEFAULT_SCALE | property |
public static var DEFAULT_SCALE:Number = 1Default scale of Torus texture
| DEFAULT_SEGMENTSH | property |
public static var DEFAULT_SEGMENTSH:Number = 8Default value for number of segments vertically
| DEFAULT_SEGMENTSW | property |
public static var DEFAULT_SEGMENTSW:Number = 12Default value for number of segments horizontally
| DEFAULT_SMALL_RADIUS | property |
public static var DEFAULT_SMALL_RADIUS:Number = 50Default small radius of Torus
| largeRadius | property |
public var largeRadius:NumberLarge radius. Defaults to 100
| MIN_SEGMENTSH | property |
public static var MIN_SEGMENTSH:Number = 2Minimum value for number of segments vertically
| MIN_SEGMENTSW | property |
public static var MIN_SEGMENTSW:Number = 3Minimum value for number of segments horizontally
| normals | property |
public var normals:Arrayvertex normals
| segmentsH | property |
public var segmentsH:NumberNumber of segments vertically. Defaults to 8.
| segmentsW | property |
public var segmentsW:NumberNumber of segments horizontally. Defaults to 12.
| smallRadius | property |
public var smallRadius:NumberSmall radius. Defaults to 50
| Torus | () | constructor |
public function Torus(p_sName:String = null, p_nLargeRadius:Number = 100, p_nSmallRadius:Number = 50, p_nSegmentsW:Number = 12, p_nSegmentsH:Number = 8)Creates a Torus primitive ( a donut )
The Torus is created centered at the origin of the world coordinate system, with its axis along the y axis.
All arguments to the constructor have default values.
Parametersp_sName:String (default = null) — A String identifier of this object
|
|
p_nLargeRadius:Number (default = 100) — [optional] - Large radius ( center circle ). Defaults to 100
|
|
p_nSmallRadius:Number (default = 50) — [optional] - Small radius ( generating circle ). Defaults to 50
|
|
p_nSegmentsW:Number (default = 12) — [optional] - Number of segments horizontally. Defaults to 8.
|
|
p_nSegmentsH:Number (default = 8) — [optional] - Number of segments vertically. Defaults to 6.
|
| generate | () | method |
public function generate(... arguments):Geometry3DGenerates the geometry for this Shape3D
Parameters... arguments |
Geometry3D |
See also
| toString | () | method |
public override function toString():String
Returns
String |