A class that represents a hand. More...
#include <MultiTouch/MultiTouch.hpp>
Public Member Functions | |
| int | age () const |
| The age of the hand (the number of frames it has been around). More... | |
| Nimble::Rectf | bounds () const |
| The bounding box of this hand. More... | |
| Nimble::Rectf | bounds (const Nimble::Matrix3 &transform) const |
| The bounding box of this hand transformed by the given matrix. More... | |
| MultiTouch::Finger | findFinger (long id) const |
| Finds a finger with a given id. More... | |
| MultiTouch::Finger | finger (size_t n) const |
| Returns the nth finger. More... | |
| int | fingerCount () const |
| Get the number of fingers in the hand. More... | |
| Hand (const __Hand *self=0) | |
| Constructs a hand. More... | |
| TrackedObject::Id | id () const |
| The unique id for this hand. More... | |
| bool | isNull () const |
| Check if the hand is invalid. More... | |
| Nimble::Vector2f | motion (float *w=0) const |
| Calculates average motion of the fingers. More... | |
| Nimble::Vector2f | motion (const Nimble::Matrix3 &transform, float *w=0) const |
| Calculates the average motion of the fingers in transformed coordinates. More... | |
| bool | operator< (const Hand &p) const |
| Compare the order of hands. More... | |
| bool | operator== (const Hand &p) const |
| Compare hand equality. More... | |
| Nimble::Vector2f | palmCenter () const |
| Estimated palm center location. More... | |
| float | trackingQuality () const |
| Average tracking quality. More... | |
| void | write (FILE *f) const |
| Writes the contents of this hand to the file. More... | |
| ~Hand () | |
| Destructor. | |
Static Public Member Functions | |
| static Hand | getHand (Finger f) |
| Gets the hand from a finger. More... | |
Friends | |
| class | TrackedObject |
A class that represents a hand.
One should not store these in widgets etc, because this is a proxy object for the actual data laying inside tracker.
|
inline |
Constructs a hand.
| self | Data to represent with this hand. If none given object will be null. |
| int MultiTouch::Hand::age | ( | ) | const |
The age of the hand (the number of frames it has been around).
| Nimble::Rectf MultiTouch::Hand::bounds | ( | ) | const |
The bounding box of this hand.
The bounds include all the fingers belonging to the hand. Useful for doing early-out on interaction culling.
| Nimble::Rectf MultiTouch::Hand::bounds | ( | const Nimble::Matrix3 & | transform | ) | const |
The bounding box of this hand transformed by the given matrix.
| transform | transformation matrix |
| MultiTouch::Finger MultiTouch::Hand::findFinger | ( | long | id | ) | const |
Finds a finger with a given id.
If the hand does not contain a finger with the given id, then a null finger is returned, see Finger::isNull.
| id | id to look for |
| MultiTouch::Finger MultiTouch::Hand::finger | ( | size_t | n | ) | const |
Returns the nth finger.
| n | index of the finger |
| int MultiTouch::Hand::fingerCount | ( | ) | const |
Get the number of fingers in the hand.
Gets the hand from a finger.
| f | finger to query |
| TrackedObject::Id MultiTouch::Hand::id | ( | ) | const |
The unique id for this hand.
The id counter begins from zero and increases monotonically (unless the hand was generated with Screen::synthesizeFingerInput).
|
inline |
Check if the hand is invalid.
| Nimble::Vector2f MultiTouch::Hand::motion | ( | float * | w = 0 | ) | const |
Calculates average motion of the fingers.
| w | Ignored parameter |
| Nimble::Vector2f MultiTouch::Hand::motion | ( | const Nimble::Matrix3 & | transform, |
| float * | w = 0 |
||
| ) | const |
Calculates the average motion of the fingers in transformed coordinates.
| transform | transformation matrix |
| w | Ignored parameter |
|
inline |
Compare the order of hands.
Hands are sorted by their id.
| p | hand to compare |
|
inline |
Compare hand equality.
Hands are equal if their ids are the same.
| p | hand to compare |
| Nimble::Vector2f MultiTouch::Hand::palmCenter | ( | ) | const |
Estimated palm center location.
At the moment the algorithm used is very approximate (and jittery), in the future releases this information will be more reliable.
| float MultiTouch::Hand::trackingQuality | ( | ) | const |
Average tracking quality.
THIS IS NOT USED AT THE MOMENT!
| void MultiTouch::Hand::write | ( | FILE * | f | ) | const |
Writes the contents of this hand to the file.
| f | File to write |