Class ScenePicker
Namespace: ValveResourceFormat.Renderer.Editor.Picking
Assembly: Renderer.dll
Turns clicks into picks. Requests can come from any thread and are queued; the render thread draws the object id pass once for all of them, and hands each result to the viewer at the end of the frame.
public sealed class ScenePickerInheritance
object ← ScenePicker
Constructors
ScenePicker(RendererContext, Action<PickResult>)
Creates the picking framebuffer.
public ScenePicker(RendererContext rendererContext, Action<PickResult> onPicked)Parameters
rendererContext RendererContext
Renderer context for loading shaders.
onPicked Action<PickResult>
Called on the render thread with each result.
Properties
Enabled
Gets or sets whether picking is available. Requests made while disabled are dropped.
public bool Enabled { get; set; }Property Value
bool
HasPendingRequests
Gets whether a request is waiting for the next frame.
public bool HasPendingRequests { get; }Property Value
bool
Texture
Gets the framebuffer the object id pass is drawn into.
public PickingTexture Texture { get; }Property Value
Methods
Delete()
Deletes the picking framebuffer.
public void Delete()DispatchResults()
Hands the results read back by ScenePicker.Render(Renderer, RenderContext) to the viewer, in the order they were requested.
public void DispatchResults()Render(Renderer, RenderContext)
Draws the object id pass if any pick is pending, and reads back every pending point.
public void Render(Renderer renderer, Scene.RenderContext renderContext)Parameters
renderer Renderer
The renderer that draws the scenes.
renderContext Scene.RenderContext
The frame's render context, which the pass replaces the shader and target of.
Request(PickRequest)
Queues a pick to be resolved on the next frame.
public void Request(PickRequest request)Parameters
request PickRequest
The point to pick and what for.
Resize(int, int)
Resizes the picking framebuffer to the viewport.
public void Resize(int width, int height)Parameters
width int
Viewport width in pixels.
height int
Viewport height in pixels.

