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 pad_342[0x350 - 0x342]; /* maybe part of unk_341[0x57]? */
130 /* 0x350 */ Vec3 x350;
131 /* 0x35C */ union {
132 Vec3 vec;
133 s32 (*cb)(Vec3*);
135 /* 0x368 */ Vec3 x368;
136 /* 0x374 */ f32 x374;
137 /* 0x378 */ union {
141 // /* 0x378 */ f32 x378;
142 /* 0x37C */ s32 x37C;
143 /* 0x380 */ u8 x380[0x18];
144 /* 0x398:0 */ u8 x398_b0 : 1;
145 /* 0x398:1 */ u8 x398_b1 : 1;
146 /* 0x398:2 */ u8 x398_b2 : 1;
147 /* 0x398:3 */ u8 x398_b3 : 1;
148 /* 0x398:4 */ u8 x398_b4 : 1;
149 /* 0x398:5 */ u8 x398_b5 : 1;
150 /* 0x398:6 */ u8 x398_b6_b7 : 2;
151 /* 0x399:0 */ u8 x399_b0_b1 : 2;
152 /* 0x399:2 */ u8 x399_b2 : 1;
153 /* 0x399:3 */ u8 x399_b3 : 1;
154 /* 0x399:4 */ u8 x399_b4 : 1;
155 /* 0x399:5 */ u8 x399_b5 : 1;
156 /* 0x399:6 */ u8 x399_b6 : 1;
157 /* 0x399:7 */ u8 x399_b7 : 1;
158 /* 0x39A:0 */ u8 x39A_b0 : 1;
159 /* 0x39A:1 */ u8 x39A_b1 : 1;
160 /* 0x39A:2 */ u8 x39A_b2 : 1;
161 /* 0x39A:3 */ u8 x39A_b3 : 1;
162 /* 0x39A:4 */ u8 x39A_b4 : 1;
163 /* 0x39A:5 */ u8 x39A_b5 : 1;
164 /* 0x39A:6 */ u8 x39A_b6 : 1;
165 /* 0x39A:7 */ u8 x39A_b7 : 1;
166 /* 0x39B */ char pad_39B; /* maybe part of unk_39A[6]? */
167};
168STATIC_ASSERT(sizeof(struct Camera) == 0x39C);
169
170// struct CameraUnkGlobals {
171// /* +0 */ float _0[11];
172// /* +2C */ float x2C;
173// /* +30 */ float x30;
174// /* +34 */ float x34;
175// /* +38 */ float x38;
176// /* +3C */ float x3C;
177// /* +40 */ float x40;
178// /* +44 */ float _44[43];
179// };
180
182 /* +0 */ float x0;
183 /* +4 */ float x4;
184 /* +8 */ float x8;
185 /* +C */ float xC;
186 /* +10 */ float x10;
187 /* +14 */ float x14;
188 /* +18 */ float x18;
189 /* +1C */ float x1C;
190 /* +20 */ float x20;
191 /* +24 */ float x24;
192 /* +28 */ float x28;
193 /* +2C */ float x2C;
194 /* +30 */ float x30;
195 /* +34 */ float x34;
196 /* +38 */ float x38;
197 /* +3C */ float x3C;
198 /* +40 */ float x40;
199 /* +44 */ float x44;
200 /* +48 */ float x48;
201 /* +4C */ float x4C;
202 /* +50 */ float x50;
203 /* +54 */ float x54;
204 /* +58 */ float x58;
205 /* +5C */ float x5C;
206 /* +60 */ float x60;
207 /* +64 */ float x64;
208 /* +68 */ float x68;
209 /* +6C */ float x6C;
210 /* +70 */ float x70;
211 /* +74 */ float x74;
212 /* +78 */ float x78;
213 /* +7C */ float x7C;
214 /* +80 */ float x80;
215 /* +84 */ float x84;
216 /* +88 */ float x88;
217 /* +8C */ float x8C;
218 /* +90 */ float x90;
219 /* +94 */ float x94;
220 /* +98 */ float x98;
221 /* +9C */ float x9C;
222 /* +A0 */ float xA0;
223 /* +A4 */ float xA4;
224 /* +A8 */ float xA8;
225 /* +AC */ float xAC;
226 /* +B0 */ float xB0;
227 /* +B4 */ float xB4;
228 /* +B8 */ float xB8;
229 /* +BC */ float xBC;
230 /* +C0 */ float xC0;
231 /* +C4 */ float xC4;
232 /* +C8 */ float xC8;
233 /* +CC */ float xCC;
234 /* +D0 */ float xD0;
235 /* +D4 */ float xD4;
236 /* +D8 */ float xD8;
237 /* +DC */ float xDC;
238 /* +E0 */ float xE0;
239 /* +E4 */ float xE4;
240 /* +E8 */ float xE8;
241 /* +EC */ float xEC;
242};
243
245 void (*(callback[9]))(void*);
246};
247
249 /* +00 */ f32 stick_x;
250 /* +04 */ f32 stick_y;
251 /* +08 */ f32 substick_x;
252 /* +0C */ f32 substick_y;
254 /* +10 */ union {
255 u32 _u32[2];
256 u64 _u64;
258 /* +18 */ union {
259 u32 _u32[2];
260 u64 _u64;
262};
263
264#endif
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:248
u64 _u64
Definition types.h:256
f32 substick_x
Definition types.h:251
f32 stick_y
Definition types.h:250
u32 _u32[2]
Definition types.h:255
f32 substick_y
Definition types.h:252
union CameraInputs::@5 x18
union CameraInputs::@4 x10
f32 stick_x
Definition types.h:249
Definition types.h:244
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:181
float xBC
Definition types.h:229
float xC
Definition types.h:185
float x80
Definition types.h:214
float xA8
Definition types.h:224
float x10
Definition types.h:186
float x8C
Definition types.h:217
float xDC
Definition types.h:237
float x64
Definition types.h:207
float x48
Definition types.h:200
float x0
Definition types.h:182
float x6C
Definition types.h:209
float xB4
Definition types.h:227
float x58
Definition types.h:204
float x34
Definition types.h:195
float x38
Definition types.h:196
float x4C
Definition types.h:201
float x4
Definition types.h:183
float xCC
Definition types.h:233
float x60
Definition types.h:206
float x2C
Definition types.h:193
float x20
Definition types.h:190
float x54
Definition types.h:203
float x18
Definition types.h:188
float x70
Definition types.h:210
float xE8
Definition types.h:240
float xC0
Definition types.h:230
float x8
Definition types.h:184
float x88
Definition types.h:216
float x78
Definition types.h:212
float xA0
Definition types.h:222
float x1C
Definition types.h:189
float x44
Definition types.h:199
float xB0
Definition types.h:226
float x28
Definition types.h:192
float xD0
Definition types.h:234
float x90
Definition types.h:218
float x24
Definition types.h:191
float x14
Definition types.h:187
float xEC
Definition types.h:241
float x74
Definition types.h:211
float xA4
Definition types.h:223
float xD4
Definition types.h:235
float x7C
Definition types.h:213
float x94
Definition types.h:219
float x30
Definition types.h:194
float xAC
Definition types.h:225
float xC8
Definition types.h:232
float x3C
Definition types.h:197
float xC4
Definition types.h:231
float x68
Definition types.h:208
float xE4
Definition types.h:239
float xB8
Definition types.h:228
float x98
Definition types.h:220
float xD8
Definition types.h:236
float xE0
Definition types.h:238
float x40
Definition types.h:198
float x5C
Definition types.h:205
float x50
Definition types.h:202
float x84
Definition types.h:215
float x9C
Definition types.h:221
Definition types.h:68
f32 max_distance
Definition types.h:111
char pad_342[0x350 - 0x342]
Definition types.h:129
f32 min_distance
Definition types.h:110
Vec3 pause_eye_offset
Definition types.h:119
u8 x399_b7
Definition types.h:157
f32 pause_eye_distance
Definition types.h:121
Vec3 x368
Definition types.h:135
f32 x2DC
Definition types.h:103
f32 x2F0
Definition types.h:108
u8 x399_b2
Definition types.h:152
u8 x39A_b6
Definition types.h:164
s8 x2C5
Definition types.h:96
f32 x2C0
Definition types.h:94
u8 x398_b5
Definition types.h:149
s32 x300
Definition types.h:112
u8 x341_b7
Definition types.h:128
Vec2 translation
Definition types.h:81
f32 x2D8
Definition types.h:102
char pad_39B
Definition types.h:166
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
union Camera::@3 x378
s8 x306
Definition types.h:115
f32 x2F4
Definition types.h:109
s32 x37C
Definition types.h:142
u8 background_r
Definition types.h:71
u8 x39A_b2
Definition types.h:160
struct CameraQuake _B0[2][8]
Definition types.h:87
f32 x374
Definition types.h:136
HSD_GObj * gobj
Definition types.h:69
u8 x399_b6
Definition types.h:156
f32 x32C
Definition types.h:120
s8 x304
Definition types.h:113
u8 x39A_b7
Definition types.h:165
u8 x398_b4
Definition types.h:148
Vec3 x308
Definition types.h:117
f32 x2E4
Definition types.h:105
u8 x399_b5
Definition types.h:155
u8 x399_b3
Definition types.h:153
float x2B4
Definition types.h:90
u8 x341_b5_b6
Definition types.h:127
s32 s32
Definition types.h:139
float pitch_offset
Definition types.h:98
float x2B0
Definition types.h:89
u8 x399_b4
Definition types.h:154
CameraTransformState transform
Definition types.h:77
f32 xA4
Definition types.h:84
u8 x398_b1
Definition types.h:145
s16 x2B8
Definition types.h:91
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:163
union Camera::@2 x35C
u8 background_b
Definition types.h:73
f32 farz
Definition types.h:76
f32 f32
Definition types.h:138
u8 x380[0x18]
Definition types.h:143
u8 x398_b0
Definition types.h:144
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:161
f32 xA8
Definition types.h:85
Vec3 x350
Definition types.h:130
u8 x39A_b1
Definition types.h:159
u8 x398_b2
Definition types.h:146
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:150
Vec3 pause_up
Definition types.h:122
u8 x39A_b4
Definition types.h:162
u8 x399_b0_b1
Definition types.h:151
f32 nearz
Definition types.h:75
u8 x398_b3
Definition types.h:147
float yaw_offset
Definition types.h:99
u8 x39A_b0
Definition types.h:158
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