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
11struct CameraBox {
14 bool x8;
15 /* +C:0 */ u8 xC_b0 : 1;
16 /* +C:1 */ u8 xC_b1 : 1;
17 /* +C:2 */ u8 xC_b2 : 1;
18 s16 xE;
19 Vec3 x10; // might be Vec2?
20 Vec3 x1C;
21 float x28;
22 Vec2 x2C;
23 Vec3 x34;
24 Vec2 x40;
25 Vec3 x48;
26 Vec3 x54;
27 Vec3 x60;
28};
29
31 /* +0 */ Vec3 interest;
32 /* +C */ Vec3 target_interest;
33 /* +18 */ Vec3 position;
34 /* +24 */ Vec3 target_position;
35 /* +30 */ float fov;
36 /* +34 */ float target_fov;
37};
38
40 float x_min;
41 float y_min;
42 float x_max;
43 float y_max;
45 float z_pos;
46};
47
49 /* 0x0 */ s32 x0;
50 /* 0x4 */ s32 x4;
51 /* 0x8 */ s32 x8;
52 /* 0xC */ s32 xC;
53};
54
55typedef struct Camera {
56 /* 0x000 */ HSD_GObj* gobj;
57 /* 0x004 */ u32 mode;
58 /* 0x008 */ u8 background_r;
59 /* 0x009 */ u8 background_g;
60 /* 0x00A */ u8 background_b;
61 /* 0x00B */ s8 pad_B;
62 /* 0x00C */ f32 nearz;
63 /* 0x010 */ f32 farz;
66 /* 0x084 */ Vec2 translation;
67 /* 0x08C */ s32 unk_8C[5]; /* maybe part of translation[4]? */
68 /* 0x0A0 */ HSD_GObj* unk_A0;
69 /* 0x0A4 */ f32 unk_A4;
70 /* 0x0A8 */ f32 unk_A8;
71 /* 0x0AC */ f32 unk_AC; /* inferred */
72 /* 0x0B0 */ struct UnkInternalCameraStruct unk_B0[2][8];
73 /* 0x1B0 */ struct UnkInternalCameraStruct unk_1B0[2][8];
74 /* 0x2B0 */ u8 pad_2B0[0x2BA - 0x2B0];
75 /* 0x2BA */ s16 unk_2ba;
76 /* 0x2BC */ f32 unk_2bc;
77 /* 0x2C0 */ f32 unk_2c0;
78 /* 0x2C4 */ char pad_2C4[0x7D]; /* maybe part of unk_2c0[0x20]? */
79 /* 0x341:0 */ u8 unk_341_b0 : 1;
80 /* 0x341:1 */ u8 unk_341_b1 : 1;
81 /* 0x341:2 */ u8 unk_341_b2 : 1;
82 /* 0x341:3 */ u8 unk_341_b3 : 1;
83 /* 0x341:4 */ u8 unk_341_b4 : 1;
84 /* 0x341:5 */ u8 unk_341_b5 : 1;
85 /* 0x341:6 */ u8 unk_341_b6 : 1;
86 /* 0x341:7 */ u8 unk_341_b7 : 1;
87 /* 0x342 */ char pad_342[0x56]; /* maybe part of unk_341[0x57]? */
88 /* 0x398:0 */ u8 unk_398_b0 : 1;
89 /* 0x398:1 */ u8 unk_398_b1 : 1;
90 /* 0x398:2 */ u8 unk_398_b2 : 1;
91 /* 0x398:3 */ u8 unk_398_b3 : 1;
92 /* 0x398:4 */ u8 unk_398_b4 : 1;
93 /* 0x398:5 */ u8 unk_398_b5 : 1;
94 /* 0x398:6 */ u8 unk_398_b6_b7 : 2;
95 /* 0x399:0 */ u8 unk_399_b0_b1 : 2;
96 /* 0x399:2 */ u8 unk_399_b2 : 1;
97 /* 0x399:3 */ u8 unk_399_b3 : 1;
98 /* 0x399:4 */ u8 unk_399_b4 : 1;
99 /* 0x399:5 */ u8 unk_399_b5 : 1;
100 /* 0x399:6 */ u8 unk_399_b6 : 1;
101 /* 0x399:7 */ u8 unk_399_b7 : 1;
102 /* 0x39A:0 */ u8 unk_39A_b0 : 1;
103 /* 0x39A:1 */ u8 unk_39A_b1 : 1;
104 /* 0x39A:2 */ u8 unk_39A_b2 : 1;
105 /* 0x39A:3 */ u8 unk_39A_b3 : 1;
106 /* 0x39A:4 */ u8 unk_39A_b4 : 1;
107 /* 0x39A:5 */ u8 unk_39A_b5 : 1;
108 /* 0x39A:6 */ u8 unk_39A_b6 : 1;
109 /* 0x39A:7 */ u8 unk_39A_b7 : 1;
110 /* 0x39B */ char pad_39B[5]; /* maybe part of unk_39A[6]? */
111 /* 0x3A0 */ u32 last_mode;
112} Camera; /* size = 0x3A4 */
113
115STATIC_ASSERT(sizeof(struct Camera) == 0x3A4);
116
118 /* +0 */ float _0[11];
119 /* +2C */ float x2C;
120 /* +30 */ float x30;
121 /* +34 */ float x34;
122 /* +38 */ float x38;
123 /* +3C */ float x3C;
124 /* +40 */ float x40;
125 /* +44 */ float _44[43];
126};
127
128// global vars for camera mode 7 and 8
129// mode 7 will attach and follow a player, and 8 is free cam
131 /* +00 */ u32 last_mode;
132 /* +04 */ int ply_slot;
133 /* +08 */ Vec3 mode7_int_offset;
134 /* +14 */ Vec3 mode7_eye_offset;
135 /* +20 */ Vec3 mode7_eye_pos;
136 /* +2C */ Vec3 mode7_int_pos;
137 /* +38 */ float mode7_fov;
138 /* +3C */ Vec3 mode8_int_pos;
139 /* +48 */ Vec3 mode8_eye_pos;
140 /* +54 */ float mode8_fov;
141 /* +58 */ u8 x4c[0x8]; // padding? not sure if this is correct
142};
143
145 void* mode_0;
146 void* mode_1;
147 void* mode_2;
148 void* mode_3;
149 void* mode_4;
150 void* mode_5;
151 void* mode_6;
152 void* mode_7;
153 void* mode_8;
154};
155
157 float x0;
158 float x4;
159 float x8;
160 float xC;
161 float x10;
162};
163
164#endif
#define STATIC_ASSERT(cond)
Definition platform.h:102
Definition types.h:39
float z_pos
Definition types.h:45
int subjects
Definition types.h:44
float y_max
Definition types.h:43
float x_max
Definition types.h:42
float y_min
Definition types.h:41
float x_min
Definition types.h:40
Definition types.h:11
CameraBox * prev
Definition types.h:13
s16 xE
Definition types.h:18
Vec3 x1C
Definition types.h:20
Vec3 x60
Definition types.h:27
Vec3 x10
Definition types.h:19
bool x8
Definition types.h:14
CameraBox * next
Definition types.h:12
Vec3 x54
Definition types.h:26
Vec2 x40
Definition types.h:24
Vec3 x34
Definition types.h:23
u8 xC_b2
Definition types.h:17
u8 xC_b0
Definition types.h:15
Vec2 x2C
Definition types.h:22
u8 xC_b1
Definition types.h:16
Vec3 x48
Definition types.h:25
float x28
Definition types.h:21
Definition types.h:130
Vec3 mode8_int_pos
Definition types.h:138
u8 x4c[0x8]
Definition types.h:141
Vec3 mode7_int_offset
Definition types.h:133
Vec3 mode7_eye_offset
Definition types.h:134
float mode8_fov
Definition types.h:140
Vec3 mode8_eye_pos
Definition types.h:139
float mode7_fov
Definition types.h:137
Vec3 mode7_int_pos
Definition types.h:136
u32 last_mode
Definition types.h:131
Vec3 mode7_eye_pos
Definition types.h:135
int ply_slot
Definition types.h:132
Definition types.h:156
float x0
Definition types.h:157
float xC
Definition types.h:160
float x8
Definition types.h:159
float x10
Definition types.h:161
float x4
Definition types.h:158
Definition types.h:144
void * mode_1
Definition types.h:146
void * mode_2
Definition types.h:147
void * mode_4
Definition types.h:149
void * mode_5
Definition types.h:150
void * mode_7
Definition types.h:152
void * mode_3
Definition types.h:148
void * mode_8
Definition types.h:153
void * mode_6
Definition types.h:151
void * mode_0
Definition types.h:145
Definition types.h:30
float fov
Definition types.h:35
float target_fov
Definition types.h:36
Vec3 target_interest
Definition types.h:32
Vec3 target_position
Definition types.h:34
Vec3 position
Definition types.h:33
Vec3 interest
Definition types.h:31
Definition types.h:117
float x34
Definition types.h:121
float x38
Definition types.h:122
float x2C
Definition types.h:119
float _44[43]
Definition types.h:125
float x30
Definition types.h:120
float x3C
Definition types.h:123
float _0[11]
Definition types.h:118
float x40
Definition types.h:124
Definition types.h:55
u8 unk_39A_b3
Definition types.h:105
u8 unk_39A_b2
Definition types.h:104
CameraMovement movement
Definition types.h:64
u8 unk_39A_b4
Definition types.h:106
u8 unk_341_b6
Definition types.h:85
u8 unk_341_b3
Definition types.h:82
struct UnkInternalCameraStruct unk_B0[2][8]
Definition types.h:72
u8 pad_2B0[0x2BA - 0x2B0]
Definition types.h:74
CameraMovement movement_lerp
Definition types.h:65
u8 unk_398_b2
Definition types.h:90
u32 mode
Definition types.h:57
u8 unk_399_b7
Definition types.h:101
u8 unk_341_b0
Definition types.h:79
Vec2 translation
Definition types.h:66
char pad_342[0x56]
Definition types.h:87
u8 unk_398_b4
Definition types.h:92
char pad_39B[5]
Definition types.h:110
u8 unk_341_b2
Definition types.h:81
u8 background_g
Definition types.h:59
u8 unk_341_b1
Definition types.h:80
u8 unk_39A_b6
Definition types.h:108
u8 background_r
Definition types.h:58
struct UnkInternalCameraStruct unk_1B0[2][8]
Definition types.h:73
HSD_GObj * gobj
Definition types.h:56
HSD_GObj * unk_A0
Definition types.h:68
u8 unk_39A_b5
Definition types.h:107
s32 unk_8C[5]
Definition types.h:67
char pad_2C4[0x7D]
Definition types.h:78
f32 unk_2c0
Definition types.h:77
u8 unk_398_b3
Definition types.h:91
u8 unk_399_b5
Definition types.h:99
f32 unk_A8
Definition types.h:70
f32 unk_A4
Definition types.h:69
u8 unk_398_b0
Definition types.h:88
u8 unk_341_b5
Definition types.h:84
u8 background_b
Definition types.h:60
f32 farz
Definition types.h:63
s16 unk_2ba
Definition types.h:75
s8 pad_B
Definition types.h:61
u8 unk_341_b7
Definition types.h:86
u8 unk_39A_b0
Definition types.h:102
u8 unk_399_b0_b1
Definition types.h:95
u32 last_mode
Definition types.h:111
u8 unk_341_b4
Definition types.h:83
f32 unk_2bc
Definition types.h:76
u8 unk_398_b1
Definition types.h:89
f32 unk_AC
Definition types.h:71
u8 unk_39A_b7
Definition types.h:109
u8 unk_39A_b1
Definition types.h:103
u8 unk_398_b6_b7
Definition types.h:94
u8 unk_399_b2
Definition types.h:96
u8 unk_399_b4
Definition types.h:98
u8 unk_398_b5
Definition types.h:93
f32 nearz
Definition types.h:62
u8 unk_399_b6
Definition types.h:100
u8 unk_399_b3
Definition types.h:97
Definition gobj.h:25
Definition types.h:48
s32 xC
Definition types.h:52
s32 x0
Definition types.h:49
s32 x4
Definition types.h:50
s32 x8
Definition types.h:51