ISceneQueryT Method |
Namespace: DigitalRune.Graphics.SceneGraph
T Query<T>( SceneNode referenceNode, RenderContext context ) where T : class, new(), ISceneQuery
Exception | Condition |
---|---|
ArgumentNullException | referenceNode is . |
This method can be used to query scene nodes, e.g. all scene nodes that touch the camera frustum, or all lights that shine on the reference node. This method performs efficient culling, e.g. if the reference node is a camera node it uses frustum culling to quickly find all nodes that touch the camera frustum and to reject nodes outside of the frustum.
Disabled scene nodes (see property IsEnabled) are ignored in scene queries and should not show up in query results.
The scene caches the most recent results of each query type: If QueryT(SceneNode, RenderContext) is called several times per frame for the same query type and reference node, then only the first call performs work and the other calls return the cached result of the first call. If the method is called again with the same query type but a different reference node, then the cache is cleared and the new query is executed. This also means that the result of the first call is no longer available.