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; // position?
21 float x28; // direction?
22 Vec2 x2C;
23 Vec3 x34; // size?
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 */ Vec3 x0;
50 /* 0xC */ int type;
51};
52
53// global vars for camera mode 7 and 8
54// mode 7 will attach and follow a player, and 8 is free cam
62 float mode7_fov;
65 float mode8_fov;
66 u8 _4C[8]; // padding? not sure if this is correct
67};
68
69typedef struct Camera {
70 /* 0x000 */ HSD_GObj* gobj;
71 /* 0x004 */ int mode;
72 /* 0x008 */ u8 background_r;
73 /* 0x009 */ u8 background_g;
74 /* 0x00A */ u8 background_b;
75 /* 0x00B */ s8 xB;
76 /* 0x00C */ f32 nearz;
77 /* 0x010 */ f32 farz;
79 /* 0x04C */ CameraTransformState transform_copy; // this runs the same tween logic, but isnt used for anything?
80 /* 0x084 */ Vec2 translation;
81 /* 0x08C */ s32 _8C[5]; /* maybe part of translation[4]? */
82 /* 0x0A0 */ HSD_GObj* xA0;
83 /* 0x0A4 */ f32 xA4;
84 /* 0x0A8 */ f32 xA8;
85 /* 0x0AC */ f32 xAC; /* inferred */
86 /* 0x0B0 */ struct CameraQuake _B0[2][8];
87 /* 0x1B0 */ struct CameraQuake _1B0[2][8];
88 /* 0x2B0 */ float x2B0;
89 /* 0x2B4 */ float x2B4;
90 /* 0x2B8 */ s16 x2B8;
91 /* 0x2BA */ s16 x2BA;
92 /* 0x2BC */ f32 x2BC;
93 /* 0x2C0 */ f32 x2C0;
94 /* 0x2C4 */ s8 x2C4; /* unk player slot */
95 /* 0x2C5 */ s8 x2C5;
96 /* 0x2C6 */ char pad_2C6[0x2C8 - 0x2C6];
97 /* 0x2C8 */ float pitch_offset;
98 /* 0x2CC */ float yaw_offset;
99 /* 0x2D0 */ char pad_2D0[0x2F8 - 0x2D0];
100 /* 0x2F8 */ f32 min_distance;
101 /* 0x2FC */ f32 max_distance;
102 /* 0x300 */ char pad_300[0x320 - 0x300];
103 /* 0x320 */ Vec3 pause_eye_offset; /* offset from focused player */
104 /* 0x32C */ f32 x32C;
105 /* 0x330 */ f32 pause_eye_distance; /* distance to focused player */
106 /* 0x334 */ Vec3 pause_up; /* up vector */
107 /* 0x340 */ u8 x340;
108 /* 0x341:0 */ u8 x341_b0 : 1;
109 /* 0x341:1 */ u8 x341_b1_b2 : 2;
110 /* 0x341:3 */ u8 x341_b3_b4 : 2;
111 /* 0x341:5 */ u8 x341_b5_b6 : 2;
112 /* 0x341:7 */ u8 x341_b7 : 1;
113 /* 0x342 */ char pad_342[0x350 - 0x342]; /* maybe part of unk_341[0x57]? */
114 /* 0x350 */ Vec3 x350;
115 /* 0x35C */ union {
116 Vec3 vec;
117 s32 (*cb)(Vec3*);
119 /* 0x368 */ Vec3 x368;
120 /* 0x374 */ f32 x374;
121 /* 0x378 */ f32 x378;
122 /* 0x378 */ char pad_37C[0x398 - 0x37C];
123 /* 0x398:0 */ u8 x398_b0 : 1;
124 /* 0x398:1 */ u8 x398_b1 : 1;
125 /* 0x398:2 */ u8 x398_b2 : 1;
126 /* 0x398:3 */ u8 x398_b3 : 1;
127 /* 0x398:4 */ u8 x398_b4 : 1;
128 /* 0x398:5 */ u8 x398_b5 : 1;
129 /* 0x398:6 */ u8 x398_b6_b7 : 2;
130 /* 0x399:0 */ u8 x399_b0_b1 : 2;
131 /* 0x399:2 */ u8 x399_b2 : 1;
132 /* 0x399:3 */ u8 x399_b3 : 1;
133 /* 0x399:4 */ u8 x399_b4 : 1;
134 /* 0x399:5 */ u8 x399_b5 : 1;
135 /* 0x399:6 */ u8 x399_b6 : 1;
136 /* 0x399:7 */ u8 x399_b7 : 1;
137 /* 0x39A:0 */ u8 x39A_b0 : 1;
138 /* 0x39A:1 */ u8 x39A_b1 : 1;
139 /* 0x39A:2 */ u8 x39A_b2 : 1;
140 /* 0x39A:3 */ u8 x39A_b3 : 1;
141 /* 0x39A:4 */ u8 x39A_b4 : 1;
142 /* 0x39A:5 */ u8 x39A_b5 : 1;
143 /* 0x39A:6 */ u8 x39A_b6 : 1;
144 /* 0x39A:7 */ u8 x39A_b7 : 1;
145 /* 0x39B */ char pad_39B; /* maybe part of unk_39A[6]? */
146 /* 0x39C */ struct CameraDebugMode debug_mode;
147} Camera; /* size = 0x3A4 */
148
150// STATIC_ASSERT(sizeof(struct Camera) == 0x3A4);
151
153 /* +0 */ float _0[11];
154 /* +2C */ float x2C;
155 /* +30 */ float x30;
156 /* +34 */ float x34;
157 /* +38 */ float x38;
158 /* +3C */ float x3C;
159 /* +40 */ float x40;
160 /* +44 */ float _44[43];
161};
163 void (*(callback[9]))(void*);
164};
165
166#endif
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:55
Vec3 mode8_int_pos
Definition types.h:63
int last_mode
Definition types.h:56
Vec3 mode7_int_offset
Definition types.h:58
Vec3 mode7_eye_offset
Definition types.h:59
float mode8_fov
Definition types.h:65
Vec3 mode8_eye_pos
Definition types.h:64
float mode7_fov
Definition types.h:62
Vec3 mode7_int_pos
Definition types.h:61
Vec3 mode7_eye_pos
Definition types.h:60
u8 _4C[8]
Definition types.h:66
int ply_slot
Definition types.h:57
Definition types.h:162
void callback(void *)
Definition types.h:48
Vec3 x0
Definition types.h:49
int type
Definition types.h:50
Definition types.h:30
Vec3 position
Definition types.h:33
float target_fov
Definition types.h:36
float fov
Definition types.h:35
Vec3 target_interest
Definition types.h:32
Vec3 target_position
Definition types.h:34
Vec3 interest
Definition types.h:31
Definition types.h:152
float x34
Definition types.h:156
float x38
Definition types.h:157
float x2C
Definition types.h:154
float _44[43]
Definition types.h:160
float x30
Definition types.h:155
float x3C
Definition types.h:158
float _0[11]
Definition types.h:153
float x40
Definition types.h:159
Definition types.h:69
f32 max_distance
Definition types.h:101
char pad_342[0x350 - 0x342]
Definition types.h:113
f32 min_distance
Definition types.h:100
Vec3 pause_eye_offset
Definition types.h:103
u8 x399_b7
Definition types.h:136
f32 pause_eye_distance
Definition types.h:105
Vec3 x368
Definition types.h:119
struct CameraDebugMode debug_mode
Definition types.h:146
u8 x399_b2
Definition types.h:131
u8 x39A_b6
Definition types.h:143
s8 x2C5
Definition types.h:95
f32 x2C0
Definition types.h:93
u8 x398_b5
Definition types.h:128
u8 x341_b7
Definition types.h:112
Vec2 translation
Definition types.h:80
char pad_39B
Definition types.h:145
u8 x341_b3_b4
Definition types.h:110
u8 background_g
Definition types.h:73
char pad_2C6[0x2C8 - 0x2C6]
Definition types.h:96
u8 background_r
Definition types.h:72
u8 x39A_b2
Definition types.h:139
struct CameraQuake _B0[2][8]
Definition types.h:86
f32 x374
Definition types.h:120
HSD_GObj * gobj
Definition types.h:70
u8 x399_b6
Definition types.h:135
int mode
Definition types.h:71
f32 x32C
Definition types.h:104
u8 x39A_b7
Definition types.h:144
u8 x398_b4
Definition types.h:127
u8 x399_b5
Definition types.h:134
u8 x399_b3
Definition types.h:132
float x2B4
Definition types.h:89
u8 x341_b5_b6
Definition types.h:111
float pitch_offset
Definition types.h:97
float x2B0
Definition types.h:88
u8 x399_b4
Definition types.h:133
CameraTransformState transform
Definition types.h:78
f32 xA4
Definition types.h:83
u8 x398_b1
Definition types.h:124
s16 x2B8
Definition types.h:90
u8 x341_b1_b2
Definition types.h:109
f32 xAC
Definition types.h:85
s8 x2C4
Definition types.h:94
u8 x39A_b5
Definition types.h:142
union Camera::@2 x35C
u8 background_b
Definition types.h:74
f32 farz
Definition types.h:77
u8 x398_b0
Definition types.h:123
Vec3 vec
Definition types.h:116
s16 x2BA
Definition types.h:91
char pad_37C[0x398 - 0x37C]
Definition types.h:122
u8 x340
Definition types.h:107
struct CameraQuake _1B0[2][8]
Definition types.h:87
u8 x39A_b3
Definition types.h:140
f32 xA8
Definition types.h:84
Vec3 x350
Definition types.h:114
u8 x39A_b1
Definition types.h:138
char pad_300[0x320 - 0x300]
Definition types.h:102
u8 x398_b2
Definition types.h:125
f32 x378
Definition types.h:121
u8 x341_b0
Definition types.h:108
HSD_GObj * xA0
Definition types.h:82
s32 _8C[5]
Definition types.h:81
f32 x2BC
Definition types.h:92
char pad_2D0[0x2F8 - 0x2D0]
Definition types.h:99
u8 x398_b6_b7
Definition types.h:129
Vec3 pause_up
Definition types.h:106
u8 x39A_b4
Definition types.h:141
u8 x399_b0_b1
Definition types.h:130
f32 nearz
Definition types.h:76
u8 x398_b3
Definition types.h:126
float yaw_offset
Definition types.h:98
u8 x39A_b0
Definition types.h:137
CameraTransformState transform_copy
Definition types.h:79
s8 xB
Definition types.h:75
Definition gobj.h:26