NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
g3d_resanmcamera.h
1#ifndef NW4R_G3D_RES_RES_ANM_CAMERA_H
2#define NW4R_G3D_RES_RES_ANM_CAMERA_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/g3d/res/g3d_resanm.h>
6#include <nw4r/g3d/res/g3d_rescommon.h>
7
8#include <nw4r/math.h>
9
10#include <revolution/GX.h>
11
12namespace nw4r {
13namespace g3d {
14
15/******************************************************************************
16 *
17 * Common types
18 *
19 ******************************************************************************/
21 enum CameraType {
22 CAMERATYPE_ROTATE,
23 CAMERATYPE_AIM,
24
25 CAMERATYPE_MAX
26 };
27};
28
29/******************************************************************************
30 *
31 * CameraAnmResult
32 *
33 ******************************************************************************/
35 enum Flag { FLAG_CAMERA_TYPE_MASK = (1 << 0), FLAG_ANM_EXISTS = (1 << 1) };
36
37 ulong flags; // at 0x0
38 GXProjectionType projType; // at 0x4
39 math::VEC3 pos; // at 0x8
40 f32 aspect; // at 0x14
41 f32 near; // at 0x18
42 f32 far; // at 0x1C
43
44 union {
45 struct {
46 math::_VEC3 rot; // at 0x20
47 } rotate;
48
49 struct {
50 math::_VEC3 aim; // at 0x20
51 f32 twist; // at 0x2C
52 } aim;
53 };
54
55 union {
56 f32 perspFovy; // at 0x30
57 f32 orthoHeight; // at 0x30
58 };
59};
60
61/******************************************************************************
62 *
63 * ResAnmCamera
64 *
65 ******************************************************************************/
67 enum Flag {
68 FLAG_CAMERA_TYPE_MASK = (1 << 0),
69 FLAG_ANM_EXISTS = (1 << 1),
70
71 FLAG_POS_X_CONST = (1 << 17),
72 FLAG_POS_Y_CONST = (1 << 18),
73 FLAG_POS_Z_CONST = (1 << 19),
74
75 FLAG_ASPECT_CONST = (1 << 20),
76 FLAG_NEAR_CONST = (1 << 21),
77 FLAG_FAR_CONST = (1 << 22),
78
79 FLAG_PERSP_FOVY_CONST = (1 << 23),
80 FLAG_ORTHO_HEIGHT_CONST = (1 << 24),
81
82 FLAG_AIM_X_CONST = (1 << 25),
83 FLAG_AIM_Y_CONST = (1 << 26),
84 FLAG_AIM_Z_CONST = (1 << 27),
85 FLAG_TWIST_CONST = (1 << 28),
86
87 FLAG_ROT_X_CONST = (1 << 29),
88 FLAG_ROT_Y_CONST = (1 << 30),
89 FLAG_ROT_Z_CONST = (1 << 31)
90 };
91
92 ulong size; // at 0x0
93 s32 toResAnmScnData; // at 0x4
94 s32 name; // at 0x8
95 ulong id; // at 0xC
96 ulong refNumber; // at 0x10
97 GXProjectionType projType; // at 0x14
98 ulong flags; // at 0x18
99 s32 toResUserData; // at 0x1C
100 ResAnmData posX; // at 0x20
101 ResAnmData posY; // at 0x24
102 ResAnmData posZ; // at 0x28
103 ResAnmData aspect; // at 0x2C
104 ResAnmData near; // at 0x30
105 ResAnmData far; // at 0x34
106 ResAnmData rotX; // at 0x38
107 ResAnmData rotY; // at 0x3C
108 ResAnmData rotZ; // at 0x40
109 ResAnmData aimX; // at 0x44
110 ResAnmData aimY; // at 0x48
111 ResAnmData aimZ; // at 0x4C
112 ResAnmData twist; // at 0x50
113 ResAnmData perspFovy; // at 0x54
114 ResAnmData orthoHeight; // at 0x58
115};
116
117class ResAnmCamera : public ResCommon<ResAnmCameraData>,
119public:
120 NW4R_G3D_RESOURCE_FUNC_DEF(ResAnmCamera);
121
122 void GetAnmResult(CameraAnmResult* pResult, f32 frame) const;
123
124 ulong GetID() const {
125 return ref().id;
126 }
127};
128
129} // namespace g3d
130} // namespace nw4r
131
132#endif
3D graphics drawing library.
Definition g3d_3dsmax.h:10