| 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 | |
![]() | 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_MATERIAL : Material
[static]
Default material for the DEFAULT_APPEARANCE object
| Shape3D | |
![]() | depth : Number
The depth of this object.
| Shape3D | |
![]() | depthSorter : IDepthSorter
Apply a new depth sorter to all the polygons.
| 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
Enable the interactivity on this shape and its polygon.
| 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 | |
![]() | invModelMatrix : Matrix4
This property will remains null until a material needs it, defining the SandyFlag INVERT_MODEL_MATRIX
In that case, that property will return the invert model matrix on that node
| Shape3D | |
| largeRadius : Number
Large radius.
| Torus | ||
![]() | matrix : Matrix4 | ATransformable | |
![]() | name : String
Name of this node.
| Node | |
| normals : Array
Array of 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
The number of vertical segments.
| Torus | ||
| segmentsW : Number
The number of horizontal segments.
| 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
Tilts this object around the local x axis.
| 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 | |
![]() | visible : Boolean = true
Specify the visibility of this node.
| Node | |
![]() | visiblePolygonsCount : uint | Shape3D | |
![]() | 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.
| 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 the torus.
| Torus | ||
![]() |
getChildByName(p_sName:String, p_bRecurs:Boolean = false):Node
Returns the child node with the specified name.
| 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 | |
![]() |
perform(p_iOperation:INodeOperation):void
Performs an operation on this node and all of its children.
| Node | |
![]() |
remove():void
Removes this node from the node tree, saving its child nodes.
| 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
Returns a string representation of this object
| Shape3D | |
![]() |
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 | |
| Constant | Defined by | ||
|---|---|---|---|
![]() | children : Array
The children of this node are stored inside this array.
| Node | |
| DEFAULT_LARGE_RADIUS : Number = 100 [static]
The default large radius for a sphere.
| Torus | ||
| DEFAULT_SCALE : Number = 1 [static]
The default scale for a torus texture.
| Torus | ||
| DEFAULT_SEGMENTSH : Number = 8 [static]
The default number of vertical segments for a torus.
| Torus | ||
| DEFAULT_SEGMENTSW : Number = 12 [static]
The default number of horizontal segments for a torus.
| Torus | ||
| DEFAULT_SMALL_RADIUS : Number = 50 [static]
The default small radius for a sphere.
| Torus | ||
![]() | id : uint
The unique id of this node in the node graph.
| Node | |
| MIN_SEGMENTSH : Number = 2 [static]
The minimum number of vertical segments for a torus.
| Torus | ||
| MIN_SEGMENTSW : Number = 3 [static]
The minimum number of horizontal segments for a torus.
| Torus | ||
![]() | modelMatrix : Matrix4
Cached matrix corresponding to the transformation to the 0,0,0 frame system
| Node | |
![]() | viewMatrix : Matrix4
Cached matrix corresponding to the transformation to the camera frame system
| Node | |
| largeRadius | property |
public var largeRadius:NumberLarge radius.
| normals | property |
public var normals:ArrayArray of vertex normals.
| segmentsH | property |
public var segmentsH:NumberThe number of vertical segments.
| segmentsW | property |
public var segmentsW:NumberThe number of horizontal segments.
| smallRadius | property |
public var smallRadius:NumberSmall radius.
| 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 torus is created at the origin of the world coordinate system, centered, with its axis along the y axis.
Parametersp_sName:String (default = null) — A string identifier for this object.
|
|
p_nLargeRadius:Number (default = 100) — Large radius of the torus.
|
|
p_nSmallRadius:Number (default = 50) — Small radius of the torus.
|
|
p_nSegmentsW:Number (default = 12) — Number of horizontal segments.
|
|
p_nSegmentsH:Number (default = 8) — Number of vertical segments.
|
| generate | () | method |
public function generate(... arguments):Geometry3DGenerates the geometry for the torus.
Parameters... arguments |
Geometry3D —
The geometry object for the torus.
|
See also
| DEFAULT_LARGE_RADIUS | constant |
public static const DEFAULT_LARGE_RADIUS:Number = 100The default large radius for a sphere.
| DEFAULT_SCALE | constant |
public static const DEFAULT_SCALE:Number = 1The default scale for a torus texture.
| DEFAULT_SEGMENTSH | constant |
public static const DEFAULT_SEGMENTSH:Number = 8The default number of vertical segments for a torus.
| DEFAULT_SEGMENTSW | constant |
public static const DEFAULT_SEGMENTSW:Number = 12The default number of horizontal segments for a torus.
| DEFAULT_SMALL_RADIUS | constant |
public static const DEFAULT_SMALL_RADIUS:Number = 50The default small radius for a sphere.
| MIN_SEGMENTSH | constant |
public static const MIN_SEGMENTSH:Number = 2The minimum number of vertical segments for a torus.
| MIN_SEGMENTSW | constant |
public static const MIN_SEGMENTSW:Number = 3The minimum number of horizontal segments for a torus.