| Package | sandy.primitive |
| Class | public class Box |
| Inheritance | Box Shape3D ATransformable Node |
| Implements | Primitive3D |
var myBox:Box = new Box( "theBox", 50, 100, 150, PrimitiveMode.TRI, 2 );
| Method | Defined by | ||
|---|---|---|---|
|
Box(p_sName:String = null, p_nWidth:Number = 6, p_nHeight:Number = 6, p_nDepth:Number = 6, p_sMode:String = "tri", p_nQuality:Number = 1)
Creates a Box primitive.
| Box | ||
![]() |
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 object for the box.
| Box | ||
![]() |
getChildByName(p_sName:String, p_bRecurs:Boolean = false):Node
Returns the child node with the specified name.
| Node | |
|
getFace(p_nFace:uint):PrimitiveFace
Returns a PrimitiveFace object ( an array of polygons ) defining the specified face.
| Box | ||
![]() |
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 | |
| FACE_BACK : uint = 0 [static]
The index of the back face of the box.
| Box | ||
| FACE_BOTTOM : uint = 2 [static]
The index of the bottom face of the box.
| Box | ||
| FACE_FRONT : uint = 1 [static]
The index of the front face of the box.
| Box | ||
| FACE_LEFT : uint = 4 [static]
The index of the left face of the box.
| Box | ||
| FACE_RIGHT : uint = 5 [static]
The index of the right face of the box.
| Box | ||
| FACE_TOP : uint = 3 [static]
The index of the top face of the box.
| Box | ||
![]() | id : uint
The unique id of this node in the node graph.
| Node | |
![]() | 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 | |
| Box | () | constructor |
public function Box(p_sName:String = null, p_nWidth:Number = 6, p_nHeight:Number = 6, p_nDepth:Number = 6, p_sMode:String = "tri", p_nQuality:Number = 1)Creates a Box primitive.
The Box is created centered at the origin of the world coordinate system, and with its edges parallel to world coordinate axes.
Parametersp_sName:String (default = null) — A string identifier for this object.
|
|
p_nWidth:Number (default = 6) — Width of the box (along the x-axis).
|
|
p_nHeight:Number (default = 6) — Height of the box (along the y-axis).
|
|
p_nDepth:Number (default = 6) — Depth of the box (along the z-axis).
|
|
p_sMode:String (default = "tri") — The generation mode. "tri" generates faces with 3 vertices, and "quad" generates faces with 4 vertices.
|
|
p_nQuality:Number (default = 1) |
See also
| generate | () | method |
public function generate(... arguments):Geometry3DGenerates the geometry object for the box.
Parameters... arguments |
Geometry3D —
The geometry object for the box.
|
See also
| getFace | () | method |
public function getFace(p_nFace:uint):PrimitiveFaceReturns a PrimitiveFace object ( an array of polygons ) defining the specified face.
Parametersp_nFace:uint — The requested face
|
PrimitiveFace —
The PrimitiveFace object of the specified face.
|
See also
| FACE_BACK | constant |
public static const FACE_BACK:uint = 0The index of the back face of the box.
| FACE_BOTTOM | constant |
public static const FACE_BOTTOM:uint = 2The index of the bottom face of the box.
| FACE_FRONT | constant |
public static const FACE_FRONT:uint = 1The index of the front face of the box.
| FACE_LEFT | constant |
public static const FACE_LEFT:uint = 4The index of the left face of the box.
| FACE_RIGHT | constant |
public static const FACE_RIGHT:uint = 5The index of the right face of the box.
| FACE_TOP | constant |
public static const FACE_TOP:uint = 3The index of the top face of the box.