Click or drag to resize
AB4D logo

DXMeshGeometry3DCreateOctTree Method

CreateOctTree returns a MeshOctTree that is created from the mesh defined in this DXMeshGeometry3D. This method must be called after the DXMeshGeometry3D has been initialized (added to DXScene or after InitializeResources method is called).

Namespace: Ab3d.DirectX.Models
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public MeshOctTree CreateOctTree(
	int maxNodeLevel = 4,
	float expandChildBoundingBoxes = 0,2f
)

Parameters

maxNodeLevel  Int32  (Optional)
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.
expandChildBoundingBoxes  Single  (Optional)
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).

Return Value

MeshOctTree
created MeshOctTree

Implements

IOctTreeMeshCreateOctTree(Int32, Single)
Remarks

CreateOctTree returns a MeshOctTree that is created from the mesh defined in this DXMeshGeometry3D.

This method must be called after the DXMeshGeometry3D has been initialized (added to DXScene or after InitializeResources method is called).

Note: this method does not set the OctTree property on this DXMeshGeometry3D.

See Also