Click or drag to resize
Ab4d.SharpEngine logo

MeshOctreeNode Class

MeshOctreeNode class represents one node in a MeshOctree 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 MeshOctreeNodes (number can be lower in case some nodes does not contain any triangles).
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.UtilitiesMeshOctreeNode

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.2.9386+3a404a3e1ebfa4efd231da7fe6f10dfb23b95dc4
Syntax
C#
public class MeshOctreeNode

The MeshOctreeNode type exposes the following members.

Constructors
 NameDescription
Public methodMeshOctreeNode Creates an instance of MeshOctreeNode
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 (MeshOctreeNode 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 MeshOctreeNodes 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 MeshOctreeNodes and returns the closest hit result.
Public methodOptimize Optimize method optimizes this octree 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 MeshOctree constructor.
Top
Fields
 NameDescription
Public fieldActualBoundingBox Bounding box created from actually containing positions
Public fieldChildNodes List of child MeshOctreeNode objects. The number of child MeshOctreeNode objects can be lower than 8 when Optimize(Boolean, Boolean) method is called to remove empty MeshOctreeNode objects.
Public fieldHasChildTriangles Boolean value that specifies if this MeshOctree 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 fieldParentMashOctree Parent MeshOctree
Public fieldTriangleIndexes List of triangle indexes that are contained in this MeshOctreeNode. To get the index of triangle index in the TriangleIndicesArray, multiplying the values from this list with 3.
Top
Remarks

[Missing <remarks> documentation for "T:Ab4d.SharpEngine.Utilities.MeshOctreeNode"]

See Also