# DXGfxLib.SceneNode Class Reference

A SceneNode is the basic building block of the scene graph. It keep track of its parent node and child nodes can be attached to it. It keep track of its bounding information and can update these when needed based on the children bounding information and positions. Also a scene node can be moved in several ways with or without moving the children in the same manner. More...

Inherited by DXGfxLib.QuadTreeNode, DXGfxLib.QuadTreeNode, DXGfxLib.SceneObject, and DXGfxLib.SceneObject.

Collaboration diagram for DXGfxLib.SceneNode:

[legend]

List of all members.

## Public Member Functions
void | ForcePositionWithoutUpdate (Vector3 position)
| This method force a new position for this scene node without affecting position of children nodes in world space. Which means children node won't move in the global space only this node will. Thus relative positions of the children to this node (their parent) do change.
void | ForceOrientationWithoutUpdate (Vector3 orientation)
| This is the pendant of ForcePositionWithoutUpdate for the node orientation. Children node position and orientation in global 3D space is unchanged.
void | ForceWorldMatValueWithoutUpdate (Matrix desiredWorldMat)
| This will set the world matrix for this node without affecting descendants. Also this won't call the OnMove event so even if you have registered for the OnMove event you won't be notified if the node is just repositionned through a call to ForceWorldMatValueWithoutUpdate!
virtual void | OnMove ()
| This method through the Moved event as well as it update Axes and extents. This is called by the ApplyWorldTransform method which is in fact the sole method used to move or reorient the scene node.
| SceneNode ()
| Public constructor for the scene node.
virtual void | Initialize ()
| SceneNode (SceneNode sceneNode)
| This constructor will build an instance a scene node which is a copy of the scene node passed as an argument. Everything is copied including childrend attached to the node.
virtual void | Dispose ()
virtual void | AddChild (SceneNode node)
| We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors upon addition of children so we mark the method virtual.
virtual void | RemoveChild (SceneNode node)
| We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors when removing children so we mark the method virtual.
virtual void | ApplyWorldTransform (Matrix transform)
| This is in fact the unique method in charge of modifying position and orientation of the scene node. Most of the other method and accessor dealing with position are relying on this one except the methods were children are not updated!
void | ApplyLocalTransform (Matrix transform)
| This method does in fact call into ApplyWorldTransform after having computed the world transform matrix to apply to get the local transform that was passed as a parameter.
virtual void | GetPrepared ()
| Currently this method is used only in classes deriving from SceneNode which also have to load ressources (most of the time DX Resources). So at the moment this is used only after loading a scene but it could potentially be use when you want parts of your scene to be ready for rendering.
virtual void | Update (Frustrum frustrum, float elapsedTime, double appTime, List< IDrawable > objectsToBeRendered)
| This is the method that should be called by any external code willing to update the scene. When looking in the details this method does ask the nodes to update and then call the AttachForRendering method that will add SceneObjects to the list of objets to be rendered.
virtual void | Update (Frustrum frustrum, double appTime, float elapsedTime)
| This will update all children and all hierarchy bounding information. After we have gone through this method bounding volume are in synch with what is contained in the scene graph below the current node. Scene objects need to override this method to provide their own local bounding information to enter into calculation of the world axis aligned bounding box.
virtual void | AttachForRendering (Frustrum frustrum, List< IDrawable > objectsToBeRendered)
| A scene node is only a position, bounding volume and connecting information entity, it doesn't have anything to display on itself so this call only propagate the call to descendent. Scene objects or derived class can then determine based on the frustrum information if they need to render during this pass or not. If they do need to render, they should add themselves to the list of objects to be rendered.
virtual void | DetachAll ()
| Will detach all children from the scene graph.
virtual void | Detach (SceneNode sceneNodeToDetach)
| Will detach a specific scene node from the graph below the current scene node.
virtual bool | Collide (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects)
| If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.
virtual bool | CollideSolid (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects)
| If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.
virtual bool | Collide (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| Same as above except you test only for collision with entities of a specified desired type.
virtual bool | CollideSolid (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| Same as above except that only sceneObjects flaged as solid are returned and considered valid for collision detection.
bool | CollideWithAABox (SceneNode sceneNode)
| Check if the given scene node collide with this scene node worl axis aligned bounding box. This is evaluated using the world axis aligned bounding box of the given scene node against the one of the current node.
void | UpdateAxes ()
| This method will update the node axes information. This is called each time the node is updated.
Vector3[] | Axes ()
| Public accessor for the axes information.
void | UpdateExtents ()
| This update the dimensions against the local axes of the scene node. When you call this method you need to have the axes up to date. Both methods are called in the right order when the node is moved. UpdateExtents is only called when the node is moved so it won't reflect changes in dimensions if node in the graph below move to much and change the bounding volume.
Vector3 | Extents ()
| Public accessor for the Extents information!
virtual bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects)
| This will check if the 3D ray does intersect with any scene object attached to the graph below this scene node.
virtual bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| See above.
void | ForcePositionWithoutUpdate (Vector3 position)
| This method force a new position for this scene node without affecting position of children nodes in world space. Which means children node won't move in the global space only this node will. Thus relative positions of the children to this node (their parent) do change.
void | ForceOrientationWithoutUpdate (Vector3 orientation)
| This is the pendant of ForcePositionWithoutUpdate for the node orientation. Children node position and orientation in global 3D space is unchanged.
void | ForceWorldMatValueWithoutUpdate (Matrix desiredWorldMat)
| This will set the world matrix for this node without affecting descendants. Also this won't call the OnMove event so even if you have registered for the OnMove event you won't be notified if the node is just repositionned through a call to ForceWorldMatValueWithoutUpdate!
virtual void | OnMove ()
| This method through the Moved event as well as it update Axes and extents. This is called by the ApplyWorldTransform method which is in fact the sole method used to move or reorient the scene node.
| SceneNode ()
| Public constructor for the scene node.
virtual void | Initialize ()
| SceneNode (SceneNode sceneNode)
| This constructor will build an instance a scene node which is a copy of the scene node passed as an argument. Everything is copied including childrend attached to the node.
virtual void | Dispose ()
virtual void | AddChild (SceneNode node)
| We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors upon addition of children so we mark the method virtual.
virtual void | RemoveChild (SceneNode node)
| We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors when removing children so we mark the method virtual.
virtual void | ApplyWorldTransform (Matrix transform)
| This is in fact the unique method in charge of modifying position and orientation of the scene node. Most of the other method and accessor dealing with position are relying on this one except the methods were children are not updated!
void | ApplyLocalTransform (Matrix transform)
| This method does in fact call into ApplyWorldTransform after having computed the world transform matrix to apply to get the local transform that was passed as a parameter.
virtual void | GetPrepared ()
| Currently this method is used only in classes deriving from SceneNode which also have to load ressources (most of the time DX Resources). So at the moment this is used only after loading a scene but it could potentially be use when you want parts of your scene to be ready for rendering.
virtual void | Update (Frustrum frustrum, float elapsedTime, double appTime, List< IDrawable > objectsToBeRendered)
| This is the method that should be called by any external code willing to update the scene. When looking in the details this method does ask the nodes to update and then call the AttachForRendering method that will add SceneObjects to the list of objets to be rendered.
virtual void | Update (Frustrum frustrum, double appTime, float elapsedTime)
| This will update all children and all hierarchy bounding information. After we have gone through this method bounding volume are in synch with what is contained in the scene graph below the current node. Scene objects need to override this method to provide their own local bounding information to enter into calculation of the world axis aligned bounding box.
virtual void | AttachForRendering (Frustrum frustrum, List< IDrawable > objectsToBeRendered)
| A scene node is only a position, bounding volume and connecting information entity, it doesn't have anything to display on itself so this call only propagate the call to descendent. Scene objects or derived class can then determine based on the frustrum information if they need to render during this pass or not. If they do need to render, they should add themselves to the list of objects to be rendered.
virtual void | DetachAll ()
| Will detach all children from the scene graph.
virtual void | Detach (SceneNode sceneNodeToDetach)
| Will detach a specific scene node from the graph below the current scene node.
virtual bool | Collide (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects)
| If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.
virtual bool | CollideSolid (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects)
| If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.
virtual bool | Collide (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| Same as above except you test only for collision with entities of a specified desired type.
virtual bool | CollideSolid (SceneNode sceneNode, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| Same as above except that only sceneObjects flaged as solid are returned and considered valid for collision detection.
bool | CollideWithAABox (SceneNode sceneNode)
| Check if the given scene node collide with this scene node worl axis aligned bounding box. This is evaluated using the world axis aligned bounding box of the given scene node against the one of the current node.
void | UpdateAxes ()
| This method will update the node axes information. This is called each time the node is updated.
Vector3[] | Axes ()
| Public accessor for the axes information.
void | UpdateExtents ()
| This update the dimensions against the local axes of the scene node. When you call this method you need to have the axes up to date. Both methods are called in the right order when the node is moved. UpdateExtents is only called when the node is moved so it won't reflect changes in dimensions if node in the graph below move to much and change the bounding volume.
Vector3 | Extents ()
| Public accessor for the Extents information!
virtual bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects)
| This will check if the 3D ray does intersect with any scene object attached to the graph below this scene node.
virtual bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| See above.
## Public Attributes
bool | useFrustrumCulling
| Checking if a lot of objects are in the viewing frustrum can be more expensive that sending them to the video card. All depend of the object and of the scene. For example with the quadtree it can be a good solution to check the frustrum culling on quadtreenode and don't check on the objects that are children of the node in the viewing frustrum. Whether this will be faster or not depends of the situation and of your object. This boolean allow to turn off frustrum culling on some object if it is though that it will be more efficient!
SceneNode | parent = null
| If this field is not null we have a parent node and this is a ref to it.
Scene | scene = null
| We want our scene node to which scene it is attached to. We keep that information in the below member variable.
string | name
| We might want to give a name to our scene, we keep that name in the below string.
Vector3[] | axes = new Vector3[3]
| Local axes of the scene node. Can be useful among other things for collision detection based on bounding box information using the method of separating axes.
Vector3 | extents = new Vector3()
| In case the dimensions of the scene node bounding box are needed they can be read here.
bool | moved = true
| Boolean indicating whether we have moved recently or not (since last update!).
IPositionConstraint | positionConstraint = null
| In some situation we want to enforce constraints on the position of the scene node. This can be done by implementing IPositionConstraint interface and passing a ref to an implementation of that interface to the scene node. Check documentation of that specific interface to get a better idea of how it can be used.
AABBox | worldAABBox = null
| World axes align bounding box which should encompass this node and all children node bounding volumes.
## Static Public Attributes
static bool | defaultForFrustrumCulling = true
| This is the default setting for any newly created SceneObject. By default frustrum culling is used. This is a static variable, if you change this to false, any newly created scene object will have this turn off by default except derived classes that might override this (like quadtreenodes)!
## Protected Attributes
List< SceneNode > | children = null
| List of children scene nodes.
## Properties
Matrix | WorldMat`[get, set]`
| This is the public accessor for the WorldMatrix. If you set the WorldMatrix value through this accessor all children of the scene node will also be repositionned accordingly.
Vector3 | Position`[get, set]`
| Public accessor for position of scene node in 3D space. Using this accessor to set the position will also move all the children nodes.
float | X`[get, set]`
| World position on X axis.
float | Y`[get, set]`
| World position on Y axis.
float | Z`[get, set]`
| World position on Z axis.
Vector3 | PositionToParent`[get, set]`
| This gives the position relative to the parent node if it does exist. Chaning this position through this accessor will also move all the children nodes accordingly.
Vector3 | Orientation`[get, set]`
| This return a Vector3 containing the Yaw Pitch Roll value in this order in radian. Chaing the orientation through this accessor will also change the orientation of the whole scene node hierarchy under this node.
float | Yaw`[get, set]`
| The name says everything. Exception this value is expressed in degrees.
float | Pitch`[get, set]`
| The name says everything. Exception this value is expressed in degrees.
float | Roll`[get, set]`
| The name says everything. Exception this value is expressed in degrees.
Vector3 | OrientationToParent`[get, set]`
| This is the orientation (yaw pitch roll) in radian relative to the parent node. Changing the orientation of this node through this accessor will also affect the whole node hierarchy under this node.
Matrix | LocalMat`[get, set]`
| This method return what is called the localMat which in fact is the position/orientation matrix in the space defined by the parent of this node. Relation to the worldMat are detailed below:.
## Events
NodeMovedEventHandler | Moved
| NodeMoved event to which user code can subscribe. This is neeeded as some code part might need to be notified of such an event. For example in some scene graph like the QuadTree you need to reposition the node in the tree when such an event arise.

## Detailed Description

A SceneNode is the basic building block of the scene graph. It keep track of its parent node and child nodes can be attached to it. It keep track of its bounding information and can update these when needed based on the children bounding information and positions. Also a scene node can be moved in several ways with or without moving the children in the same manner.

Definition at line 40 of file SceneNode.cs.

## Constructor & Destructor Documentation

DXGfxLib.SceneNode.SceneNode | ( |  | ) |

Public constructor for the scene node.

Definition at line 442 of file SceneNode.cs.

Here is the call graph for this function:

DXGfxLib.SceneNode.SceneNode | ( | SceneNode | sceneNode | ) |

This constructor will build an instance a scene node which is a copy of the scene node passed as an argument. Everything is copied including childrend attached to the node.

Parameters:

  | sceneNode |

Definition at line 465 of file SceneNode.cs.

DXGfxLib.SceneNode.SceneNode | ( |  | ) |

Public constructor for the scene node.

Definition at line 442 of file SceneNode.cs.

Here is the call graph for this function:

DXGfxLib.SceneNode.SceneNode | ( | SceneNode | sceneNode | ) |

This constructor will build an instance a scene node which is a copy of the scene node passed as an argument. Everything is copied including childrend attached to the node.

Parameters:

  | sceneNode |

Definition at line 465 of file SceneNode.cs.

## Member Function Documentation

virtual void DXGfxLib.SceneNode.AddChild | ( | SceneNode | node | ) | `[virtual]`

We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors upon addition of children so we mark the method virtual.

Parameters:

  | node |

Definition at line 493 of file SceneNode.cs.

virtual void DXGfxLib.SceneNode.AddChild | ( | SceneNode | node | ) | `[virtual]`

We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors upon addition of children so we mark the method virtual.

Parameters:

  | node |

Definition at line 493 of file SceneNode.cs.

Here is the caller graph for this function:

void DXGfxLib.SceneNode.ApplyLocalTransform | ( | Matrix | transform | ) |

This method does in fact call into ApplyWorldTransform after having computed the world transform matrix to apply to get the local transform that was passed as a parameter.

Parameters:

  | transform |

Definition at line 546 of file SceneNode.cs.

Here is the call graph for this function:

void DXGfxLib.SceneNode.ApplyLocalTransform | ( | Matrix | transform | ) |

This method does in fact call into ApplyWorldTransform after having computed the world transform matrix to apply to get the local transform that was passed as a parameter.

Parameters:

  | transform |

Definition at line 546 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.ApplyWorldTransform | ( | Matrix | transform | ) | `[virtual]`

This is in fact the unique method in charge of modifying position and orientation of the scene node. Most of the other method and accessor dealing with position are relying on this one except the methods were children are not updated!

Parameters:

  | transform |

Definition at line 525 of file SceneNode.cs.

Here is the call graph for this function:

virtual void DXGfxLib.SceneNode.ApplyWorldTransform | ( | Matrix | transform | ) | `[virtual]`

This is in fact the unique method in charge of modifying position and orientation of the scene node. Most of the other method and accessor dealing with position are relying on this one except the methods were children are not updated!

Parameters:

  | transform |

Definition at line 525 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.AttachForRendering | ( | Frustrum | frustrum,
|  | List< IDrawable > | objectsToBeRendered |
| ) |  |  | `[virtual]`

A scene node is only a position, bounding volume and connecting information entity, it doesn't have anything to display on itself so this call only propagate the call to descendent. Scene objects or derived class can then determine based on the frustrum information if they need to render during this pass or not. If they do need to render, they should add themselves to the list of objects to be rendered.

Parameters:

  | frustrum |
  | objectsToBeRendered |

Reimplemented in DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.SceneObject, DXGfxLib.SkyBox, and DXGfxLib.TerrainTile.

Definition at line 617 of file SceneNode.cs.

Here is the call graph for this function:

virtual void DXGfxLib.SceneNode.AttachForRendering | ( | Frustrum | frustrum,
|  | List< IDrawable > | objectsToBeRendered |
| ) |  |  | `[virtual]`

A scene node is only a position, bounding volume and connecting information entity, it doesn't have anything to display on itself so this call only propagate the call to descendent. Scene objects or derived class can then determine based on the frustrum information if they need to render during this pass or not. If they do need to render, they should add themselves to the list of objects to be rendered.

Parameters:

  | frustrum |
  | objectsToBeRendered |

Reimplemented in DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.SceneObject, DXGfxLib.SkyBox, and DXGfxLib.TerrainTile.

Definition at line 617 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3 [] DXGfxLib.SceneNode.Axes | ( |  | ) |

Public accessor for the axes information.

Returns:

Definition at line 857 of file SceneNode.cs.

Vector3 [] DXGfxLib.SceneNode.Axes | ( |  | ) |

Public accessor for the axes information.

Returns:

Definition at line 857 of file SceneNode.cs.

virtual bool DXGfxLib.SceneNode.Collide | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

Same as above except you test only for collision with entities of a specified desired type.

Parameters:

  | SceneObject |
  | collidingSceneObjects |
  | desiredType |

Returns:

Definition at line 754 of file SceneNode.cs.

Here is the call graph for this function:

virtual bool DXGfxLib.SceneNode.Collide | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.

Parameters:

  | SceneObject |
  | collidingSceneObject |

Returns:

Definition at line 682 of file SceneNode.cs.

Here is the call graph for this function:

virtual bool DXGfxLib.SceneNode.Collide | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

Same as above except you test only for collision with entities of a specified desired type.

Parameters:

  | SceneObject |
  | collidingSceneObjects |
  | desiredType |

Returns:

Definition at line 754 of file SceneNode.cs.

Here is the call graph for this function:

virtual bool DXGfxLib.SceneNode.Collide | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.

Parameters:

  | SceneObject |
  | collidingSceneObject |

Returns:

Definition at line 682 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool DXGfxLib.SceneNode.CollideSolid | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

Same as above except that only sceneObjects flaged as solid are returned and considered valid for collision detection.

Parameters:

  | SceneObject |
  | collidingSceneObjects |
  | desiredType |

Returns:

Definition at line 791 of file SceneNode.cs.

Here is the call graph for this function:

virtual bool DXGfxLib.SceneNode.CollideSolid | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.

This is the same as the Collide method with the same signature except that we return only SceneObjects that are flaged as solid!

Parameters:

  | SceneObject |
  | collidingSceneObject |

Returns:

Definition at line 720 of file SceneNode.cs.

Here is the call graph for this function:

virtual bool DXGfxLib.SceneNode.CollideSolid | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

Same as above except that only sceneObjects flaged as solid are returned and considered valid for collision detection.

Parameters:

  | SceneObject |
  | collidingSceneObjects |
  | desiredType |

Returns:

Definition at line 791 of file SceneNode.cs.

Here is the call graph for this function:

virtual bool DXGfxLib.SceneNode.CollideSolid | ( | SceneNode | sceneNode,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

If there is a collision between the give SceneObject bounding box and the hierarchy of nodes below the node on which you are calling this method this method will return true and all the node that are potentially colliding with our node are going to be added to the ArrayList collidingSceneObject.

This is the same as the Collide method with the same signature except that we return only SceneObjects that are flaged as solid!

Parameters:

  | SceneObject |
  | collidingSceneObject |

Returns:

Definition at line 720 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

bool DXGfxLib.SceneNode.CollideWithAABox | ( | SceneNode | sceneNode | ) |

Check if the given scene node collide with this scene node worl axis aligned bounding box. This is evaluated using the world axis aligned bounding box of the given scene node against the one of the current node.

Parameters:

  | sceneNode |

Returns:

Definition at line 827 of file SceneNode.cs.

Here is the call graph for this function:

bool DXGfxLib.SceneNode.CollideWithAABox | ( | SceneNode | sceneNode | ) |

Check if the given scene node collide with this scene node worl axis aligned bounding box. This is evaluated using the world axis aligned bounding box of the given scene node against the one of the current node.

Parameters:

  | sceneNode |

Returns:

Definition at line 827 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.Detach | ( | SceneNode | sceneNodeToDetach | ) | `[virtual]`

Will detach a specific scene node from the graph below the current scene node.

Parameters:

  | sceneNodeToDetach |

Definition at line 648 of file SceneNode.cs.

virtual void DXGfxLib.SceneNode.Detach | ( | SceneNode | sceneNodeToDetach | ) | `[virtual]`

Will detach a specific scene node from the graph below the current scene node.

Parameters:

  | sceneNodeToDetach |

Definition at line 648 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.DetachAll | ( |  | ) | `[virtual]`

Will detach all children from the scene graph.

Reimplemented in DXGfxLib.SceneObject, and DXGfxLib.SceneObject.

Definition at line 636 of file SceneNode.cs.

virtual void DXGfxLib.SceneNode.DetachAll | ( |  | ) | `[virtual]`

Will detach all children from the scene graph.

Reimplemented in DXGfxLib.SceneObject, and DXGfxLib.SceneObject.

Definition at line 636 of file SceneNode.cs.

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.Dispose | ( |  | ) | `[virtual]`

Reimplemented in DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.TexturedPlane, DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, and DXGfxLib.TexturedPlane.

Definition at line 477 of file SceneNode.cs.

virtual void DXGfxLib.SceneNode.Dispose | ( |  | ) | `[virtual]`

Reimplemented in DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.TexturedPlane, DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, and DXGfxLib.TexturedPlane.

Definition at line 477 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3 DXGfxLib.SceneNode.Extents | ( |  | ) |

Public accessor for the Extents information!

Returns:

Definition at line 880 of file SceneNode.cs.

Vector3 DXGfxLib.SceneNode.Extents | ( |  | ) |

Public accessor for the Extents information!

Returns:

Definition at line 880 of file SceneNode.cs.

void DXGfxLib.SceneNode.ForceOrientationWithoutUpdate | ( | Vector3 | orientation | ) |

This is the pendant of ForcePositionWithoutUpdate for the node orientation. Children node position and orientation in global 3D space is unchanged.

Parameters:

  | orientation |

Definition at line 351 of file SceneNode.cs.

Here is the call graph for this function:

void DXGfxLib.SceneNode.ForceOrientationWithoutUpdate | ( | Vector3 | orientation | ) |

This is the pendant of ForcePositionWithoutUpdate for the node orientation. Children node position and orientation in global 3D space is unchanged.

Parameters:

  | orientation |

Definition at line 351 of file SceneNode.cs.

Here is the call graph for this function:

void DXGfxLib.SceneNode.ForcePositionWithoutUpdate | ( | Vector3 | position | ) |

This method force a new position for this scene node without affecting position of children nodes in world space. Which means children node won't move in the global space only this node will. Thus relative positions of the children to this node (their parent) do change.

Parameters:

  | position |

Definition at line 335 of file SceneNode.cs.

Here is the call graph for this function:

void DXGfxLib.SceneNode.ForcePositionWithoutUpdate | ( | Vector3 | position | ) |

This method force a new position for this scene node without affecting position of children nodes in world space. Which means children node won't move in the global space only this node will. Thus relative positions of the children to this node (their parent) do change.

Parameters:

  | position |

Definition at line 335 of file SceneNode.cs.

Here is the call graph for this function:

void DXGfxLib.SceneNode.ForceWorldMatValueWithoutUpdate | ( | Matrix | desiredWorldMat | ) |

This will set the world matrix for this node without affecting descendants. Also this won't call the OnMove event so even if you have registered for the OnMove event you won't be notified if the node is just repositionned through a call to ForceWorldMatValueWithoutUpdate!

Parameters:

  | desiredWorldMat |

Definition at line 364 of file SceneNode.cs.

void DXGfxLib.SceneNode.ForceWorldMatValueWithoutUpdate | ( | Matrix | desiredWorldMat | ) |

This will set the world matrix for this node without affecting descendants. Also this won't call the OnMove event so even if you have registered for the OnMove event you won't be notified if the node is just repositionned through a call to ForceWorldMatValueWithoutUpdate!

Parameters:

  | desiredWorldMat |

Definition at line 364 of file SceneNode.cs.

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.GetPrepared | ( |  | ) | `[virtual]`

Currently this method is used only in classes deriving from SceneNode which also have to load ressources (most of the time DX Resources). So at the moment this is used only after loading a scene but it could potentially be use when you want parts of your scene to be ready for rendering.

Reimplemented in DXGfxLib.Cursor, DXGfxLib.MeshObject, DXGfxLib.RawObject, DXGfxLib.SkyDome, DXGfxLib.Water2, DXGfxLib.Cursor, DXGfxLib.MeshObject, DXGfxLib.RawObject, DXGfxLib.SkyDome, and DXGfxLib.Water2.

Definition at line 559 of file SceneNode.cs.

Here is the call graph for this function:

virtual void DXGfxLib.SceneNode.GetPrepared | ( |  | ) | `[virtual]`

Currently this method is used only in classes deriving from SceneNode which also have to load ressources (most of the time DX Resources). So at the moment this is used only after loading a scene but it could potentially be use when you want parts of your scene to be ready for rendering.

Reimplemented in DXGfxLib.Cursor, DXGfxLib.MeshObject, DXGfxLib.RawObject, DXGfxLib.SkyDome, DXGfxLib.Water2, DXGfxLib.Cursor, DXGfxLib.MeshObject, DXGfxLib.RawObject, DXGfxLib.SkyDome, and DXGfxLib.Water2.

Definition at line 559 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.Initialize | ( |  | ) | `[virtual]`

Reimplemented in DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.SkyDome, DXGfxLib.Water2, DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.SkyDome, and DXGfxLib.Water2.

Definition at line 447 of file SceneNode.cs.

virtual void DXGfxLib.SceneNode.Initialize | ( |  | ) | `[virtual]`

Reimplemented in DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.SkyDome, DXGfxLib.Water2, DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.SkyDome, and DXGfxLib.Water2.

Definition at line 447 of file SceneNode.cs.

Here is the caller graph for this function:

virtual bool DXGfxLib.SceneNode.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

See above.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |
  | desiredType |

Returns:

Reimplemented in DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.MeshObject, and DXGfxLib.SceneObject.

Definition at line 928 of file SceneNode.cs.

virtual bool DXGfxLib.SceneNode.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

This will check if the 3D ray does intersect with any scene object attached to the graph below this scene node.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |

Returns:

Reimplemented in DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.MeshObject, and DXGfxLib.SceneObject.

Definition at line 892 of file SceneNode.cs.

virtual bool DXGfxLib.SceneNode.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

See above.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |
  | desiredType |

Returns:

Reimplemented in DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.MeshObject, and DXGfxLib.SceneObject.

Definition at line 928 of file SceneNode.cs.

Here is the call graph for this function:

virtual bool DXGfxLib.SceneNode.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

This will check if the 3D ray does intersect with any scene object attached to the graph below this scene node.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |

Returns:

Reimplemented in DXGfxLib.MeshObject, DXGfxLib.SceneObject, DXGfxLib.MeshObject, and DXGfxLib.SceneObject.

Definition at line 892 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.OnMove | ( |  | ) | `[virtual]`

This method through the Moved event as well as it update Axes and extents. This is called by the ApplyWorldTransform method which is in fact the sole method used to move or reorient the scene node.

Reimplemented in DXGfxLib.SceneObject, and DXGfxLib.SceneObject.

Definition at line 417 of file SceneNode.cs.

Here is the call graph for this function:

virtual void DXGfxLib.SceneNode.OnMove | ( |  | ) | `[virtual]`

This method through the Moved event as well as it update Axes and extents. This is called by the ApplyWorldTransform method which is in fact the sole method used to move or reorient the scene node.

Reimplemented in DXGfxLib.SceneObject, and DXGfxLib.SceneObject.

Definition at line 417 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.RemoveChild | ( | SceneNode | node | ) | `[virtual]`

We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors when removing children so we mark the method virtual.

Parameters:

  | node |

Definition at line 509 of file SceneNode.cs.

virtual void DXGfxLib.SceneNode.RemoveChild | ( | SceneNode | node | ) | `[virtual]`

We don't want any 'external' code to access directly the children collection. Also classes inheriting from SceneNode might want to implement different behaviors when removing children so we mark the method virtual.

Parameters:

  | node |

Definition at line 509 of file SceneNode.cs.

Here is the caller graph for this function:

virtual void DXGfxLib.SceneNode.Update | ( | Frustrum | frustrum,
|  | double | appTime,
|  | float | elapsedTime |
| ) |  |  | `[virtual]`

This will update all children and all hierarchy bounding information. After we have gone through this method bounding volume are in synch with what is contained in the scene graph below the current node. Scene objects need to override this method to provide their own local bounding information to enter into calculation of the world axis aligned bounding box.

Parameters:

  | frustrum |
  | appTime |
  | elapsedTime |

Reimplemented in DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.SkyDome, DXGfxLib.Water, DXGfxLib.Water2, DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.SkyDome, DXGfxLib.Water, and DXGfxLib.Water2.

Definition at line 597 of file SceneNode.cs.

Here is the call graph for this function:

virtual void DXGfxLib.SceneNode.Update | ( | Frustrum | frustrum,
|  | float | elapsedTime,
|  | double | appTime,
|  | List< IDrawable > | objectsToBeRendered |
| ) |  |  | `[virtual]`

This is the method that should be called by any external code willing to update the scene. When looking in the details this method does ask the nodes to update and then call the AttachForRendering method that will add SceneObjects to the list of objets to be rendered.

Parameters:

  | frustrum |
  | elapsedTime |
  | appTime |
  | objectsToBeRendered |

Reimplemented in DXGfxLib.MeshObjectWithLOD, DXGfxLib.QuadTreeNode, DXGfxLib.TerrainTile, DXGfxLib.MeshObjectWithLOD, DXGfxLib.QuadTreeNode, and DXGfxLib.TerrainTile.

Definition at line 582 of file SceneNode.cs.

Here is the call graph for this function:

virtual void DXGfxLib.SceneNode.Update | ( | Frustrum | frustrum,
|  | double | appTime,
|  | float | elapsedTime |
| ) |  |  | `[virtual]`

This will update all children and all hierarchy bounding information. After we have gone through this method bounding volume are in synch with what is contained in the scene graph below the current node. Scene objects need to override this method to provide their own local bounding information to enter into calculation of the world axis aligned bounding box.

Parameters:

  | frustrum |
  | appTime |
  | elapsedTime |

Reimplemented in DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.SkyDome, DXGfxLib.Water, DXGfxLib.Water2, DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.SceneObject, DXGfxLib.SkyBox, DXGfxLib.SkyDome, DXGfxLib.Water, and DXGfxLib.Water2.

Definition at line 597 of file SceneNode.cs.

Here is the call graph for this function:

virtual void DXGfxLib.SceneNode.Update | ( | Frustrum | frustrum,
|  | float | elapsedTime,
|  | double | appTime,
|  | List< IDrawable > | objectsToBeRendered |
| ) |  |  | `[virtual]`

This is the method that should be called by any external code willing to update the scene. When looking in the details this method does ask the nodes to update and then call the AttachForRendering method that will add SceneObjects to the list of objets to be rendered.

Parameters:

  | frustrum |
  | elapsedTime |
  | appTime |
  | objectsToBeRendered |

Reimplemented in DXGfxLib.MeshObjectWithLOD, DXGfxLib.QuadTreeNode, DXGfxLib.TerrainTile, DXGfxLib.MeshObjectWithLOD, DXGfxLib.QuadTreeNode, and DXGfxLib.TerrainTile.

Definition at line 582 of file SceneNode.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

void DXGfxLib.SceneNode.UpdateAxes | ( |  | ) |

This method will update the node axes information. This is called each time the node is updated.

Definition at line 835 of file SceneNode.cs.

void DXGfxLib.SceneNode.UpdateAxes | ( |  | ) |

This method will update the node axes information. This is called each time the node is updated.

Definition at line 835 of file SceneNode.cs.

Here is the caller graph for this function:

void DXGfxLib.SceneNode.UpdateExtents | ( |  | ) |

This update the dimensions against the local axes of the scene node. When you call this method you need to have the axes up to date. Both methods are called in the right order when the node is moved. UpdateExtents is only called when the node is moved so it won't reflect changes in dimensions if node in the graph below move to much and change the bounding volume.

Definition at line 867 of file SceneNode.cs.

void DXGfxLib.SceneNode.UpdateExtents | ( |  | ) |

This update the dimensions against the local axes of the scene node. When you call this method you need to have the axes up to date. Both methods are called in the right order when the node is moved. UpdateExtents is only called when the node is moved so it won't reflect changes in dimensions if node in the graph below move to much and change the bounding volume.

Definition at line 867 of file SceneNode.cs.

Here is the caller graph for this function:

## Member Data Documentation

Vector3 [] DXGfxLib.SceneNode.axes = new Vector3[3]

Local axes of the scene node. Can be useful among other things for collision detection based on bounding box information using the method of separating axes.

Definition at line 79 of file SceneNode.cs.

List< SceneNode > DXGfxLib.SceneNode::children = null`[protected]`

List of children scene nodes.

Definition at line 432 of file SceneNode.cs.

static bool DXGfxLib.SceneNode::defaultForFrustrumCulling = true`[static]`

This is the default setting for any newly created SceneObject. By default frustrum culling is used. This is a static variable, if you change this to false, any newly created scene object will have this turn off by default except derived classes that might override this (like quadtreenodes)!

Definition at line 57 of file SceneNode.cs.

Vector3 DXGfxLib.SceneNode::extents = new Vector3()

In case the dimensions of the scene node bounding box are needed they can be read here.

Definition at line 84 of file SceneNode.cs.

bool DXGfxLib.SceneNode::moved = true

Boolean indicating whether we have moved recently or not (since last update!).

Definition at line 96 of file SceneNode.cs.

string DXGfxLib.SceneNode::name

We might want to give a name to our scene, we keep that name in the below string.

Definition at line 73 of file SceneNode.cs.

SceneNode DXGfxLib.SceneNode::parent = null

If this field is not null we have a parent node and this is a ref to it.

Definition at line 62 of file SceneNode.cs.

IPositionConstraint DXGfxLib.SceneNode::positionConstraint = null

In some situation we want to enforce constraints on the position of the scene node. This can be done by implementing IPositionConstraint interface and passing a ref to an implementation of that interface to the scene node. Check documentation of that specific interface to get a better idea of how it can be used.

Definition at line 109 of file SceneNode.cs.

Scene DXGfxLib.SceneNode::scene = null

We want our scene node to which scene it is attached to. We keep that information in the below member variable.

Definition at line 68 of file SceneNode.cs.

bool DXGfxLib.SceneNode::useFrustrumCulling

Checking if a lot of objects are in the viewing frustrum can be more expensive that sending them to the video card. All depend of the object and of the scene. For example with the quadtree it can be a good solution to check the frustrum culling on quadtreenode and don't check on the objects that are children of the node in the viewing frustrum. Whether this will be faster or not depends of the situation and of your object. This boolean allow to turn off frustrum culling on some object if it is though that it will be more efficient!

Definition at line 50 of file SceneNode.cs.

AABBox DXGfxLib.SceneNode::worldAABBox = null

World axes align bounding box which should encompass this node and all children node bounding volumes.

Definition at line 437 of file SceneNode.cs.

## Property Documentation

Matrix DXGfxLib.SceneNode::LocalMat`[get, set]`

This method return what is called the localMat which in fact is the position/orientation matrix in the space defined by the parent of this node. Relation to the worldMat are detailed below:.

WorldMat = LocalMat * parent.WorldMat LocalMat = WorldMat * inv(parent.WorldMat)

Changing the LocalMat through this accessor will affect all the scene node tree below this node accordingly.

Definition at line 380 of file SceneNode.cs.

Vector3 DXGfxLib.SceneNode::Orientation`[get, set]`

This return a Vector3 containing the Yaw Pitch Roll value in this order in radian. Chaing the orientation through this accessor will also change the orientation of the whole scene node hierarchy under this node.

Definition at line 218 of file SceneNode.cs.

Vector3 DXGfxLib.SceneNode::OrientationToParent`[get, set]`

This is the orientation (yaw pitch roll) in radian relative to the parent node. Changing the orientation of this node through this accessor will also affect the whole node hierarchy under this node.

Definition at line 314 of file SceneNode.cs.

float DXGfxLib.SceneNode::Pitch`[get, set]`

The name says everything. Exception this value is expressed in degrees.

Definition at line 274 of file SceneNode.cs.

Vector3 DXGfxLib.SceneNode::Position`[get, set]`

Public accessor for position of scene node in 3D space. Using this accessor to set the position will also move all the children nodes.

Definition at line 132 of file SceneNode.cs.

Vector3 DXGfxLib.SceneNode::PositionToParent`[get, set]`

This gives the position relative to the parent node if it does exist. Chaning this position through this accessor will also move all the children nodes accordingly.

Definition at line 194 of file SceneNode.cs.

float DXGfxLib.SceneNode::Roll`[get, set]`

The name says everything. Exception this value is expressed in degrees.

Definition at line 294 of file SceneNode.cs.

Matrix DXGfxLib.SceneNode::WorldMat`[get, set]`

This is the public accessor for the WorldMatrix. If you set the WorldMatrix value through this accessor all children of the scene node will also be repositionned accordingly.

Definition at line 117 of file SceneNode.cs.

float DXGfxLib.SceneNode::X`[get, set]`

World position on X axis.

Definition at line 149 of file SceneNode.cs.

float DXGfxLib.SceneNode::Y`[get, set]`

World position on Y axis.

Definition at line 164 of file SceneNode.cs.

float DXGfxLib.SceneNode::Yaw`[get, set]`

The name says everything. Exception this value is expressed in degrees.

Definition at line 254 of file SceneNode.cs.

float DXGfxLib.SceneNode::Z`[get, set]`

World position on Z axis.

Definition at line 179 of file SceneNode.cs.

## Event Documentation

NodeMovedEventHandler DXGfxLib.SceneNode::Moved

NodeMoved event to which user code can subscribe. This is neeeded as some code part might need to be notified of such an event. For example in some scene graph like the QuadTree you need to reposition the node in the tree when such an event arise.

Definition at line 91 of file SceneNode.cs.

The documentation for this class was generated from the following files:

- D:/guillaume/guillara/3D/DXGfx/Backup/DXGfxLib/SceneNode.cs
- D:/guillaume/guillara/3D/DXGfx/DXGfxLib/SceneNode.cs