summaryrefslogtreecommitdiff
path: root/include/JSystem/J3DGraphAnimator/J3DNode.h
blob: 71998bb55f74935c169ae379e43fe05060c81e01 (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
#ifndef J3DNODE_H
#define J3DNODE_H

#include "dolphin/types.h"

class J3DNode;
class J3DModelData;

typedef int (*J3DNodeCallBack)(J3DNode*, int);
// The second argument to a J3DNodeCallBack determines the timing that the callback was called at.
// In: Called after the current joint has been calced, but before its children and younger siblings have been calced.
// Out: Called after the current joint and its children have been calced, but before its younger siblings have been calced.
enum {
    J3DNodeCBCalcTiming_In = 0,
    J3DNodeCBCalcTiming_Out = 1,
};

class J3DNode {
public:
    virtual void init(J3DModelData*) {}
    virtual void entryIn() {}
    virtual void calcIn() {}
    virtual void calcOut() {}
    virtual u32 getType() const { return 'NNON'; }
    virtual ~J3DNode();

    J3DNode();
    void appendChild(J3DNode*);

    J3DNodeCallBack getCallBack() { return mCallBack; }
    void setCallBack(J3DNodeCallBack callback) { mCallBack = callback; }
    J3DNode* getChild() { return mChild; }
    // "Younger" sibling. The next node after this one that was appended to the same parent.
    J3DNode* getYounger() { return mYounger; }
    void setYounger(J3DNode* pYounger) { mYounger = pYounger; }

    /* 0x04 */ void* mCallBackUserData;
    /* 0x08 */ J3DNodeCallBack mCallBack;
    /* 0x0C */ void* field_0x8;
    /* 0x10 */ J3DNode* mChild;
    /* 0x14 */ J3DNode* mYounger;
};  // Size: 0x18

#endif /* J3DNODE_H */