PixelLightAPI  .
Public Member Functions | Protected Member Functions | Protected Attributes
PLScene::SceneHierarchyNode Class Reference

Abstract scene hierarchy node class. More...

#include <SceneHierarchyNode.h>

Inheritance diagram for PLScene::SceneHierarchyNode:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLS_API SceneContextGetSceneContext () const
 Returns the scene context the scene hierarchy node is in.
PLS_API SceneHierarchyGetHierarchy () const
 Returns the owner scene hierarchy.
PLS_API SceneHierarchyNodeGetParentNode () const
 Returns the parent scene hierarchy node.
PLS_API PLCore::uint32 GetID () const
 Returns the unique ID of the scene hierarchy node.
PLS_API PLCore::uint8 GetLevel () const
 Returns the level/tree depth of the scene hierarchy node.
PLS_API const
PLMath::AABoundingBox
GetAABoundingBox () const
 Returns the axis aligned bounding box of the scene hierarchy node.
PLS_API bool CheckLine (const PLMath::Line &cLine) const
 Checks whether the scene hierarchy node volume is intersecting the given line.
PLS_API bool CheckPlaneSet (const PLMath::PlaneSet &cPlaneSet, PLCore::uint32 *pnOutClipMask=nullptr) const
 Checks whether the scene hierarchy node volume is within the given plane set.
PLS_API char GetPlaneSide (const PLMath::Plane &cPlane) const
 Returns the side of the plane the scene hierarchy node volume is on.
PLS_API float GetShortestDistance (const PLMath::Vector3 &vPoint) const
 Returns the shortest distance from a given point to the scene hierarchy node volume.
PLS_API PLCore::uint32 GetNumOfItems () const
 Returns the number of scene hierarchy node items.
PLS_API SceneHierarchyNodeItemGetFirstItem () const
 Returns the first scene hierarchy node item.
virtual void Touch (bool bRecursive=false)=0
 Touches the scene hierarchy scene node.
virtual PLCore::uint32 GetNumOfNodes () const =0
 Returns the number of child scene hierarchy nodes.
virtual SceneHierarchyNodeGetNode (PLCore::uint32 nIndex) const =0
 Returns a child scene hierarchy node.

Protected Member Functions

PLS_API SceneHierarchyNode (SceneHierarchy &cHierarchy)
 Constructor.
virtual PLS_API ~SceneHierarchyNode ()
 Destructor.
PLS_API SceneHierarchyNodeGetFreeNode ()
 Returns a free scene hierarchy node.
PLS_API void FreeNode (SceneHierarchyNode &cNode)
 Marks a scene hierarchy node as free.
virtual PLS_API void Init ()
 Initializes the scene hierarchy node variables.

Protected Attributes

SceneHierarchym_pHierarchy
SceneHierarchyNodem_pParentNode
PLCore::uint32 m_nID
PLCore::uint8 m_nLevel
PLMath::AABoundingBox m_cAABoundingBox
PLCore::uint32 m_nNumOfItems
SceneHierarchyNodeItemm_pFirstItem

Detailed Description

Abstract scene hierarchy node class.

Remarks:
A scene hierarchy node can contain multiple scene hierarchy node items.

Constructor & Destructor Documentation

PLS_API PLScene::SceneHierarchyNode::SceneHierarchyNode ( SceneHierarchy cHierarchy) [protected]

Constructor.

Parameters:
[in]cHierarchyThe owner hierarchy
virtual PLS_API PLScene::SceneHierarchyNode::~SceneHierarchyNode ( ) [protected, virtual]

Destructor.


Member Function Documentation

Returns the scene context the scene hierarchy node is in.

Returns:
The scene context the scene hierarchy node is in, can but shouldn't be a null pointer

Returns the owner scene hierarchy.

Returns:
The owner scene hierarchy (NEVER a null pointer!)

Returns the parent scene hierarchy node.

Returns:
The parent scene hierarchy node, if a null pointer, this is the root
PLS_API PLCore::uint32 PLScene::SceneHierarchyNode::GetID ( ) const

Returns the unique ID of the scene hierarchy node.

Returns:
The unique ID of the scene hierarchy node
Remarks:
Some scene queries may need to hold some extra information per scene hierarchy node. In such cases, an unique node ID is quite useful to manage this information within for instance an array. SQCull for example may cache scene hierarchy node visibility information from the previous frame for the coherent hierarchical occlusion culling algorithm. In order to keep this unique node ID system working, ONLY SceneHierarchy::GetFreeNode() and SceneHierarchy::FreeNode() are used during runtime instead of new/delete. Have a look at the SceneHierarchy::GetFreeNode() documentation for more information about this.
PLS_API PLCore::uint8 PLScene::SceneHierarchyNode::GetLevel ( ) const

Returns the level/tree depth of the scene hierarchy node.

Returns:
The level/tree depth of the scene hierarchy node

Returns the axis aligned bounding box of the scene hierarchy node.

Returns:
The axis aligned bounding box of the scene hierarchy node
PLS_API bool PLScene::SceneHierarchyNode::CheckLine ( const PLMath::Line cLine) const

