SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
JointController.hpp
1#pragma once
2
3#include <revolution.h>
4#include "JSystem/JGeometry.hpp"
5
6class J3DJoint;
7class J3DModel;
8class LiveActor;
9
11
12};
13
14
16public:
18
19 virtual bool calcJointMatrix(TPos3f *, const JointControllerInfo &);
20 virtual bool calcJointMatrixAfterChild(TPos3f *, const JointControllerInfo &);
21
22 void registerCallBack();
23 void calcJointMatrixAndSetSystem(J3DJoint *);
24 void calcJointMatrixAfterChildAndSetSystem(J3DJoint *);
25 static void staticCallBack(J3DJoint *, int);
26
27 J3DModel* mModel; // _4
28 J3DJoint* mJoint; // _8
29};
30
31template<typename T>
33public:
34
35 typedef bool (T::*func)(TPos3f *, const JointControllerInfo &);
36
37 inline JointControlDelegator(T *pHost, func calcFunc, func calcAfterChild) : JointController() {
38 mHost = pHost;
39 mMtxCalcFunc = calcFunc;
40 mMtxCalcAfterChildFunc = calcAfterChild;
41 }
42
43 virtual ~JointControlDelegator() {
44
45 }
46
47 virtual bool calcJointMatrix(TPos3f *a1, const JointControllerInfo &a2) {
48 if (mMtxCalcFunc != NULL) {
49 return (mHost->*mMtxCalcFunc)(a1, a2);
50 } else {
51 return false;
52 }
53 }
54
55 virtual bool calcJointMatrixAfterChild(TPos3f *a1, const JointControllerInfo &a2) {
56 if (mMtxCalcAfterChildFunc != NULL) {
57 return (mHost->*mMtxCalcAfterChildFunc)(a1, a2);
58 } else {
59 return false;
60 }
61 }
62
63 T* mHost; // _C
64 func mMtxCalcFunc; // _10
65 func mMtxCalcAfterChildFunc; // _14
66};
67
68namespace MR {
69 void setJointControllerParam(JointController *, const LiveActor *, const char *);
70
71 template <class T>
72 JointControlDelegator<T>* createJointDelegatorWithNullChildFunc(T *pHost, bool (T::*calcFunc)(TPos3f *, const JointControllerInfo &), const char *pName) {
73 JointControlDelegator<T>* delegator = new JointControlDelegator<T>(pHost, calcFunc, 0);
74 setJointControllerParam(delegator, pHost, pName);
75 return delegator;
76 }
77};
The basis of a drawable actor that can contain states (see: Nerve)
Definition LiveActor.hpp:24