![]() |
Leap Motion C++ API Reference
0.8.0
|
The InteractionBox class represents a box-shaped region completely within the field of view of the Leap Motion controller. More...
Inherits Leap::Interface.
Public Member Functions | |
Vector | center () const |
The center of the InteractionBox in device coordinates (millimeters). | |
Vector | denormalizePoint (const Vector &normalizedPosition) const |
Converts a position defined by normalized InteractionBox coordinates into device coordinates in millimeters. | |
float | depth () const |
The depth of the InteractionBox in millimeters, measured along the z-axis. | |
float | height () const |
The height of the InteractionBox in millimeters, measured along the y-axis. | |
bool | isValid () const |
Reports whether this is a valid InteractionBox object. | |
Vector | normalizePoint (const Vector &position, bool clamp=true) const |
Normalizes the coordinates of a point using the interaction box. | |
bool | operator!= (const InteractionBox &) const |
Compare InteractionBox object inequality. | |
bool | operator== (const InteractionBox &) const |
Compare InteractionBox object equality. | |
std::string | toString () const |
A string containing a brief, human readable description of the InteractionBox object. | |
float | width () const |
The width of the InteractionBox in millimeters, measured along the x-axis. | |
Static Public Member Functions | |
static const InteractionBox & | invalid () |
Returns an invalid InteractionBox object. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const InteractionBox &) |
Writes a brief, human readable description of the InteractionBox object. | |
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.
Vector Leap::InteractionBox::center | ( | ) | const |
The center of the InteractionBox in device coordinates (millimeters).
This point is equidistant from all sides of the box.
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. |
float Leap::InteractionBox::depth | ( | ) | const |
The depth of the InteractionBox in millimeters, measured along the z-axis.
float Leap::InteractionBox::height | ( | ) | const |
The height of the InteractionBox in millimeters, measured along the y-axis.
|
static |
Returns an invalid InteractionBox object.
You can use the instance returned by this function in comparisons testing whether a given InteractionBox instance is valid or invalid. (You can also use the InteractionBox::isValid() function.)
bool Leap::InteractionBox::isValid | ( | ) | const |
Reports whether this is a valid InteractionBox object.
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. |
bool Leap::InteractionBox::operator!= | ( | const InteractionBox & | ) | const |
Compare InteractionBox object inequality.
Two InteractionBox objects are equal if and only if both InteractionBox objects represent the exact same InteractionBox and both InteractionBoxes are valid.
bool Leap::InteractionBox::operator== | ( | const InteractionBox & | ) | const |
Compare InteractionBox object equality.
Two InteractionBox objects are equal if and only if both InteractionBox objects represent the exact same InteractionBox and both InteractionBoxes are valid.
std::string Leap::InteractionBox::toString | ( | ) | const |
A string containing a brief, human readable description of the InteractionBox object.
float Leap::InteractionBox::width | ( | ) | const |
The width of the InteractionBox in millimeters, measured along the x-axis.
|
friend |
Writes a brief, human readable description of the InteractionBox object.