OctTree and moving objects
#4
Yes, OctTree is automatically generated by DXEngine when a mesh have a lot of triangles.

By default, OctTree is generated when the number of positions in more than 512. You can change that with MainDXViewportView.DXScene.DXHitTestOptions.MeshPositionsCountForOctTreeGeneration (the DXHitTestOptions also has some other properties that control the generation of OctTree).

In DXEngine the OctTree is used by the Ab3d.DirectX.Models.DXMeshGeometry3D class that is created from the WPF's MeshGeometry3D. The OctTree is set to the DXMeshGeometry3D.OctTree property.

But you can also use OctTree by yourself - as shown in the mentioned sample (ObjectSelectionWithSubMeshes), you can create it from a vertex and an index buffer or any other definition of triangles. After you create it, you can call HitTest method on OctTree.
Andrej Benedik
  


Messages In This Thread
OctTree and moving objects - by janovrom - 04-20-2020, 04:23 PM
RE: OctTree and moving objects - by abenedik - 04-21-2020, 11:30 AM
RE: OctTree and moving objects - by janovrom - 04-21-2020, 11:59 AM
RE: OctTree and moving objects - by abenedik - 04-24-2020, 11:14 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)