Checks whether the scene hierarchy node volume is intersecting the given line.

Parameters:
[in]cLineLine to check against
Returns:
'false' if the scene hierarchy node volume is not intersecting the given line, else 'true'
PLS_API bool PLScene::SceneHierarchyNode::CheckPlaneSet ( const PLMath::PlaneSet cPlaneSet,
PLCore::uint32 *  pnOutClipMask = nullptr 
) const

Checks whether the scene hierarchy node volume is within the given plane set.

Parameters:
[in]cPlaneSetPlane set to check against
[out]pnOutClipMaskIf not a null pointer, this clip mask will receive the intersection state of a maximum number of 32 planes if the box intersects the plane set.
Returns:
'false' if the scene hierarchy node volume is not within the given plane set, else 'true'
PLS_API char PLScene::SceneHierarchyNode::GetPlaneSide ( const PLMath::Plane cPlane) const

Returns the side of the plane the scene hierarchy node volume is on.

Parameters:
[in]cPlanePlane to check against
Returns:
'-1' if of scene hierarchy node volume is behind the plane, '0' if it is intersecting the plane, '1' if the volume is in front of the plane
PLS_API float PLScene::SceneHierarchyNode::GetShortestDistance ( const PLMath::Vector3 vPoint) const

Returns the shortest distance from a given point to the scene hierarchy node volume.

Parameters:
[in]vPointPoint to get the shortest distance from
Returns:
Shortest distance (squared) from the given point to the scene hierarchy node volume
PLS_API PLCore::uint32 PLScene::SceneHierarchyNode::GetNumOfItems ( ) const

Returns the number of scene hierarchy node items.

Returns:
The number of scene hierarchy node items

Returns the first scene hierarchy node item.

Returns:
The first scene hierarchy node item, a null pointer if there are no items
Note:
virtual void PLScene::SceneHierarchyNode::Touch ( bool  bRecursive = false) [pure virtual]

Touches the scene hierarchy scene node.

Parameters:
[in]bRecursiveTouch recursive?
Remarks:
Scene node distribution (splitt/merge) within the scene hierarchy is only performed if this function is called. If during for instance a visibility determination a scene hierarchy node is used the first time during this process, one should call this 'touch' function to inform the scene hierarchy that this scene hierarchy node is going to be used. This function will split a scene hierarchy node if certain conditions like a maximum number of items per scene hierarchy node are given. If other conditions are given a merge operation is performed which 'combines' scene hierarchy nodes instead of splitting them. As result of this function, normally only the scene hierarchy parts which are currently used will be updated. ("lazy evaluation" :) If 'bRecursive' is set to true, all child nodes are touched to - but this may only be useful for instance when initializing the scene hierarchy.

Implemented in PLScene::SHKdTreeNode, and PLScene::SHListNode.

virtual PLCore::uint32 PLScene::SceneHierarchyNode::GetNumOfNodes ( ) const [pure virtual]

Returns the number of child scene hierarchy nodes.

Returns:
The number of child scene hierarchy nodes

Implemented in PLScene::SHKdTreeNode, and PLScene::SHListNode.

virtual SceneHierarchyNode* PLScene::SceneHierarchyNode::GetNode ( PLCore::uint32  nIndex) const [pure virtual]

Returns a child scene hierarchy node.

Parameters:
[in]nIndexIndex of the requested child scene hierarchy node
Returns:
The requested child scene hierarchy node, a null pointer on error

Implemented in PLScene::SHKdTreeNode, and PLScene::SHListNode.

Returns a free scene hierarchy node.

Returns:
Free scene hierarchy node
Remarks:
This function will return a free scene hierarchy node. If there are no free nodes available, a new one is created. After a node is no longer required it is put into the list of free nodes by using FreeNode() instead of destroying it. This way, frequently creation and destruction of nodes is avoided and the management of the unique node ID's becomes quite simple. See SceneHierarchyNode::GetID() for more information about the unique node ID's.
PLS_API void PLScene::SceneHierarchyNode::FreeNode ( SceneHierarchyNode cNode) [protected]

Marks a scene hierarchy node as free.

Parameters:
[in]cNodeScene hierarchy node to mark as free
See also:
virtual PLS_API void PLScene::SceneHierarchyNode::Init ( ) [protected, virtual]

Initializes the scene hierarchy node variables.


Member Data Documentation

Owner hierarchy (always valid!)

Parent scene hierarchy node, can be a null pointer

PLCore::uint32 PLScene::SceneHierarchyNode::m_nID [protected]

The unique ID of the scene hierarchy node

PLCore::uint8 PLScene::SceneHierarchyNode::m_nLevel [protected]

Scene hierarchy node level

Axis aligned bounding box of this scene hierarchy node

PLCore::uint32 PLScene::SceneHierarchyNode::m_nNumOfItems [protected]

The number of scene hierarchy node items attached to this scene hierarchy node

The first scene hierarchy node item, can be a null pointer


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:24
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported