abstract class Tinman.Terrain.Util.SpatialOctree
<TEntity val>
<TEntityTrait ref : ISpatialEntityTrait<TEntity, Box3D>>
<TDistanceTrait val : ISpatialDistanceTrait<TEntity, Vec3D>>
<TPickTrait val : ISpatialPickTrait<TEntity>>

Derived from

SpatialTree<TEntity, Box3D, Vec3D, TEntityTrait, SpatialOctree_Bounds, TDistanceTrait> abstract

Abstract base class for spatial octrees.

Public / Methods


public method Pick → (4)

ray in : Ray

The ray.

vertices out : Vec3I

Vertex indices that describe the location of the picked spatial entity feature.

weights out : Vec3D

Location of the picked spatial entity feature, given as relative weights (i.e. the weight sum is 1) of vertices out. The weights are sorted in descending order, i.e. Vec3D.X always holds the greatest weight and Vec3D.Z always holds the smallest weight.

nearest opt : float64 = Maths.MaxDouble

The maximum value to return.

returns → float64

The distance to the picked entity along the ray. Will be Maths.MaxDouble if the ray did not intersect with any entity.

Picks the nearest entity that intersects with the given ray.

Protected / Constructors


protected constructor SpatialOctree → (3)

entityTrait in : TEntityTrait

The entity trait.

distanceTrait in : TDistanceTrait

The distance trait.

pickTrait in : TPickTrait

The pick trait.

Creates a new instance of SpatialOctree.