jit.gl.picker Reference

Mouse picking in an opengl context

jit.gl.picker

Description

The jit.gl.picker object responds to mouse interaction in the destination by reporting the name of jit.gl (OB3D) objects intersecting with the mouse.

Examples

Mouse picking in an opengl context

Discussion

This object requires one argument: the name of a drawing context. A named drawing context is a named instance of a jit.window, jit.pwindow, or jit.matrix object that has an instance of the jit.gl.render object associated with it. Additionally it can reference the name of a jit.gl.node sub-context. This value may also be set via the OB3D drawto attribute. If no argument is present, the object is implicitly added to the first valid drawing context or sub-context found in the current patch or by searching up the patcher hierarchy.

Attributes

filters [10 symbols]

Specify a list of filterclass names that can be picked (default = all). Possible values include all and default . Additional values include any user-specified filterclass names (maximum allowed = 10).

hover [int]

Enable mouse hovering (default = 1)

ui_priority [int]

UI priority value (default = -1000). When multiple UI objects are listening to the same window, ui_priority determines the order objects receive input. Lower values test first.

Common Box Attributes

OB3D Attributes

Messages

touch

Arguments

screen-x [long]
screen-y [long]
Detect and report object intersections from screen coordinate args. If an intersection is detected, the dump outlet outputs the object name.

touch_ray

Arguments

x-from [float]
y-from [float]
z-from [float]
x-to [float]
y-to [float]
z-to [float]
Detect and report object intersections from ray coordinate args. The first 3 args set the ray start position, and the last 3 set the ray end. If an intersection is detected, the dump outlet outputs the object name.

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
jit.phys.picker
jit.gl.handle