Click or drag to resize
AB4D logo

MeshOctTreeNode Class

MeshOctTreeNode class represents one node in a MeshOctTree data structure. Each node represents its part of the 3D space that is defined by the BoundingBox. The node contains triangles that can be fully fitted into node's BoundingBox (and do not find in any of the child nodes). Each node (except the nodes on the MaxNodeLevel) can have up to 8 child MeshOctTreeNodes (number can be lower in case some nodes does not contain any triangles).
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXMeshOctTreeNode
    Ab3d.DirectXOctTreeNode

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class MeshOctTreeNode

The MeshOctTreeNode type exposes the following members.

Constructors
 NameDescription
Public methodMeshOctTreeNode Creates an instance of MeshOctTreeNode
Top
Methods
 NameDescription
Public methodAddTriangle Adds a triangle with the specified triangleBoundingBox and index to this or any child node.
Public methodStatic memberCollectBoundingBoxesInLevel CollectBoundingBoxesInLevel is a diagnostics method and fills the boundingBoxes list with bounding boxes from child nodes.
Public methodStatic memberCollectNodesCountInLevel CollectNodesCountInLevel is a diagnostics method and returns the number of nodes (MeshOctTreeNode objects) in the specified targetNodeLevel level.
Public methodStatic memberCollectNodesTrianglesCountInLevel CollectNodesTrianglesCountInLevel is a diagnostics method and fills a list of triangles count as int values with number of triangles in each node
Public methodGetAllHitResults Hit test a ray against the triangles in this and child MeshOctTreeNodes and adds all hit result int the specified hitResults list.
Public methodStatic memberGetTrianglesCountInLevel Gets number of triangles in the specified node and its child nodes.
Public methodHitTest Hit test a ray against the triangles in this and child MeshOctTreeNodes and returns the closest hit result.
Public methodOptimize Optimize method optimizes this oct tree node and its child nodes. It is possible to remove empty child nodes and in case of a single child node move its triangles to this node. This method is automatically called from the MeshOctTree constructor.
Top
Fields
 NameDescription
Public fieldActualBoundingBox Bounding box created from actually containing positions
Public fieldChildNodes List of child MeshOctTreeNode objects. The number of child MeshOctTreeNode objects can be lower then 8 when Optimize(Boolean, Boolean) method is called to remove empty MeshOctTreeNode objects.
Public fieldHasChildTriangles Boolean value that specifies if this MeshOctTree has any child triangles (set to true the first time the AddTriangle(Int32, BoundingBox) method is called).
Public fieldNodeBoundingBox BoundingBox of this node (calculated as 1/8 part of its parent)
Public fieldNodeLevel level of this node (level 1 is the first level)
Public fieldParentMashOctTree Parent MeshOctTree
Public fieldTriangleIndexes List of triangle indexes that are contained in this MeshOctTreeNode. To get the index of triangle indice in the TriangleIndicesArray, multiplying the values from this list with 3.
Top
See Also