SSBM Decomp
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#ifndef MELEE_CM_TYPES_H
2#define MELEE_CM_TYPES_H
3
4#include <placeholder.h>
5
6#include "cm/forward.h" // IWYU pragma: export
7#include <baselib/forward.h>
8
9#include <dolphin/mtx.h>
10
12struct CmSubject {
13 /* +00 */ CmSubject* next;
14 /* +04 */ CmSubject* prev;
15 /* +08 */ bool x8;
16 /* +0C:0 */ u8 xC_b0 : 1;
17 /* +0C:1 */ u8 xC_b1 : 1;
18 /* +0C:2 */ u8 xC_b2 : 1;
19 /* +0E */ s16 xE;
20 /* +10 */ Vec3 x10; // might be Vec2?
21 /* +1C */ Vec3 x1C; // position?
22 /* +28 */ float x28; // direction?
23 /* +2C */ Vec2 x2C;
24 /* +34 */ Vec3 x34; // size?
25 /* +40 */ Vec2 x40;
26 /* +48 */ Vec3 x48;
27 /* +54 */ Vec3 x54;
28 /* +60 */ Vec3 x60;
29};
30
32 /* +0 */ Vec3 interest;
33 /* +C */ Vec3 target_interest;
34 /* +18 */ Vec3 position;
35 /* +24 */ Vec3 target_position;
36 /* +30 */ float fov;
37 /* +34 */ float target_fov;
38};
39
41 float x_min;
42 float y_min;
43 float x_max;
44 float y_max;
46 float z_pos;
47};
48
50 /* 0x0 */ Vec3 x0;
51 /* 0xC */ int type;
52};
53
64 float free_fov;
65 u8 _4C[8]; // padding? not sure if this is correct
66};
67
68struct Camera {
69 /* 0x000 */ HSD_GObj* gobj;
70 /* 0x004 */ CameraType mode;
71 /* 0x008 */ u8 background_r;
72 /* 0x009 */ u8 background_g;
73 /* 0x00A */ u8 background_b;
74 /* 0x00B */ s8 xB;
75 /* 0x00C */ f32 nearz;
76 /* 0x010 */ f32 farz;
78 /* 0x04C */ CameraTransformState
79 transform_copy; // this runs the same tween logic, but isnt used for
80 // anything?
81 /* 0x084 */ Vec2 translation;
82 /* 0x08C */ s32 _8C[5]; /* maybe part of translation[4]? */
83 /* 0x0A0 */ HSD_GObj* xA0;
84 /* 0x0A4 */ f32 xA4;
85 /* 0x0A8 */ f32 xA8;
86 /* 0x0AC */ f32 xAC; /* inferred */
87 /* 0x0B0 */ struct CameraQuake _B0[2][8];
88 /* 0x1B0 */ struct CameraQuake _1B0[2][8];
89 /* 0x2B0 */ float x2B0;
90 /* 0x2B4 */ float x2B4;
91 /* 0x2B8 */ s16 x2B8;
92 /* 0x2BA */ s16 x2BA;
93 /* 0x2BC */ f32 x2BC;
94 /* 0x2C0 */ f32 x2C0;
95 /* 0x2C4 */ s8 x2C4; /* unk player slot */
96 /* 0x2C5 */ s8 x2C5;
97 /* 0x2C6 */ char pad_2C6[0x2C8 - 0x2C6];
98 /* 0x2C8 */ float pitch_offset;
99 /* 0x2CC */ float yaw_offset;
100 /* 0x2D0 */ f32 x2D0;
101 /* 0x2D4 */ f32 x2D4;
102 /* 0x2D8 */ f32 x2D8;
103 /* 0x2DC */ f32 x2DC;
104 /* 0x2E0 */ f32 x2E0;
105 /* 0x2E4 */ f32 x2E4;
106 /* 0x2E8 */ f32 x2E8;
107 /* 0x2EC */ f32 x2EC;
108 /* 0x2F0 */ f32 x2F0;
109 /* 0x2F4 */ f32 x2F4;
110 /* 0x2F8 */ f32 min_distance;
111 /* 0x2FC */ f32 max_distance;
112 /* 0x300 */ s32 x300;
113 /* 0x304 */ s8 x304;
114 /* 0x305 */ s8 x305;
115 /* 0x306 */ s8 x306;
116 /* 0x307 */ s8 x307;
117 /* 0x308 */ Vec3 x308;
118 /* 0x314 */ Vec3 x314;
119 /* 0x320 */ Vec3 pause_eye_offset; /* offset from focused player */
120 /* 0x32C */ f32 x32C;
121 /* 0x330 */ f32 pause_eye_distance; /* distance to focused player */
122 /* 0x334 */ Vec3 pause_up; /* up vector */
123 /* 0x340 */ u8 x340;
124 /* 0x341:0 */ u8 x341_b0 : 1;
125 /* 0x341:1 */ u8 x341_b1_b2 : 2;
126 /* 0x341:3 */ u8 x341_b3_b4 : 2;
127 /* 0x341:5 */ u8 x341_b5_b6 : 2;
128 /* 0x341:7 */ u8 x341_b7 : 1;
129 /* 0x342 */ char x342_pad[2];
130 /* 0x344 */ union {
132 Vec3 vec;
133 s32 (*cb)(Vec3*);
135 /* 0x350 */ Vec3 x350;
136 /* 0x35C */ union {
137 Vec3 vec;
138 s32 (*cb)(Vec3*);
139 struct {
140 u8 b0 : 1;
141 u8 b1 : 1;
142 u8 b2 : 1;
144 s16 x2;
147 /* 0x368 */ Vec3 x368;
148 /* 0x374 */ f32 x374;
149 /* 0x378 */ union {
151 s32 s32;
153 // /* 0x378 */ f32 x378;
154 /* 0x37C */ s32 x37C;
155 /* 0x380 */ u8 x380[0x18];
156 /* 0x398:0 */ u8 x398_b0 : 1;
157 /* 0x398:1 */ u8 x398_b1 : 1;
158 /* 0x398:2 */ u8 x398_b2 : 1;
159 /* 0x398:3 */ u8 x398_b3 : 1;
160 /* 0x398:4 */ u8 x398_b4 : 1;
161 /* 0x398:5 */ u8 x398_b5 : 1;
162 /* 0x398:6 */ u8 x398_b6_b7 : 2;
163 /* 0x399:0 */ u8 x399_b0_b1 : 2;
164 /* 0x399:2 */ u8 x399_b2 : 1;
165 /* 0x399:3 */ u8 x399_b3 : 1;
166 /* 0x399:4 */ u8 x399_b4 : 1;
167 /* 0x399:5 */ u8 x399_b5 : 1;
168 /* 0x399:6 */ u8 x399_b6 : 1;
169 /* 0x399:7 */ u8 x399_b7 : 1;
170 /* 0x39A:0 */ u8 x39A_b0 : 1;
171 /* 0x39A:1 */ u8 x39A_b1 : 1;
172 /* 0x39A:2 */ u8 x39A_b2 : 1;
173 /* 0x39A:3 */ u8 x39A_b3 : 1;
174 /* 0x39A:4 */ u8 x39A_b4 : 1;
175 /* 0x39A:5 */ u8 x39A_b5 : 1;
176 /* 0x39A:6 */ u8 x39A_b6 : 1;
177 /* 0x39A:7 */ u8 x39A_b7 : 1;
178 /* 0x39B */ char pad_39B; /* maybe part of unk_39A[6]? */
179};
180STATIC_ASSERT(sizeof(struct Camera) == 0x39C);
181
182// struct CameraUnkGlobals {
183// /* +0 */ float _0[11];
184// /* +2C */ float x2C;
185// /* +30 */ float x30;
186// /* +34 */ float x34;
187// /* +38 */ float x38;
188// /* +3C */ float x3C;
189// /* +40 */ float x40;
190// /* +44 */ float _44[43];
191// };
192
194 /* +0 */ float x0;
195 /* +4 */ float x4;
196 /* +8 */ float x8;
197 /* +C */ float xC;
198 /* +10 */ float x10;
199 /* +14 */ float x14;
200 /* +18 */ float x18;
201 /* +1C */ float x1C;
202 /* +20 */ float x20;
203 /* +24 */ float x24;
204 /* +28 */ float x28;
205 /* +2C */ float x2C;
206 /* +30 */ float x30;
207 /* +34 */ float x34;
208 /* +38 */ float x38;
209 /* +3C */ float x3C;
210 /* +40 */ float x40;
211 /* +44 */ float x44;
212 /* +48 */ float x48;
213 /* +4C */ float x4C;
214 /* +50 */ float x50;
215 /* +54 */ float x54;
216 /* +58 */ float x58;
217 /* +5C */ float x5C;
218 /* +60 */ float x60;
219 /* +64 */ float x64;
220 /* +68 */ float x68;
221 /* +6C */ float x6C;
222 /* +70 */ float x70;
223 /* +74 */ float x74;
224 /* +78 */ float x78;
225 /* +7C */ float x7C;
226 /* +80 */ float x80;
227 /* +84 */ float x84;
228 /* +88 */ float x88;
229 /* +8C */ float x8C;
230 /* +90 */ float x90;
231 /* +94 */ float x94;
232 /* +98 */ float x98;
233 /* +9C */ float x9C;
234 /* +A0 */ float xA0;
235 /* +A4 */ float xA4;
236 /* +A8 */ float xA8;
237 /* +AC */ float xAC;
238 /* +B0 */ float xB0;
239 /* +B4 */ float xB4;
240 /* +B8 */ float xB8;
241 /* +BC */ float xBC;
242 /* +C0 */ float xC0;
243 /* +C4 */ float xC4;
244 /* +C8 */ float xC8;
245 /* +CC */ float xCC;
246 /* +D0 */ float xD0;
247 /* +D4 */ float xD4;
248 /* +D8 */ float xD8;
249 /* +DC */ float xDC;
250 /* +E0 */ float xE0;
251 /* +E4 */ float xE4;
252 /* +E8 */ float xE8;
253 /* +EC */ float xEC;
254};
255
257 void (*(callback[9]))(void*);
258};
259
261 /* +00 */ f32 stick_x;
262 /* +04 */ f32 stick_y;
263 /* +08 */ f32 substick_x;
264 /* +0C */ f32 substick_y;
266 /* +10 */ union {
267 u32 _u32[2];
268 u64 _u64;
270 /* +18 */ union {
271 u32 _u32[2];
272 u64 _u64;
274};
275
276#endif
signed char s8
Definition hsd_3B2B.h:3
signed long s32
Definition hsd_3B2B.h:1
unsigned char u8
Definition hsd_3B2B.h:2
CameraType
Definition forward.h:11
#define STATIC_ASSERT(cond)
Definition platform.h:110
Definition types.h:40
float z_pos
Definition types.h:46
float y_max
Definition types.h:44
int total_subjects
Definition types.h:45
float x_max
Definition types.h:43
float y_min
Definition types.h:42
float x_min
Definition types.h:41
Definition types.h:54
Vec3 follow_int_offset
Definition types.h:57
Vec3 free_eye_pos
Definition types.h:63
Vec3 follow_int_pos
Definition types.h:60
float free_fov
Definition types.h:64
Vec3 follow_eye_offset
Definition types.h:58
Vec3 follow_eye_pos
Definition types.h:59
Vec3 free_int_pos
Definition types.h:62
float follow_fov
Definition types.h:61
u8 _4C[8]
Definition types.h:65
CameraType last_mode
Definition types.h:55
int ply_slot
Definition types.h:56
Definition types.h:260
u64 _u64
Definition types.h:268
f32 substick_x
Definition types.h:263
f32 stick_y
Definition types.h:262
union CameraInputs::@6 x10
u32 _u32[2]
Definition types.h:267
f32 substick_y
Definition types.h:264
union CameraInputs::@7 x18
f32 stick_x
Definition types.h:261
Definition types.h:256
void callback(void *)
Definition types.h:49
Vec3 x0
Definition types.h:50
int type
Definition types.h:51
Definition types.h:31
Vec3 position
Definition types.h:34
float target_fov
Definition types.h:37
float fov
Definition types.h:36
Vec3 target_interest
Definition types.h:33
Vec3 target_position
Definition types.h:35
Vec3 interest
Definition types.h:32
Definition types.h:193
float xBC
Definition types.h:241
float xC
Definition types.h:197
float x80
Definition types.h:226
float xA8
Definition types.h:236
float x10
Definition types.h:198
float x8C
Definition types.h:229
float xDC
Definition types.h:249
float x64
Definition types.h:219
float x48
Definition types.h:212
float x0
Definition types.h:194
float x6C
Definition types.h:221
float xB4
Definition types.h:239
float x58
Definition types.h:216
float x34
Definition types.h:207
float x38
Definition types.h:208
float x4C
Definition types.h:213
float x4
Definition types.h:195
float xCC
Definition types.h:245
float x60
Definition types.h:218
float x2C
Definition types.h:205
float x20
Definition types.h:202
float x54
Definition types.h:215
float x18
Definition types.h:200
float x70
Definition types.h:222
float xE8
Definition types.h:252
float xC0
Definition types.h:242
float x8
Definition types.h:196
float x88
Definition types.h:228
float x78
Definition types.h:224
float xA0
Definition types.h:234
float x1C
Definition types.h:201
float x44
Definition types.h:211
float xB0
Definition types.h:238
float x28
Definition types.h:204
float xD0
Definition types.h:246
float x90
Definition types.h:230
float x24
Definition types.h:203
float x14
Definition types.h:199
float xEC
Definition types.h:253
float x74
Definition types.h:223
float xA4
Definition types.h:235
float xD4
Definition types.h:247
float x7C
Definition types.h:225
float x94
Definition types.h:231
float x30
Definition types.h:206
float xAC
Definition types.h:237
float xC8
Definition types.h:244
float x3C
Definition types.h:209
float xC4
Definition types.h:243
float x68
Definition types.h:220
float xE4
Definition types.h:251
float xB8
Definition types.h:240
float x98
Definition types.h:232
float xD8
Definition types.h:248
float xE0
Definition types.h:250
float x40
Definition types.h:210
float x5C
Definition types.h:217
float x50
Definition types.h:214
float x84
Definition types.h:227
float x9C
Definition types.h:233
Definition types.h:68
f32 max_distance
Definition types.h:111
f32 min_distance
Definition types.h:110
Vec3 pause_eye_offset
Definition types.h:119
union Camera::@2 x344
u8 x399_b7
Definition types.h:169
f32 pause_eye_distance
Definition types.h:121
Vec3 x368
Definition types.h:147
f32 x2DC
Definition types.h:103
f32 x2F0
Definition types.h:108
u8 x399_b2
Definition types.h:164
s32(* cb)(Vec3 *)
Definition types.h:133
u8 x39A_b6
Definition types.h:176
s8 x2C5
Definition types.h:96
f32 x2C0
Definition types.h:94
s16 x2
Definition types.h:144
u8 x398_b5
Definition types.h:161
s32 x300
Definition types.h:112
u8 x341_b7
Definition types.h:128
Vec2 translation
Definition types.h:81
union Camera::@3 x35C
f32 x2D8
Definition types.h:102
char pad_39B
Definition types.h:178
u8 x341_b3_b4
Definition types.h:126
s8 x305
Definition types.h:114
f32 x2D0
Definition types.h:100
u8 background_g
Definition types.h:72
char pad_2C6[0x2C8 - 0x2C6]
Definition types.h:97
char x342_pad[2]
Definition types.h:129
s8 x306
Definition types.h:115
u8 b1
Definition types.h:141
f32 x2F4
Definition types.h:109
s32 x37C
Definition types.h:154
u8 background_r
Definition types.h:71
u8 x39A_b2
Definition types.h:172
struct CameraQuake _B0[2][8]
Definition types.h:87
f32 x374
Definition types.h:148
HSD_GObj * gobj
Definition types.h:69
u8 x399_b6
Definition types.h:168
f32 x32C
Definition types.h:120
s8 x304
Definition types.h:113
u8 x39A_b7
Definition types.h:177
u8 x398_b4
Definition types.h:160
u8 b0
Definition types.h:140
Vec3 x308
Definition types.h:117
f32 x2E4
Definition types.h:105
u8 x399_b5
Definition types.h:167
u8 x399_b3
Definition types.h:165
float x2B4
Definition types.h:90
u8 x341_b5_b6
Definition types.h:127
s32 s32
Definition types.h:131
float pitch_offset
Definition types.h:98
struct Camera::@3::@5 bits
float x2B0
Definition types.h:89
u8 x399_b4
Definition types.h:166
CameraTransformState transform
Definition types.h:77
f32 xA4
Definition types.h:84
u8 x398_b1
Definition types.h:157
s16 x2B8
Definition types.h:91
union Camera::@4 x378
u8 x341_b1_b2
Definition types.h:125
f32 xAC
Definition types.h:86
s8 x2C4
Definition types.h:95
u8 x39A_b5
Definition types.h:175
u8 background_b
Definition types.h:73
f32 farz
Definition types.h:76
f32 f32
Definition types.h:150
u8 pad
Definition types.h:143
u8 x380[0x18]
Definition types.h:155
u8 x398_b0
Definition types.h:156
Vec3 vec
Definition types.h:132
s16 x2BA
Definition types.h:92
f32 x2E8
Definition types.h:106
u8 x340
Definition types.h:123
struct CameraQuake _1B0[2][8]
Definition types.h:88
u8 x39A_b3
Definition types.h:173
f32 xA8
Definition types.h:85
Vec3 x350
Definition types.h:135
u8 x39A_b1
Definition types.h:171
u8 x398_b2
Definition types.h:158
Vec3 x314
Definition types.h:118
u8 x341_b0
Definition types.h:124
HSD_GObj * xA0
Definition types.h:83
s32 _8C[5]
Definition types.h:82
f32 x2BC
Definition types.h:93
CameraType mode
Definition types.h:70
f32 x2D4
Definition types.h:101
f32 x2E0
Definition types.h:104
u8 x398_b6_b7
Definition types.h:162
Vec3 pause_up
Definition types.h:122
u8 x39A_b4
Definition types.h:174
u8 x399_b0_b1
Definition types.h:163
f32 nearz
Definition types.h:75
u8 x398_b3
Definition types.h:159
float yaw_offset
Definition types.h:99
u8 b2
Definition types.h:142
u8 x39A_b0
Definition types.h:170
CameraTransformState transform_copy
Definition types.h:79
s8 xB
Definition types.h:74
s8 x307
Definition types.h:116
f32 x2EC
Definition types.h:107
Definition types.h:12
Vec2 x40
Definition types.h:25
Vec2 x2C
Definition types.h:23
u8 xC_b2
Definition types.h:18
s16 xE
Definition types.h:19
u8 xC_b0
Definition types.h:16
CmSubject * prev
Definition types.h:14
Vec3 x34
Definition types.h:24
u8 xC_b1
Definition types.h:17
Vec3 x54
Definition types.h:27
Vec3 x48
Definition types.h:26
CmSubject * next
Definition types.h:13
Vec3 x1C
Definition types.h:21
Vec3 x60
Definition types.h:28
float x28
Definition types.h:22
bool x8
Definition types.h:15
Vec3 x10
Definition types.h:20
was using this to try and fix some matches, unsuccessfully
Definition gobj.h:26