TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface ISpatialQuery in Tinman.Engine.Models

Base interface for classes that provide spatial queries.

interface ISpatialQuery base of IModelCollider
  TerrainModel

Methods

DistanceTo

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

method DistanceTo (Vec3D point, float64 nearest = Maths.MaxDouble)
type float64
params point A point, in model-space.
  nearest The maximum distance value to return. Defaults to MaxDouble.
returns [>=0] The smallest distance.

PickRay

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

method PickRay (Ray ray, out Vec3D point, out Vec3D normal, float64 nearest = Maths.MaxDouble)
type bool
params ray The ray.
  point Output for picked point on the model surface.
  normal The model surface normal vector at the picked point.
  nearest The maximum distance value to return. Defaults to MaxDouble.
returns true if a point has been picked,
false if the ray does not intersect with the model surface.

Remarks:

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