2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant 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 GtkRadiant 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 GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #include "globaldefs.h"
31 //typedef float vec3_t[3];
32 //typedef unsigned char byte;
35 #define stricmp strcasecmp
36 #define strcmpi strcasecmp
39 typedef struct Placement_s
47 typedef struct QDataJoint_s
49 Placement_t placement;
54 typedef struct ArrayedListNode_s
61 #define ARRAYEDLISTNODE_NULL -1
63 typedef struct JointAngles_s
70 typedef struct JointAngles2_s
78 #define MAX_MODELJOINTS 256
79 #define MAX_MODELJOINTNODES 255
81 extern JointAngles_t jointAngles[MAX_MODELJOINTS];
82 extern JointAngles2_t jointAngles2[MAX_MODELJOINTS];
84 extern ArrayedListNode_t jointAngleNodes[MAX_MODELJOINTNODES];
86 // Skeletal structures enums
93 // Raven Skeletal structures enums
101 // Box Skeletal structures enums
107 extern int numJointsForSkeleton[];
108 extern char *RAVEN_SKEL_NAMES[];
110 #define J_NEW_SKELETON 0x00001000
111 #define J_YAW_CHANGED 0x00002000
112 #define J_PITCH_CHANGED 0x00004000
113 #define J_ROLL_CHANGED 0x00008000
114 #define MAX_JOINTS 0x00000fff
116 inline int GetFreeNode(ArrayedListNode_t *nodeArray, int max)
117 { // yeah, I know this is a sucky, inefficient way to do this, but I didn't feel like taking the time to write a real resource manager in C
120 for(i = 0; i < max; ++i)
122 if(!nodeArray[i].inUse)
124 nodeArray[i].inUse = 1;
133 inline void FreeNode(ArrayedListNode_t *nodeArray, int index)
135 nodeArray[index].inUse = 0;
138 int CreateSkeleton( int structure );
139 void CreateSkeletonAtIndex( int structure, int index );
140 void FreeSkeleton( int structure, int index );
141 void SetJointAngle( int jointIndex, int angleIndex, float angle );
142 float ModifyJointAngle( int jointIndex, int angleIndex, float deltaAngle );
143 int ZeroJointAngle( int jointIndex, int angleIndex, float angVel );
144 int ApplyAngVelToJoint( int jointIndex, int angleIndex, float angVel, float destAng );