#ifndef _SKELETON_H_ #define _SKELETON_H_ /**> HEADER FILES <**/ #include #include #include "Quaternions.h" #include "Constants.h" #include "Models.h" #define boneconnect 0 #define constraint 1 #define muscle 2 #define head 0 #define neck 1 #define leftshoulder 2 #define leftelbow 3 #define leftwrist 4 #define lefthand 5 #define rightshoulder 6 #define rightelbow 7 #define rightwrist 8 #define righthand 9 #define abdomen 10 #define lefthip 11 #define righthip 12 #define groin 13 #define leftknee 14 #define leftankle 15 #define leftfoot 16 #define rightknee 17 #define rightankle 18 #define rightfoot 19 class Joint { public: XYZ position; XYZ oldposition; XYZ realoldposition; XYZ velocity; XYZ offset; float length; bool lower; bool hasparent; bool locked; int modelnum; bool visible; bool existing; Joint* parent; int label; float rotate1,rotate2,rotate3; void DoConstraint(); }; class Muscle { public: float length; float targetlength; Joint* parent1; Joint* parent2; float maxlength; float minlength; int type; bool visible; void DoConstraint(int broken); float rotate1,rotate2,rotate3; float strength; }; class Animation { public: int numframes; bool canbeoverridden; bool ismodified[max_joints][max_frames]; XYZ position[max_joints][max_frames]; float speed[max_frames]; XYZ forward[max_frames]; float rotate1[max_joints][max_frames]; float rotate2[max_joints][max_frames]; float rotate3[max_joints][max_frames]; float mrotate1[max_joints][max_frames]; float mrotate2[max_joints][max_frames]; float mrotate3[max_joints][max_frames]; void load(const char* name); }; class Skeleton { public: Joint joints[max_joints]; Muscle muscles[max_muscles]; int num_muscles; int selected; int forwardjoints[3]; XYZ forward; int lowforwardjoints[3]; XYZ lowforward; int broken; bool offset; XYZ specialforward[5]; bool free; void DoConstraints(); void DoConstraints(Model *collide, XYZ *move, float rotation); void DoGravity(); void DoBalance(); void Draw(int muscleview); void DeleteJoint(int whichjoint); void DeleteMuscle(int whichmuscle); void FindRotationJoint(int which); void FindRotationMuscle(int which); void reload(); }; #endif