|
MeshOctTree Class |
MeshOctTree class organizes the triangles in 3D space into multiple levels of
MeshOctTreeNode objects so that the search of a triangle or
check for triangle ray intersection is very efficient. Each MeshOctTreeNode divide its space into 8 child MeshOctTreeNode.
Inheritance Hierarchy Namespace: Ab3d.DirectXAssembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.1.9105.2048 (1.0.0.0)
Syntax The MeshOctTree type exposes the following members.
Constructors | Name | Description |
---|
| MeshOctTree(PositionNormalTexture, Int32, Int32, Single) |
Creates a new instance of MeshOctTree.
The instance is created with a standard vertex buffer format (an array of PositionNormalTexture).
If you need to create an MeshOctTree with an array of positions instead, then use the other constructor.
|
| MeshOctTree(Vector3, Int32, Int32, Single) |
Creates a new instance of MeshOctTree.
The instance is created with an array of positions (array of Vector3 values).
If you need to create an MeshOctTree with a standard vertex buffer format (an array of PositionNormalTexture) instead, then use the other constructor.
|
| MeshOctTree(PositionNormalTexture, Int32, BoundingBox, Int32, Single) |
Creates a new instance of MeshOctTree.
The instance is created with a standard vertex buffer format (an array of PositionNormalTexture).
If you need to create an MeshOctTree with an array of positions instead, then use the other constructor.
|
| MeshOctTree(Vector3, Int32, BoundingBox, Int32, Single) |
Creates a new instance of MeshOctTree.
The instance is created with an array of positions (array of Vector3 values).
If you need to create an MeshOctTree with a standard vertex buffer format (an array of PositionNormalTexture) instead, then use the other constructor.
|
TopMethods | Name | Description |
---|
| CollectBoundingBoxesInLevel |
CollectBoundingBoxesInLevel is a diagnostics method and returns a list of bounding boxes from child nodes.
|
| GetAllHitResults |
HitTest method executes a ray hit test on this oct tree and returns a list of DXRayHitTestResult with all the hit results sorted from the closest to the farthest.
If no triangle is hit, an empty list is returned.
To get only the closest hit results call method.
|
| GetNodesCountInAllLevels |
GetNodesCountInAllLevels is a diagnostics method and returns the number of child nodes (MeshOctTreeNode objects) in this MeshOctTree.
|
| GetNodesCountInLevel |
GetNodesCountInLevel is a diagnostics method and returns the number of nodes (MeshOctTreeNode objects) in the specified node level.
|
| GetNodeStatistics |
GetNodeStatistics is a diagnostics method and returns a string that describes the details about this MeshOctTree.
|
| GetTrianglesCountInLevel |
GetTrianglesCountInLevel is a diagnostics method and returns the number of triangles in the specified node and its child nodes.
|
| HitTest |
HitTest method executes a ray hit test on this oct tree and returns a DXRayHitTestResult with the closest triangle in this oct tree that is hit by the specified ray.
If not triangle is hit, null is returned.
To get all hit results call method.
|
TopFields | Name | Description |
---|
| ExpandChildBoundingBoxes |
ExpandChildBoundingBoxes is a float that defined how much the bounding boxes of node overlap.
By default the value is set to 0.2 - so each bounding box is extended for 20% (but it does not go out of the parent's bounding box).
This way the triangles that lay on node borders will be put into the child nodes instead of having them in the parent node (there we need to do a hit test every time).
|
| MaxNodeLevel |
Number of levels used for MeshOctTree - bigger number reduces the number of triangles in each node but increased the MeshOctTree initialization time and used memory. Default value is 4.
|
| RootNode |
Root MeshOctTreeNode
|
TopRemarks
MeshOctTree class organizes the triangles in 3D space into multiple levels of MeshOctTreeNode objects so that the search of a triangle or
check for triangle ray intersection is very efficient. Each MeshOctTreeNode divide its space into 8 child MeshOctTreeNode.
The number of levels (depth) is defined by the MaxNodeLevel that can be specified with the constructor.
Bigger number reduces the number of triangles in each node but increased the MeshOctTree initialization time and used memory.
See Also