Extends the Leap Motion Vector class to converting points and directions from the Leap Motion coordinate system into the Unity coordinate system.
Public MembersPublic Static Functionsconst float INPUT_SCALE
Scale factor from Leap units (millimeters) to Unity units (meters).
Public Static AttributesVector3 ToUnity(this Vector leap_vector, bool mirror = false)Converts a direction vector from Leap to Unity.
(Does not scale.)
Changes from the Leap Motion right-hand coordinate convention to the Unity left-handed convention by negating the z-coordinate.
- Parameters
- mirror -
If true, the vector is reflected along the z axis.
- leap_vector -
the Leap.Vector object to convert.
Vector3 ToUnityScaled(this Vector leap_vector, bool mirror = false)Converts a point from Leap to Unity.
(Scales.)
Changes from the Leap Motion right-hand coordinate convention to the Unity left-handed convention by negating the z-coordinate. Also scales from Leap Motion millimeter units to Unity meter units by multiplying the vector by .001.
- Parameters
- mirror -
If true, the vector is reflected along the z axis.
- leap_vector -
the Leap.Vector object to convert.
readonly Vector3 Z_FLIP
Constant used when converting from right-handed to left-handed axes.
Extends the Leap Mition Matrix class to convert Leap Matrix objects to to Unity Quaternion rotations and translations.
Public Static FunctionsPublic Static AttributesQuaternion Rotation(this Matrix matrix, bool mirror = false)Converts a Leap Matrix object representing a rotation to a Unity Quaternion.
- Parameters
- matrix -
The Leap.Matrix to convert.
- mirror -
If true, the operation is reflected along the z axis.
Vector3 Translation(this Matrix matrix, bool mirror = false)Converts a Leap Matrix object representing a translation to a Unity Vector3 object.
- Parameters
- matrix -
The Leap.Matrix to convert.
- mirror -
If true, the operation is reflected along the z axis.
readonly Vector LEAP_FORWARD
Forward in the Leap coordinate system.
readonly Vector LEAP_ORIGIN
The origin point in the Leap coordinate system.
readonly Vector LEAP_UP
Up in the Leap coordinate system.