Click or drag to resize
DigitalRuneSceneQueryT Method
Gets the scene nodes that touch the specified reference node.

Namespace: DigitalRune.Graphics.SceneGraph
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public T Query<T>(
	SceneNode referenceNode,
	RenderContext context
)
where T : class, new(), ISceneQuery

Parameters

referenceNode
Type: DigitalRune.Graphics.SceneGraphSceneNode
The reference node. Must not be .
context
Type: DigitalRune.GraphicsRenderContext
The render context.

Type Parameters

T
The type of query (see ISceneQuery) that should be executed.

Return Value

Type: T
The ISceneQuery object containing the result of the query.

Implements

ISceneQueryT(SceneNode, RenderContext)
Exceptions
ExceptionCondition
ArgumentNullExceptionreferenceNode is .
Remarks

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.

See Also