convert line ends
[canaan.git] / prj / cam / src / dark / crbugbst.c
blob993e8be13236fbf16c89cc9cee90d03e855ff8da
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $Header: r:/t2repos/thief2/src/dark/crbugbst.c,v 1.6 1998/10/23 01:49:04 CCAROLLO Exp $
7 //
8 // @TODO: come up with physics models and weapon model placements.
10 #include <creatur_.h>
11 #include <crbugbst.h>
12 #include <drkcret.h> // to get actor type definition
14 #include <dbmem.h> // must be last included header
16 #define HUMANOID_PHYS_RADIUS 1.0
18 #define CLAW_PHYS_RADIUS 0.4
20 static sCrPhysModOffset g_SwordPhysOffsets[] = \
22 { 16, 20, 0.5, CLAW_PHYS_RADIUS},
23 { 16, 20, 1.0, CLAW_PHYS_RADIUS},
24 { 17, 21, 0.5, CLAW_PHYS_RADIUS},
25 { 17, 21, 1.0, CLAW_PHYS_RADIUS},
28 static sCrPhysModOffsetTable g_WeaponPhysTable = \
30 sizeof(g_SwordPhysOffsets)/sizeof(g_SwordPhysOffsets[0]), g_SwordPhysOffsets
34 static sCrPhysModOffset g_aBugPhysModOffsets[] = \
36 { 8, 8, 0.0, 1.0},
37 { 18, 9, 0.8, 1.2},
40 // Joints
41 #define LTOE 0
42 #define RTOE 1
43 #define LANKLE 2
44 #define RANKLE 3
45 #define LKNEE 4
46 #define RKNEE 5
47 #define LHIP 6
48 #define RHIP 7
49 #define BUTT 8
50 #define NECK 9
51 #define LSHLDR 10
52 #define RSHLDR 11
53 #define LELBOW 12
54 #define RELBOW 13
55 #define LWRIST 14
56 #define RWRIST 15
57 #define LFINGER 16
58 #define RFINGER 17
59 #define ABDOMEN 18
60 #define HEAD 19
61 #define LCLAW 20
62 #define RCLAW 21
64 // mapping from joint id to exposed joint enum
65 static int g_aBugJointMap[] =
67 -1,
68 19,
70 18,
72 10,
73 11,
74 12,
75 13,
76 14,
77 15,
78 16,
79 17,
88 -1,
91 // array of mappings from jointIDs -> parent jointIDs
92 static int g_aBugJointParents[] =
94 LANKLE, // LTOE
95 RANKLE, // RTOE
96 LKNEE, // LANKLE
97 RKNEE, // RANKLE
98 LHIP, // LKNEE
99 RHIP, // RKNEE
100 BUTT, // LHIP
101 BUTT, // RHIP
102 BUTT, // BUTT
103 ABDOMEN, // NECK
104 ABDOMEN, // LSHLDR
105 ABDOMEN, // RSHLDR
106 LSHLDR, // LELBOW
107 RSHLDR, // RELBOW
108 LELBOW, // LWRIST
109 RELBOW, // RWRIST
110 LWRIST, // LFINGER
111 RWRIST, // RFINGER
112 BUTT, // ABDOMEN
113 NECK, // HEAD
114 LFINGER, // LCLAW
115 RFINGER, // RCLAW
118 static torso g_aDefTorsos[2]= {\
119 {BUTT,-1,3,{LHIP,RHIP,ABDOMEN}},
120 {ABDOMEN,0,3,{LSHLDR,RSHLDR,NECK}},
123 // @TODO: increase num limb segs? get rid of extra joint?
124 static limb g_aDefLimbs[5]= {\
125 {0,1,3,{LHIP,LKNEE,LANKLE,LTOE}},
126 {0,1,3,{RHIP,RKNEE,RANKLE,RTOE}},
127 {1,0,4,{LSHLDR,LELBOW,LWRIST,LFINGER,LCLAW}},
128 {1,0,4,{RSHLDR,RELBOW,RWRIST,RFINGER,RCLAW}},
129 {1,0,1,{NECK,HEAD}},
132 static int g_FootJoints[2]={ LANKLE, RANKLE };
134 const sCreatureDesc sCrBugBeastDesc = \
136 kDATYPE_Humanoid, // actor type
137 2, // num torsos
138 5, // num limbs
139 22, // num joints
140 "bugbeast", // default lengths filename
141 2, // number of phys models
142 HUMANOID_PHYS_RADIUS, // default phys radius
143 g_aBugPhysModOffsets, // array of phys model offsets
144 g_aBugJointParents, // joint parent mapping
145 g_aBugJointMap,
146 2, // num feet
147 g_FootJoints, // foot joints
148 g_aDefTorsos, // default torso values (if lengths file not found)
149 g_aDefLimbs, // default limb values (if lengths file not found)
150 kDCrWeap_NumWeapons, // number of weapons
151 &g_WeaponPhysTable, // weapon physics model offsets
152 FALSE, // is player limb
153 TRUE, // uses head tracking