X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAnimation%2FJoint.cpp;h=96f94c97ac6d5a03546017cd8ff63e54cd0ed1b6;hb=1991e81a5c3bcc9cd0d6d49f56ebd8bcbd76e7b4;hp=760e49b2cde1fd1d381079afc999baf56b6653cb;hpb=18e718d3ff51c67029f2d4e1416f979b9ad3afc0;p=lugaru.git diff --git a/Source/Animation/Joint.cpp b/Source/Animation/Joint.cpp index 760e49b..96f94c9 100644 --- a/Source/Animation/Joint.cpp +++ b/Source/Animation/Joint.cpp @@ -19,6 +19,7 @@ along with Lugaru. If not, see . */ #include "Animation/Joint.h" +#include "binio.h" Joint::Joint() : blurred(0), @@ -36,3 +37,22 @@ Joint::Joint() : delay(0) { } + +void Joint::load(FILE* tfile, std::vector& joints) +{ + int parentID; + + funpackf(tfile, "Bf Bf Bf Bf Bf", &position.x, &position.y, &position.z, &length, &mass); + funpackf(tfile, "Bb Bb", &hasparent, &locked); + funpackf(tfile, "Bi", &modelnum); + funpackf(tfile, "Bb Bb", &visible, &sametwist); + funpackf(tfile, "Bi Bi", &label, &hasgun); + funpackf(tfile, "Bb", &lower); + funpackf(tfile, "Bi", &parentID); + if (hasparent) { + parent = &joints[parentID]; + } + velocity = 0; + oldposition = position; + startpos = position; +}