interface Tinman.Engine.Models.ISpatialQuery

Extended by

TerrainModel sealed

Base interface for classes that provide spatial queries.

Usually, a ISpatialQuery object represents some spatial entity, for example a 3D model, which may have a hierarchical structure.

Public / Methods


public method CanCollideWith → (1)

other in : ISpatialQuery

The object to collide with.

returns → bool

true if CollideWith may be used to detect collisions,
false if collision detection is not supported for the given object.

Checks if this object can collide with the given one.


public method CollideWith → (5)

other in : ISpatialQuery

THe object to collide with.

transform in : AffineTransform

The transformation from this object (first) to the given other in one (second).

feedback opt : ICollector<Collision> = null

Optional collector that will consume pairs of colliding spatial objects. Once the ICollector.Add method has returned false, this method not perform any more callbacks.

nearest opt : float64 = 0

Spatial objects are considered to collide if their spatial distance is less than or equal to this value. Will be clamped to RangeD.Pos.

farthest opt : float64 = 0

This is the maximum value that will be returned by this method. It will be clamped to nearest opt plus one ULP (see Maths.Ulp). Performance will usually degrade with higher values.

returns → Collision

The collision result. Will be Collision.None if there is no collision.

Performs collision detection between this object and the given one.


public method DistanceTo → (2)

point in : Vec3D

A point, in model-space.

nearest opt : float64 = Maths.MaxDouble

The maximum distance value to return.

returns → float64

The smallest distance.

Computes the smallest distance from the given point to the model surface.


public method PickRay → (4)

ray in : Ray

The ray.

point out : Vec3D

Output for picked point on the model surface.

normal out : Vec3D

The model surface normal vector at the picked point out.

nearest opt : float64 = Maths.MaxDouble

The maximum distance value to return.

returns → bool

true if a point has been picked,
false if the ray does not intersect with the model surface.

Picks the point on the model surface that intersects with the given ray.

If there are multiple intersection points, the nearest one to Ray.Origin is returned.


public method SpatialChildAt → (1)

index in : int32

The child index.

returns → ISpatialQuery

The index in-th child.

Returns the index in-th child.

Public / Attributes


public attribute SpatialChildCount → (get)

value : int32

The child count.

Returns the number of children.