2 Copyright (C) 2003, 2010 - Wolfire Games
4 This file is part of Lugaru.
6 Lugaru is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 Lugaru is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Lugaru. If not, see <http://www.gnu.org/licenses/>.
24 #include "Quaternions.h"
27 /**> HEADER FILES <**/
29 #include "Quaternions.h"
36 leftshoulder, leftelbow, leftwrist, lefthand,
37 rightshoulder, rightelbow, rightwrist, righthand,
38 abdomen, lefthip, righthip, groin,
39 leftknee, leftankle, leftfoot,
40 rightknee, rightankle, rightfoot
91 int numverticesclothes;
101 float rotate1, rotate2, rotate3;
102 float lastrotate1, lastrotate2, lastrotate3;
103 float oldrotate1, oldrotate2, oldrotate3;
104 float newrotate1, newrotate2, newrotate3;
110 void DoConstraint(bool spinny);
135 Animation & operator = (const Animation & ani);
137 void Load(const char *fileName, int aheight, int aattack);
144 const int max_joints = 50;
150 //Joint joints[max_joints];
155 //Muscle muscles[max_muscles];
161 int forwardjoints[3];
166 int lowforwardjoints[3];
169 XYZ specialforward[5];
170 int jointlabels[max_joints];
179 Model drawmodelclothes;
184 GLubyte skinText[512 * 512 * 3];
198 float DoConstraints(XYZ *coords, float *scale);
199 void DoGravity(float *scale);
200 void FindRotationJoint(int which);
201 void FindRotationJointSameTwist(int which);
202 void FindRotationMuscle(int which, int animation);
203 void Load(const char *fileName, const char *lowfileName, const char *clothesfileName, const char *modelfileName, const char *model2fileName, const char *model3fileName, const char *model4fileName, const char *model5fileNamee, const char *model6fileName, const char *model7fileName, const char *modellowfileName, const char *modelclothesfileName, bool aclothes);
207 void FindForwardsfirst();
208 void Draw(int muscleview);
209 void AddJoint(float x, float y, float z, int which);
210 void SetJoint(float x, float y, float z, int which, int whichjoint);
211 void DeleteJoint(int whichjoint);
212 void AddMuscle(int attach1, int attach2, float maxlength, float minlength, int type);
213 void DeleteMuscle(int whichmuscle);
222 // convenience functions
223 // only for Skeleton.cpp
224 inline Joint& joint(int bodypart) { return joints[jointlabels[bodypart]]; }
225 inline XYZ& jointPos(int bodypart) { return joint(bodypart).position; }
226 inline XYZ& jointVel(int bodypart) { return joint(bodypart).velocity; }