NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
scn_leaf.cpp
1#include <game/mLib/m_3d.hpp>
2
3m3d::scnLeaf_c::scnLeaf_c() {
4 mpScn = nullptr;
5}
6
7m3d::scnLeaf_c::~scnLeaf_c() {
8 scnLeaf_c::remove();
9}
10
11void m3d::scnLeaf_c::remove() {
12 if (mpScn == nullptr) {
13 return;
14 }
15 mpScn->Destroy();
16 mpScn = nullptr;
17}
18
19void m3d::scnLeaf_c::entry() {
20 m3d::pushBack(mpScn);
21}
22
23void m3d::scnLeaf_c::setOption(ulong option, ulong value) {
24 mpScn->SetScnObjOption(option, value);
25}
26
27bool m3d::scnLeaf_c::getOption(ulong option, ulong *value) const {
28 return mpScn->GetScnObjOption(option, value);
29}
30
31void m3d::scnLeaf_c::setScale(float x, float y, float z) {
32 mpScn->SetScale(x, y, z);
33}
34
35void m3d::scnLeaf_c::setScale(const nw4r::math::VEC3 &scale) {
36 mpScn->SetScale(scale);
37}
38
39void m3d::scnLeaf_c::setLocalMtx(const nw4r::math::MTX34 *mtx) {
40 mpScn->SetMtx(nw4r::g3d::ScnObj::TYPE_LOCAL, mtx);
41}
42
43void m3d::scnLeaf_c::getLocalMtx(nw4r::math::MTX34 *mtx) const {
44 mpScn->GetMtx(nw4r::g3d::ScnObj::TYPE_LOCAL, mtx);
45}
46
47void m3d::scnLeaf_c::getViewMtx(nw4r::math::MTX34 *mtx) const {
48 mpScn->GetMtx(nw4r::g3d::ScnObj::TYPE_VIEW, mtx);
49}
50
51void m3d::scnLeaf_c::calc(bool keepEnabledAfter) {
53 mpScn->G3dProc(nw4r::g3d::G3dObj::G3DPROC_CALC_WORLD, 0, nullptr);
54 if (!keepEnabledAfter) {
56 }
57}
58
59void m3d::scnLeaf_c::calcVtx(bool keepEnabledAfter) {
61 mpScn->G3dProc(nw4r::g3d::G3dObj::G3DPROC_CALC_VTX, 0, nullptr);
62 if (!keepEnabledAfter) {
64 }
65}
66
67void m3d::scnLeaf_c::setPriorityDraw(int prioOpa, int prioXlu) {
68 mpScn->SetPriorityDrawOpa(prioOpa);
69 mpScn->SetPriorityDrawXlu(prioXlu);
70}
@ G3DPROC_CALC_VTX
Performs vertex array calculations.
Definition g3d_obj.hpp:44
@ G3DPROC_CALC_WORLD
Calculates the world transform matrix.
Definition g3d_obj.hpp:42
@ OPTID_DISABLE_CALC_WORLD
Execution of ScnRoot::CalcWorld is skipped.
Definition scn_obj.hpp:32
@ OPTID_DISABLE_CALC_VTX
Execution of ScnRoot::CalcVtx is skipped.
Definition scn_obj.hpp:34