NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
scn_obj.hpp
1#pragma once
2
3#include <lib/nw4r/g3d/g3d_obj.hpp>
4#include <lib/nw4r/math/aabb.hpp>
5#include <lib/nw4r/math/mtx.hpp>
6
7#include <lib/rvl/mem/MEMHeapCommon.h>
8
9namespace nw4r {
10namespace g3d {
11
12class ScnObj : public G3dObj {
13public:
14 virtual ~ScnObj();
15 virtual void ForEach(); // can't be bothered to enter the actual signature rn
16 virtual void SetScnObjOption(ulong option, ulong value);
17 virtual bool GetScnObjOption(ulong option, ulong *value) const;
18 virtual float GetValueForSortOpa() const;
19 virtual float GetValueForSortXlu() const;
20 void SetPriorityDrawOpa(int priority);
21 void SetPriorityDrawXlu(int priority);
22
23 enum ScnObjMtxType {
24 TYPE_LOCAL,
25 TYPE_UNK,
26 TYPE_VIEW
27 };
28
29 /// @brief Operation options for ScnObj.
30 enum OptID {
31 OPTID_DISABLE_GATHER_DRAW_SCNOBJ = 1, ///< Execution of ScnRoot::GatherDrawScnObj is skipped.
32 OPTID_DISABLE_CALC_WORLD, ///< Execution of ScnRoot::CalcWorld is skipped.
33 OPTID_DISABLE_CALC_MAT, ///< Execution of ScnRoot::CalcMaterial is skipped.
34 OPTID_DISABLE_CALC_VTX, ///< Execution of ScnRoot::CalcVtx is skipped.
35 OPTID_DISABLE_CALC_VIEW, ///< Execution of ScnRoot::CalcView is skipped.
36 OPTID_DISABLE_DRAW_OPA, ///< Execution of ScnRoot::DrawOpa is skipped.
37 OPTID_DISABLE_DRAW_XLU, ///< Execution of ScnRoot::DrawXlu is skipped.
38 OPTID_DISABLE_UPDATEFRAME, ///< Execution of ScnRoot::UpdateFrame is skipped.
39 OPTID_ENABLE_CULLING, ///< Enables culling based on the bounding volume (AABB).
40 };
41
42 enum Timing {
43 CALLBACK_TIMING_A = BIT_FLAG(0), ///< Callback processing is performed before making calculations.
44 CALLBACK_TIMING_B = BIT_FLAG(1), ///< Callback processing is performed in the middle of making calculations.
45 CALLBACK_TIMING_C = BIT_FLAG(2), ///< Callback processing is performed after making calculations.
47 };
48
49 virtual void CalcWorldMtx(const nw4r::math::MTX34 *, unsigned long *) const;
50
51 void SetMtx(ScnObjMtxType, const nw4r::math::MTX34 *);
52 void GetMtx(ScnObjMtxType, nw4r::math::MTX34 *) const;
53
54 NW4R_G3D_TYPE_OBJ_DECL(ScnObj);
55
56 u32 unk1;
57 MEMAllocator *mpAllocator;
58 math::MTX34 mMtxs[3];
59 math::AABB aabbs[2];
60 u32 mFlags;
61 u8 opaPriority;
62 u8 xluPriority;
63 u32 unk2;
64 u8 callbackTimingFlags;
65 u16 scnCallbackOp;
66};
67
68} // namespace g3d
69} // namespace nw4r
@ CALLBACK_TIMING_A
Callback processing is performed before making calculations.
Definition scn_obj.hpp:43
@ CALLBACK_TIMING_B
Callback processing is performed in the middle of making calculations.
Definition scn_obj.hpp:44
@ CALLBACK_TIMING_C
Callback processing is performed after making calculations.
Definition scn_obj.hpp:45
OptID
Operation options for ScnObj.
Definition scn_obj.hpp:30
@ OPTID_DISABLE_CALC_WORLD
Execution of ScnRoot::CalcWorld is skipped.
Definition scn_obj.hpp:32
@ OPTID_DISABLE_UPDATEFRAME
Execution of ScnRoot::UpdateFrame is skipped.
Definition scn_obj.hpp:38
@ OPTID_DISABLE_CALC_MAT
Execution of ScnRoot::CalcMaterial is skipped.
Definition scn_obj.hpp:33
@ OPTID_ENABLE_CULLING
Enables culling based on the bounding volume (AABB).
Definition scn_obj.hpp:39
@ OPTID_DISABLE_GATHER_DRAW_SCNOBJ
Execution of ScnRoot::GatherDrawScnObj is skipped.
Definition scn_obj.hpp:31
@ OPTID_DISABLE_CALC_VTX
Execution of ScnRoot::CalcVtx is skipped.
Definition scn_obj.hpp:34
@ OPTID_DISABLE_CALC_VIEW
Execution of ScnRoot::CalcView is skipped.
Definition scn_obj.hpp:35
@ OPTID_DISABLE_DRAW_OPA
Execution of ScnRoot::DrawOpa is skipped.
Definition scn_obj.hpp:36
@ OPTID_DISABLE_DRAW_XLU
Execution of ScnRoot::DrawXlu is skipped.
Definition scn_obj.hpp:37
3D graphics drawing library.
Definition docgroup.h:10
An axis-aligned bounding box.
Definition aabb.hpp:9
A 3x4 matrix.
Definition mtx.hpp:15