#include <Leap.h>
Public Types | |
enum | Type { TYPE_METACARPAL = 0, TYPE_PROXIMAL = 1, TYPE_INTERMEDIATE = 2, TYPE_DISTAL = 3 } |
Public Member Functions | |
def | __eq__ (self, arg2) |
def | __init__ (self) |
def | __ne__ (self, arg2) |
def | __str__ (self) |
LEAP_EXPORT Matrix | basis () const |
Bone (BoneImplementation *) | |
LEAP_EXPORT | Bone () |
LEAP_EXPORT Vector | center () const |
LEAP_EXPORT Vector | direction () const |
LEAP_EXPORT bool | isValid () const |
LEAP_EXPORT float | length () const |
LEAP_EXPORT Vector | nextJoint () const |
LEAP_EXPORT bool | operator!= (const Bone &) const |
LEAP_EXPORT bool | operator== (const Bone &) const |
LEAP_EXPORT Vector | prevJoint () const |
std::string | toString () const |
LEAP_EXPORT Type | type () const |
LEAP_EXPORT float | width () const |
Public Member Functions inherited from Leap::Interface | |
def | __init__ (self, args, kwargs) |
Static Public Member Functions | |
static LEAP_EXPORT const Bone & | invalid () |
Public Attributes | |
this | |
Static Public Attributes | |
basis = _swig_property(LeapPython.Bone_basis_get) | |
center = _swig_property(LeapPython.Bone_center_get) | |
direction = _swig_property(LeapPython.Bone_direction_get) | |
is_valid = _swig_property(LeapPython.Bone_is_valid_get) | |
length = _swig_property(LeapPython.Bone_length_get) | |
next_joint = _swig_property(LeapPython.Bone_next_joint_get) | |
prev_joint = _swig_property(LeapPython.Bone_prev_joint_get) | |
type = _swig_property(LeapPython.Bone_type_get) | |
TYPE_DISTAL = LeapPython.Bone_TYPE_DISTAL | |
TYPE_INTERMEDIATE = LeapPython.Bone_TYPE_INTERMEDIATE | |
TYPE_METACARPAL = LeapPython.Bone_TYPE_METACARPAL | |
TYPE_PROXIMAL = LeapPython.Bone_TYPE_PROXIMAL | |
width = _swig_property(LeapPython.Bone_width_get) | |
Private Member Functions | |
LEAP_EXPORT const char * | toCString () const |
Static Private Attributes | |
__getattr__ = lambdaself,name:_swig_getattr(self, Bone, name) | |
__repr__ = _swig_repr | |
__setattr__ = lambdaself,name,value:_swig_setattr(self, Bone, name, value) | |
__swig_destroy__ = LeapPython.delete_Bone | |
dictionary | __swig_getmethods__ = {} |
dictionary | __swig_setmethods__ = {} |
Friends | |
LEAP_EXPORT friend std::ostream & | operator<< (std::ostream &, const Bone &) |
Additional Inherited Members | |
Protected Member Functions inherited from Leap::Interface | |
template<typename T > | |
T * | get () const |
LEAP_EXPORT | Interface (void *owner) |
LEAP_EXPORT | Interface (Implementation *reference, void *owner) |
LEAP_EXPORT | Interface (const Interface &rhs) |
Interface (class SharedObject *object) | |
LEAP_EXPORT Interface & | operator= (const Interface &rhs) |
virtual LEAP_EXPORT | ~Interface () |
Static Protected Member Functions inherited from Leap::Interface | |
static LEAP_EXPORT void | deleteCString (const char *cstr) |
Protected Attributes inherited from Leap::Interface | |
class SharedObject * | m_object |
The Bone class represents a tracked bone.
All fingers contain 4 bones that make up the anatomy of the finger. Get valid Bone objects from a Finger object.
Bones are ordered from base to tip, indexed from 0 to 3. Additionally, the bone's Type enum may be used to index a specific bone anatomically.
The thumb does not have a base metacarpal bone and therefore contains a valid, zero length bone at that location.
Note that Bone objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical bone. Invalid Bone objects can be the result of asking for a Bone object from an invalid finger, indexing a bone out of range, or constructing a new bone. Test for validity with the Bone::isValid() function.
enum Leap::Bone::Type |
Enumerates the names of the bones.
Members of this enumeration are returned by Bone::type() to identify a Bone object.
Enumerator | |
---|---|
TYPE_METACARPAL |
Bone connected to the wrist inside the palm |
TYPE_PROXIMAL |
Bone connecting to the palm |
TYPE_INTERMEDIATE |
Bone between the tip and the base |
TYPE_DISTAL |
Bone at the tip of the finger |
Leap::Bone::Bone | ( | BoneImplementation * | ) |
LEAP_EXPORT Leap::Bone::Bone | ( | ) |
LEAP_EXPORT Matrix Leap::Bone::basis | ( | ) | const |
The orthonormal basis vectors for this Bone as a Matrix.
Basis vectors specify the orientation of a bone.
xBasis Perpendicular to the longitudinal axis of the bone; exits the sides of the finger.
yBasis or up vector Perpendicular to the longitudinal axis of the bone; exits the top and bottom of the finger. More positive in the upward direction.
zBasis Aligned with the longitudinal axis of the bone. More positive toward the base of the finger.
The bases provided for the right hand use the right-hand rule; those for the left hand use the left-hand rule. Thus, the positive direction of the x-basis is to the right for the right hand and to the left for the left hand. You can change from right-hand to left-hand rule by multiplying the z basis vector by -1.
You can use the basis vectors for such purposes as measuring complex finger poses and skeletal animation.
Note that converting the basis vectors directly into a quaternion representation is not mathematically valid. If you use quaternions, create them from the derived rotation matrix not directly from the bases.
LEAP_EXPORT Vector Leap::Bone::center | ( | ) | const |
The midpoint of the bone.
LEAP_EXPORT Vector Leap::Bone::direction | ( | ) | const |
The normalized direction of the bone from base to tip.
|
static |
Returns an invalid Bone object.
You can use the instance returned by this function in comparisons testing whether a given Bone instance is valid or invalid. (You can also use the Bone::isValid() function.)
LEAP_EXPORT bool Leap::Bone::isValid | ( | ) | const |
LEAP_EXPORT float Leap::Bone::length | ( | ) | const |
The estimated length of the bone in millimeters.
LEAP_EXPORT Vector Leap::Bone::nextJoint | ( | ) | const |
The end of the bone, closest to the finger tip.
In anatomical terms, this is the distal end of the bone.
LEAP_EXPORT bool Leap::Bone::operator!= | ( | const Bone & | ) | const |
LEAP_EXPORT bool Leap::Bone::operator== | ( | const Bone & | ) | const |
LEAP_EXPORT Vector Leap::Bone::prevJoint | ( | ) | const |
The base of the bone, closest to the wrist.
In anatomical terms, this is the proximal end of the bone.
|
private |
|
inline |
LEAP_EXPORT Type Leap::Bone::type | ( | ) | const |
The name of this bone.
LEAP_EXPORT float Leap::Bone::width | ( | ) | const |
The average width of the flesh around the bone in millimeters.
|
friend |
Writes a brief, human readable description of the Bone object to an output stream.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |