made Leap unit-conversion method public

This commit is contained in:
Eric Johnston 2013-07-15 14:12:52 -07:00
parent 86faa33f83
commit c61966ebcd
2 changed files with 5 additions and 1 deletions

View file

@ -50,6 +50,9 @@ public:
// getters // getters
const glm::vec3& getLeapBallPosition (int ball) const { return _leapBalls[ball].position;} const glm::vec3& getLeapBallPosition (int ball) const { return _leapBalls[ball].position;}
// position conversion
glm::vec3 leapPositionToWorldPosition(const glm::vec3& leapPosition);
private: private:
// disallow copies of the Hand, copy of owning Avatar is disallowed too // disallow copies of the Hand, copy of owning Avatar is disallowed too
Hand(const Hand&); Hand(const Hand&);
@ -66,7 +69,6 @@ private:
// private methods // private methods
void renderHandSpheres(); void renderHandSpheres();
void calculateGeometry(); void calculateGeometry();
glm::vec3 leapPositionToWorldPosition(const glm::vec3& leapPosition);
}; };
#endif #endif

View file

@ -20,6 +20,8 @@ class HandData {
public: public:
HandData(AvatarData* owningAvatar); HandData(AvatarData* owningAvatar);
// These methods return the positions in Leap-relative space.
// To vonvert to world coordinates, use Hand::leapPositionToWorldPosition.
const std::vector<glm::vec3>& getFingerTips() const { return _fingerTips; } const std::vector<glm::vec3>& getFingerTips() const { return _fingerTips; }
const std::vector<glm::vec3>& getFingerRoots() const { return _fingerRoots; } const std::vector<glm::vec3>& getFingerRoots() const { return _fingerRoots; }
const std::vector<glm::vec3>& getHandPositions() const { return _handPositions; } const std::vector<glm::vec3>& getHandPositions() const { return _handPositions; }