Leap Motion Java API Reference  0.8.0
com.leapmotion.leap.InteractionBox Class Reference

The InteractionBox class represents a box-shaped region completely within the field of view of the Leap Motion controller. More...

Inherits com.leapmotion.leap.Interface.

Public Member Functions

Vector center ()
 The center of the InteractionBox in device coordinates (millimeters).
 
Vector denormalizePoint (Vector normalizedPosition)
 Converts a position defined by normalized InteractionBox coordinates into device coordinates in millimeters.
 
float depth ()
 The depth of the InteractionBox in millimeters, measured along the z-axis.
 
boolean equals (InteractionBox arg0)
 Compare InteractionBox object equality.
 
float height ()
 The height of the InteractionBox in millimeters, measured along the y-axis.
 
boolean isValid ()
 Reports whether this is a valid InteractionBox object.
 
Vector normalizePoint (Vector position, boolean clamp)
 Normalizes the coordinates of a point using the interaction box.
 
Vector normalizePoint (Vector position)
 Normalizes the coordinates of a point using the interaction box.
 
String toString ()
 A string containing a brief, human readable description of the InteractionBox object.
 
float width ()
 The width of the InteractionBox in millimeters, measured along the x-axis.
 

Static Public Member Functions

static InteractionBox invalid ()
 Returns an invalid InteractionBox object.
 

Detailed Description

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.

Leap_InteractionBox.png

The InteractionBox region is defined by a center and dimensions along the x, y, and z axes.

Member Function Documentation

Vector com.leapmotion.leap.InteractionBox.center ( )

The center of the InteractionBox in device coordinates (millimeters).

This point is equidistant from all sides of the box.

Returns
The InteractionBox center in device coordinates.
Vector com.leapmotion.leap.InteractionBox.denormalizePoint ( Vector  normalizedPosition)

Converts a position defined by normalized InteractionBox coordinates into device coordinates in millimeters.

This function performs the inverse of normalizePoint().

Parameters
normalizedPositionThe input position in InteractionBox coordinates.
Returns
The corresponding denormalized position in device coordinates.
float com.leapmotion.leap.InteractionBox.depth ( )

The depth of the InteractionBox in millimeters, measured along the z-axis.

Returns
The InteractionBox depth in millimeters.
boolean com.leapmotion.leap.InteractionBox.equals ( InteractionBox  arg0)

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.

float com.leapmotion.leap.InteractionBox.height ( )

The height of the InteractionBox in millimeters, measured along the y-axis.

Returns
The InteractionBox height in millimeters.
static InteractionBox com.leapmotion.leap.InteractionBox.invalid ( )
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.)

Returns
The invalid InteractionBox instance.
boolean com.leapmotion.leap.InteractionBox.isValid ( )

Reports whether this is a valid InteractionBox object.

Returns
True, if this InteractionBox object contains valid data.
Vector com.leapmotion.leap.InteractionBox.normalizePoint ( Vector  position,
boolean  clamp 
)

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.

Parameters
positionThe input position in device coordinates.
clampWhether or not to limit the output value to the range [0,1] when the input position is outside the InteractionBox. Defaults to true.
Returns
The normalized position.
Vector com.leapmotion.leap.InteractionBox.normalizePoint ( Vector  position)

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.

Parameters
positionThe input position in device coordinates.
clampWhether or not to limit the output value to the range [0,1] when the input position is outside the InteractionBox. Defaults to true.
Returns
The normalized position.
String com.leapmotion.leap.InteractionBox.toString ( )

A string containing a brief, human readable description of the InteractionBox object.

Returns
A description of the InteractionBox as a string.
float com.leapmotion.leap.InteractionBox.width ( )

The width of the InteractionBox in millimeters, measured along the x-axis.

Returns
The InteractionBox width in millimeters.