| 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 | ||
|---|---|---|---|
| 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 | ||
| children : Array
The children of this node are stored inside this array.
| Node | ||
| culled : CullingState
This property represent the culling state of the current node.
| Node | ||
| modelMatrix : Matrix4
Cached matrix corresponding to the transformation to the 0,0,0 frame system
| 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 | ||
| viewMatrix : Matrix4
Cached matrix corresponding to the transformation to the camera frame system
| 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 | ||
|
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 | ||
|
hasParent():Boolean
Tests if this node has a parent.
| Node | ||
|
Tests if the node passed in the argument is parent of this node.
| Node | ||
|
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 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 | ||
|---|---|---|---|
| id : uint
The unique id of this node in the node graph.
| Node | ||
| 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!
| children | property |
public var 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
| 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.
| modelMatrix | property |
public var modelMatrix:Matrix4Cached matrix corresponding to the transformation to the 0,0,0 frame system
| 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.
| viewMatrix | property |
public var viewMatrix:Matrix4Cached matrix corresponding to the transformation to the camera frame system
| 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
|
| getChildFromId | () | method |
public function getChildFromId(p_nId:uint, p_bRecurs:Boolean = false):NodeReturns the child node with the specified id.
Parametersp_nId:uint — The id 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 is was found
|
| getChildList | () | method |
public function getChildList():ArrayReturns an array with all child nodes of this node. Note : the public children property can by used too
ReturnsArray — The array of childs nodes
|
| 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.
|
| 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.
| removeChildById | () | method |
public function removeChildById(p_nId:Number):BooleanRemoves the child node with the specified id.
All the 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_nId:Number — The id of the child you want to remove
|
Boolean — true if the node was removed from node tree, false otherwise.
|
| 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 updateS the transformation taking into account the matrix cache system.
[ToDo : Explain the parameters and what they do with more details]
Parametersp_oScene:Scene3D — The current scene
|
|
p_oModelMatrix:Matrix4 |
|
p_bChanged:Boolean |
| 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.