| Package | sandy.core.scenegraph |
| Class | public class Node |
| Subclasses | ATransformable, Group |
The base class for all Group and object nodes, that handles all basic operations on a tree node.
| Property | Defined by | ||
|---|---|---|---|
| appearance : Appearance
[write-only]
Set that appearance to all the children of that node
| Node | ||
| 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
[read-only]
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 | ||
| culled : CullingState
This property represent the culling state of the current node.
| Node | ||
| enableBackFaceCulling : Boolean [write-only]
Change the backface culling state to all the shapes objects in the children list
| Node | ||
| enableEvents : Boolean [write-only]
Enable event handling to all the children objects that can broadcast bubbling events
| Node | ||
| enableInteractivity : Boolean [write-only]
Change the interactivity of all the children
| Node | ||
| name : String
Name of this node.
| Node | ||
| parent : Node
The parent node of this node.
| Node | ||
| scene : Scene3D = null
Reference to the scene is it linked to.
| Node | ||
| useSingleContainer : Boolean [write-only]
Make all the Shape3D and descendants children react to this value.
| Node | ||
| visible : Boolean = true
Specify the visibility of this node.
| Node | ||
| Property | Defined by | ||
|---|---|---|---|
| m_oEB : BubbleEventBroadcaster | Node | ||
| Method | Defined by | ||
|---|---|---|---|
|
Node(p_sName:String = "")
Creates a node in the object tree of the world.
| Node | ||
|
Adds a new child to this node.
| Node | ||
|
addEventListener(p_sEvt:String, p_oL:*):void
Adds a listener for the specified event.
| Node | ||
|
Tests this node against the frustum volume to get its visibility.
| Node | ||
|
destroy():void
Delete this node and all its child nodes.
| Node | ||
|
getChildByName(p_sName:String, p_bRecurs:Boolean = false):Node
Returns the child node with the specified name.
| Node | ||
|
hasParent():Boolean
Tests if this node has a parent.
| Node | ||
|
Tests if the node passed in the argument is parent of this node.
| Node | ||
|
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 node.
| Node | ||
|
swapParent(p_oNewParent:Node):void
Moves this node to another parent node.
| Node | ||
|
toString():String
Returns a string representation of this object
| Node | ||
|
Updates this node.
| Node | ||
| Constant | Defined by | ||
|---|---|---|---|
| children : Array
The children of this node are stored inside this array.
| Node | ||
| 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 | ||
| appearance | property |
appearance:Appearance [write-only]Set that appearance to all the children of that node
Implementation public function set appearance(value:Appearance):void
| boundingBox | property |
public var boundingBox:BBoxThe bounding box of this node IMPORTANT: Do not modify it unless you perfectly know what you are doing
| boundingSphere | property |
public var boundingSphere:BSphereThe bounding sphere of this node IMPORTANT: Do not modify it unless you perfectly know what you are doing
| broadcaster | property |
broadcaster:BubbleEventBroadcaster [read-only]The broadcaster
The broadcaster is used to send events to listeners.
This property is a BubbleEventBroadcaster.
public function get broadcaster():BubbleEventBroadcaster
| changed | property |
public var changed:Boolean = falseThis property set the cache status of the current node. IMPORTANT Currently this property isn't used!
| culled | property |
public var culled:CullingStateThis property represent the culling state of the current node. This state is defined during the culling phasis as it refers to the position of the object against the viewing frustum.
| enableBackFaceCulling | property |
enableBackFaceCulling:Boolean [write-only]Change the backface culling state to all the shapes objects in the children list
Implementation public function set enableBackFaceCulling(value:Boolean):void
| enableEvents | property |
enableEvents:Boolean [write-only]Enable event handling to all the children objects that can broadcast bubbling events
Implementation public function set enableEvents(value:Boolean):void
| enableInteractivity | property |
enableInteractivity:Boolean [write-only]Change the interactivity of all the children
Implementation public function set enableInteractivity(value:Boolean):void
| m_oEB | property |
protected var m_oEB:BubbleEventBroadcaster
| name | property |
public var name:StringName of this node. Of no name is specified, the unique ID of the node will be used
| parent | property |
parent:Node [read-write]The parent node of this node.
The reference is null if this nod has no parent (for exemple for a root node).
Implementation public function get parent():Node
public function set parent(value:Node):void
| scene | property |
public var scene:Scene3D = nullReference to the scene is it linked to. Initialized at null.
| useSingleContainer | property |
useSingleContainer:Boolean [write-only]Make all the Shape3D and descendants children react to this value.
Implementation public function set useSingleContainer(value:Boolean):void
| visible | property |
public var visible:Boolean = trueSpecify the visibility of this node. If true, the node is visible, if fase, it will not be displayed.
| Node | () | constructor |
public function Node(p_sName:String = "")Creates a node in the object tree of the world.
This constructor should normally not be called directly, only from a sub class.
Parametersp_sName:String (default = "") — A string identifier for this object.
|
| addChild | () | method |
public function addChild(p_oChild:Node):voidAdds a new child to this node.
A node can have several children, and when you add a child to a node, it is automatically connected to the parent node through its parent property.
Parametersp_oChild:Node — The child node to add
|
| addEventListener | () | method |
public function addEventListener(p_sEvt:String, p_oL:*):voidAdds a listener for the specified event.
Parametersp_sEvt:String — Name of the Event.
|
|
p_oL:* — Listener object.
|
| cull | () | method |
public function cull(p_oScene:Scene3D, p_oFrustum:Frustum, p_oViewMatrix:Matrix4, p_bChanged:Boolean):voidTests this node against the frustum volume to get its visibility.
If the node and its children aren't in the frustum, the node is set to cull
and will not be displayed.
The method also updates the bounding volumes, to make a more accurate culling system possible.
First the bounding sphere is updated, and if intersecting, the bounding box is updated to perform a more
precise culling.
[MANDATORY] The update method must be called first!
Parametersp_oScene:Scene3D — The current scene
|
|
p_oFrustum:Frustum — The frustum of the current camera
|
|
p_oViewMatrix:Matrix4 — [ToDo: explain]
|
|
p_bChanged:Boolean — [ToDo: explain]
|
| destroy | () | method |
public function destroy():voidDelete this node and all its child nodes.
This node nad all its child nodes are deleted, including all data they are storing.
The method makes recursive calls to the destroy method of the child nodes.
| getChildByName | () | method |
public function getChildByName(p_sName:String, p_bRecurs:Boolean = false):NodeReturns the child node with the specified name.
Parametersp_sName:String — The name of the child you want to retrieve
|
|
p_bRecurs:Boolean (default = false) — Set to true if you want to search the the children for the requested node
|
Node —
The requested node or null if no child with this name was found
|
| hasParent | () | method |
public function hasParent():BooleanTests if this node has a parent.
ReturnsBoolean — true if this node has a parent, false otherwise.
|
| isParent | () | method |
public function isParent(p_oNode:Node):BooleanTests if the node passed in the argument is parent of this node.
Parametersp_oNode:Node — The node you are testing
|
Boolean — true if the node in the argument is the parent of this node, false otherwise.
|
| perform | () | method |
public function perform(p_iOperation:INodeOperation):voidPerforms an operation on this node and all of its children.
Traverses the subtree made up of this node and all of its children. While traversing the subtree, individual operations are performed on entry and exit of each node of the subtree.
Implements the visitor design pattern: Using the visitor design pattern, you can define a new operation on Node and its subclasses without having to change the classes and without having to take care of traversing the node tree.
Parametersp_iOperation:INodeOperation — p_iOperation The operation to be performed on the node subtree
|
var mySpecialOperation:SpecialOperation = new SpecialOperation;
mySpecialOperation.someParameter = 0.8;
someTreeNode.perform(mySpecialOperation);
trace(mySpecialOperation.someResult);
mySpecialOperation.someParameter = 0.2;
someOtherTreeNode.perform(mySpecialOperation);
trace(mySpecialOperation.someResult);
| remove | () | method |
public function remove():voidRemoves this node from the node tree, saving its child nodes.
NOTE that remove method only remove the current node and NOT its children!
To remove the current node and all its children please refer to the destroy method.
The child nodes of this node becomes child nodes of this node's parent.
| removeChildByName | () | method |
public function removeChildByName(p_sName:String):BooleanRemoves the child node with the specified name.
All children of the node you want to remove are lost.
The link between them and the rest of the tree is broken, and they will not be rendered anymore!
The object itself and its children are still in memory!
If you want to free them completely, call child.destroy()
p_sName:String — The name of the node you want to remove.
|
Boolean — true if the node was removed from node tree, false otherwise.
|
| removeEventListener | () | method |
public function removeEventListener(p_sEvt:String, p_oL:*):voidRemoves a listener for the specified event.
Parametersp_sEvt:String — Name of the Event.
|
|
p_oL:* — Listener object.
|
| render | () | method |
public function render(p_oScene:Scene3D, p_oCamera:Camera3D):voidRenders this node.
Overridden in sub classes
Parametersp_oScene:Scene3D — p_oScene The current scene
|
|
p_oCamera:Camera3D — p_oCamera The camera of the world
|
| swapParent | () | method |
public function swapParent(p_oNewParent:Node):voidMoves this node to another parent node.
This node is removed from its current parent node, and added as a child of the specified node
Parametersp_oNewParent:Node — The node to become parent of this node
|
| toString | () | method |
public function toString():StringReturns a string representation of this object
ReturnsString — The fully qualified name of this class
|
| update | () | method |
public function update(p_oScene:Scene3D, p_oModelMatrix:Matrix4, p_bChanged:Boolean):voidUpdates this node.
For a node with transformation, this method update the transformation taking into account the matrix cache system.
Parametersp_oScene:Scene3D — The current scene
|
|
p_oModelMatrix:Matrix4 |
|
p_bChanged:Boolean |
| children | constant |
public const children:ArrayThe children of this node are stored inside this array. IMPORTANT: Use this property mainly as READ ONLY. To add, delete or search a specific child, you can use the specific method to do that
| id | constant |
public const id:uintThe unique id of this node in the node graph.
This value is very useful to retrieve a specific node.
| modelMatrix | constant |
public const modelMatrix:Matrix4Cached matrix corresponding to the transformation to the 0,0,0 frame system
| viewMatrix | constant |
public const viewMatrix:Matrix4Cached matrix corresponding to the transformation to the camera frame system