2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
5 This file is part of Lugaru.
7 Lugaru is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 Lugaru is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Lugaru. If not, see <http://www.gnu.org/licenses/>.
25 #include "Quaternions.h"
28 /**> HEADER FILES <**/
30 #include "Quaternions.h"
37 leftshoulder, leftelbow, leftwrist, lefthand,
38 rightshoulder, rightelbow, rightwrist, righthand,
39 abdomen, lefthip, righthip, groin,
40 leftknee, leftankle, leftfoot,
41 rightknee, rightankle, rightfoot
92 int numverticesclothes;
102 float rotate1, rotate2, rotate3;
103 float lastrotate1, lastrotate2, lastrotate3;
104 float oldrotate1, oldrotate2, oldrotate3;
105 float newrotate1, newrotate2, newrotate3;
111 void DoConstraint(bool spinny);
136 Animation & operator = (const Animation & ani);
138 void Load(const char *fileName, int aheight, int aattack);
145 const int max_joints = 50;
151 //Joint joints[max_joints];
156 //Muscle muscles[max_muscles];
162 int forwardjoints[3];
167 int lowforwardjoints[3];
170 XYZ specialforward[5];
171 int jointlabels[max_joints];
180 Model drawmodelclothes;
185 GLubyte skinText[512 * 512 * 3];
199 float DoConstraints(XYZ *coords, float *scale);
200 void DoGravity(float *scale);
201 void FindRotationJoint(int which);
202 void FindRotationJointSameTwist(int which);
203 void FindRotationMuscle(int which, int animation);
204 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);
208 void FindForwardsfirst();
209 void Draw(int muscleview);
210 void AddJoint(float x, float y, float z, int which);
211 void SetJoint(float x, float y, float z, int which, int whichjoint);
212 void DeleteJoint(int whichjoint);
213 void AddMuscle(int attach1, int attach2, float maxlength, float minlength, int type);
214 void DeleteMuscle(int whichmuscle);
223 // convenience functions
224 // only for Skeleton.cpp
225 inline Joint& joint(int bodypart) { return joints[jointlabels[bodypart]]; }
226 inline XYZ& jointPos(int bodypart) { return joint(bodypart).position; }
227 inline XYZ& jointVel(int bodypart) { return joint(bodypart).velocity; }