interface Tinman.Engine.Scenes.ISceneQueryProvider

Extended by


Base interface for classes that provide scene queries.

Scene queries created via this interface will process the terrain (see IScene.Terrain) and all ISceneEntity objects that are present in IScene.Entities for which ISceneObject.Enabled returns true. Terrain objects that have been added via ITerrainEntityContainer will also be processed by spatial queries. However, terrain objects that have been added directly via TerrainMesh will not be processed.

If applicable, scene queries will additionally process all ISceneEntityView objects that are present in ISceneView.EntityViews for which ISceneObject.Enabled and ISceneEntityView.Visible return true.

Public / Methods


public method Query → (1)

operation in : ISceneQueryOp

The scene query operation to use.

returns → ISceneQuery

The created ISceneQuery object.

Creates a new instance of ISceneQuery.

Scene query objects are light-weight. However, it is advisable to re-use the same query object, while updating the scene query operation argument via ISceneQueryOpArg.Argument.


public method QueryDistance → (3)

point in : Vec3D

The point, in terrain-space.

nearest opt : float64 = Maths.MaxDouble

The nearest distance that has already been found.

mask opt : int64 = ~0

The spatial query filter mask.

returns → float64

The nearest distance. Will be equal to nearest opt if the spatial query has no result.

Performs a spatial query to find the nearest distance from the given point in to the terrain or scene object.

The nearest distance is computed in this order:

  1. By calling DistanceToGround.Compute1 of TerrainMesh.Distance, passing point in.

  2. By calling ISceneObject.QueryDistance on the scene entities in IScene.Entities.

  3. By calling ISceneObject.QueryDistance on the scene entity views in ISceneView.EntityViews.