interface Tinman.Terrain.Util.ISpatialPickTrait<TEntity in val>

Type trait for ray-picking entities in a spatial tree.

Public / Methods


public method ComputePick → (5)

ray in : Ray

The ray.

distance in : float64

The current nearest distance.

entity in : TEntity

The spatial entity.

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.

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 feature of the given spatial entity.