The InteractionBox class represents a box-shaped region completely within the field of view of the Leap Motion controller. More...
Public Member Functions | |
| Vector | DenormalizePoint (Vector normalizedPosition) |
| Converts a position defined by normalized InteractionBox coordinates into device coordinates in millimeters. More... | |
| bool | Equals (InteractionBox other) |
| Compare InteractionBox object equality. More... | |
| InteractionBox (Vector center, Vector size) | |
| Create an interaction box with a specxific size and center position. More... | |
| Vector | NormalizePoint (Vector position, bool clamp=true) |
| Normalizes the coordinates of a point using the interaction box. More... | |
| override string | ToString () |
| A string containing a brief, human readable description of the InteractionBox object. More... | |
Public Attributes | |
| Vector | Center |
| The center of the InteractionBox in device coordinates (millimeters). More... | |
| Vector | Size |
| The dimensions of the interaction box along each axis. More... | |
Properties | |
| float | Depth [get] |
| The depth of the InteractionBox in millimeters, measured along the z-axis. More... | |
| float | Height [get] |
| The height of the InteractionBox in millimeters, measured along the y-axis. More... | |
| bool | IsValid [get] |
| Reports whether this is a valid InteractionBox object. More... | |
| float | Width [get] |
| The width of the InteractionBox in millimeters, measured along the x-axis. More... | |
The InteractionBox class represents a box-shaped region completely within the field of view of the Leap Motion controller.
The interaction box is an axis-aligned rectangular prism and provides normalized coordinates for hands, fingers, and tools within this box. The InteractionBox class can make it easier to map positions in the Leap Motion coordinate system to 2D or 3D coordinate systems used for application drawing.
The InteractionBox region is defined by a center and dimensions along the x, y, and z axes.
Get an InteractionBox object from a Frame object.
| InteractionBox | ( | Vector | center, |
| Vector | size | ||
| ) |
Create an interaction box with a specxific size and center position.
| center | The midpoint of the box. |
| size | The dimensions of the box along each axis. |
Converts a position defined by normalized InteractionBox coordinates into device coordinates in millimeters.
This function performs the inverse of normalizePoint().
| normalizedPosition | The input position in InteractionBox coordinates. |
| bool Equals | ( | InteractionBox | other | ) |
Compare InteractionBox object equality.
Two InteractionBox objects are equal if and only if both InteractionBox objects are the same size, in the same position and both InteractionBoxes are valid.
Normalizes the coordinates of a point using the interaction box.
Coordinates from the Leap Motion frame of reference (millimeters) are converted to a range of [0..1] such that the minimum value of the InteractionBox maps to 0 and the maximum value of the InteractionBox maps to 1.
| position | The input position in device coordinates. |
| clamp | Whether or not to limit the output value to the range [0,1] when the input position is outside the InteractionBox. Defaults to true. |
| override string ToString | ( | ) |
A string containing a brief, human readable description of the InteractionBox object.
| Vector Center |
The center of the InteractionBox in device coordinates (millimeters).
This point is equidistant from all sides of the box.
| Vector Size |
The dimensions of the interaction box along each axis.
|
get |
The depth of the InteractionBox in millimeters, measured along the z-axis.
|
get |
The height of the InteractionBox in millimeters, measured along the y-axis.
|
get |
Reports whether this is a valid InteractionBox object.
|
get |
The width of the InteractionBox in millimeters, measured along the x-axis.
C# and Unity