]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.h
made convenience functions inlineable to avoid performance hit
[lugaru.git] / Source / Person.h
index 754a046676763e5f138798723124659e11fdad68..7f8364e49ce0dc69ab6e0cd8a7aa83a7a5192204 100644 (file)
@@ -326,10 +326,11 @@ public:
 
 
 
-    // convenience
-    Joint& joint(int);
-    XYZ& jointPos(int);
-    XYZ& jointVel(int);
+    // convenience functions
+    inline Joint& joint(int bodypart) { return skeleton.joints[skeleton.jointlabels[bodypart]]; }
+    inline XYZ& jointPos(int bodypart) { return joint(bodypart).position; }
+    inline XYZ& jointVel(int bodypart) { return joint(bodypart).velocity; }
+
 
     void CheckKick();
     void CatchFire();
@@ -394,4 +395,5 @@ public:
 
 const int maxplayers = 10;
 extern Person player[maxplayers];
+
 #endif