]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Skeleton.h
made convenience functions inlineable to avoid performance hit
[lugaru.git] / Source / Skeleton.h
index 20429af422d25f778ffd8bf335d04beee38140aa..63e1ad6239a6cb69d9284abda3a539e0b9017c89 100644 (file)
@@ -221,9 +221,12 @@ public:
     ~Skeleton();
 
 private:
-    Joint& joint(int bodypart);
-    XYZ& jointPos(int bodypart);
-    XYZ& jointVel(int bodypart);
+    // convenience functions
+    // only for Skeleton.cpp
+    inline Joint& joint(int bodypart) { return joints[jointlabels[bodypart]]; }
+    inline XYZ& jointPos(int bodypart) { return joint(bodypart).position; }
+    inline XYZ& jointVel(int bodypart) { return joint(bodypart).velocity; }
+
 };
 
 #endif