summaryrefslogtreecommitdiff
path: root/include/m/m3d/m_scnleaf.h
blob: b0ad5dd523cb2af9ff6db20335d66953e311aecc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef M3D_M_SCNLEAF_H
#define M3D_M_SCNLEAF_H

#include "egg/core/eggDisposer.h"
#include "m/m_allocator.h"
#include "nw4r/g3d/g3d_scnobj.h"

namespace m3d {

// NON-OFFICIAL
enum ScnLeafType_e {
    SCN_LEAF_MODEL = 0,
    SCN_LEAF_PROC = 2,
};

class UnkClass {
public:
    UnkClass() {}
};

// Note: Due to multiple inheritance, vtable offsets are shifted by 8
class scnLeaf_c : UnkClass, EGG::Disposer {
public:
    scnLeaf_c();
    /* vt 0x08 */ virtual ~scnLeaf_c();
    /* vt 0x0C */ virtual int getType() const = 0;
    /* vt 0x10 */ virtual void remove();
    /* vt 0x14 */ virtual int entry();

    void setOption(u32 flag, u32 set);
    void setScale(f32, f32, f32);
    void setScale(const nw4r::math::VEC3 &);
    void getScale(nw4r::math::VEC3 *) const;

    void setLocalMtx(const nw4r::math::MTX34 *);
    void getLocalMtx(nw4r::math::MTX34 *) const;
    const nw4r::math::MTX34 *getLocalMtx() const;
    void getWorldMtx(nw4r::math::MTX34 *) const;
    void getViewMtx(nw4r::math::MTX34 *) const;

    void setCallback(nw4r::g3d::IScnObjCallback *cb);
    nw4r::g3d::IScnObjCallback *swapCallback(nw4r::g3d::IScnObjCallback *cb);

    void enableCallbackTiming(nw4r::g3d::ScnObj::Timing);
    void enableCallbackOp(nw4r::g3d::ScnObj::ExecOp);

    void calc(bool);
    void calcVtx(bool);
    void calcView(void *, bool);

    void setPriorityDraw(int, int);

    inline nw4r::g3d::ScnLeaf *getG3dObject() {
        return mpScnLeaf;
    }

    inline const nw4r::g3d::ScnLeaf *getG3dObject() const {
        return mpScnLeaf;
    }

protected:
    /* 0x14 */ nw4r::g3d::ScnLeaf *mpScnLeaf;
};

} // namespace m3d

#endif