ISpatialTandemBoundsTrait

Description

[StaticTemplate]
interface Tinman.Terrain.Util.ISpatialTandemBoundsTrait
<TBounds val>
<TCoords val>
<TTransform in val>
<TResult in val>

Type trait for performing spatial tests between transformed node bodes during tandem-traversal over the entities in a pair of spatial trees.

Public / Methods

Bounds​Order


[Pure]
public method BoundsOrder → (6)

node in : int32

The parent tree node (first or second).

children in : int32 [ ]

The child indices of the tree.

bounds in : TBounds [ ]

The node bounds of the tree.

other in : TBounds

The bounds of the other node (first or second).

transform in : TTransform

The transformation from first to second.

firstOrSecond in : bool

Compute child order for first (true) or second (false)?

returns → int32

Bits 0.. 2 : index of 1st child.
Bits 3.. 5 : index of 2nd child.
Bits 6.. 8 : index of 3rd child.
Bits 9..11 : index of 4th child.
Bits 12..14 : index of 5th child.
Bits 15..17 : index of 6th child.
Bits 18..20 : index of 7th child.
Bits 21..23 : index of 8th child.

Computes the order in which the child nodes shall be visited for optimal performance.

Bounds​Test​Node


[Pure]
public method BoundsTestNode → (6)

first in : TBounds

The first spatial bounds.

second in : TBounds

The second spatial bounds.

transform in : TTransform

The transformation from first in to second in.

minimum in : TResult

The minimum result value.

maximum in : TResult

The maximum result value.

tolerance in : TResult

The result value tolerance.

returns → int32

-1 if result is always less than or equal minimum in,
0 if result is always greater than or equal to maximum in,
1 if tandem traversal shall continue with first in,
2 if tandem traversal shall continue with second in

Checks if the given pair of spatial nodes needs to be considered for tandem traversal.

Bounds​Test​Tree


[Pure]
public method BoundsTestTree → (8)

firstOrSecond in : bool

true if bounds in is first,
false if bounds in is second.

bounds in : TBounds

The first spatial bounds.

tree in : SpatialTree_Coords<TBounds, TCoords>

The second spatial tree.

node in : int32

The tree node.

transform in : TTransform

The transformation from first to second.

minimum in : TResult

The minimum result value.

maximum in : TResult

The maximum result value.

tolerance in : TResult

The result value tolerance.

returns → int32

-1 if result is always less than or equal minimum in,
0 if result is always greater than or equal to maximum in,
1 if tandem traversal shall continue

Checks if the given pair of spatial nodes needs to be considered for tandem traversal.