mirror of
https://github.com/SMGCommunity/Petari.git
synced 2025-02-21 14:40:36 +00:00
finish decompiling ActorJointCtrl, and start on some DynamicJointCtrl
This commit is contained in:
parent
189ad8816a
commit
03729b19ad
@ -16,19 +16,19 @@ initAnimData__15ActorAnimKeeperFv,ActorAnimKeeper.o,LiveActor.a,false
|
||||
findAnimInfo__15ActorAnimKeeperCFPCc,ActorAnimKeeper.o,LiveActor.a,false
|
||||
__ct__15ActorCameraInfoFRC12JMapInfoIter,ActorCameraInfo.o,LiveActor.a,true
|
||||
__ct__15ActorCameraInfoFll,ActorCameraInfo.o,LiveActor.a,true
|
||||
__ct__14ActorJointCtrlFP9LiveActor,ActorJointCtrl.o,LiveActor.a,false
|
||||
startDynamicCtrl__14ActorJointCtrlFPCcl,ActorJointCtrl.o,LiveActor.a,false
|
||||
endDynamicCtrl__14ActorJointCtrlFPCcl,ActorJointCtrl.o,LiveActor.a,false
|
||||
resetDynamicCtrl__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,false
|
||||
__ct__14ActorJointCtrlFP9LiveActor,ActorJointCtrl.o,LiveActor.a,true
|
||||
startDynamicCtrl__14ActorJointCtrlFPCcl,ActorJointCtrl.o,LiveActor.a,true
|
||||
endDynamicCtrl__14ActorJointCtrlFPCcl,ActorJointCtrl.o,LiveActor.a,true
|
||||
resetDynamicCtrl__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,true
|
||||
startFaceCtrl__14ActorJointCtrlFl,ActorJointCtrl.o,LiveActor.a,true
|
||||
endFaceCtrl__14ActorJointCtrlFl,ActorJointCtrl.o,LiveActor.a,true
|
||||
setIKEndPosition__14ActorJointCtrlFPCcRCQ29JGeometry8TVec3<f>f,ActorJointCtrl.o,LiveActor.a,false
|
||||
setIKEndDirection__14ActorJointCtrlFPCcRCQ29JGeometry8TVec3<f>f,ActorJointCtrl.o,LiveActor.a,false
|
||||
endIKCtrlAll__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,false
|
||||
setIKEndPosition__14ActorJointCtrlFPCcRCQ29JGeometry8TVec3<f>f,ActorJointCtrl.o,LiveActor.a,true
|
||||
setIKEndDirection__14ActorJointCtrlFPCcRCQ29JGeometry8TVec3<f>f,ActorJointCtrl.o,LiveActor.a,true
|
||||
endIKCtrlAll__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,true
|
||||
update__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,true
|
||||
startUpdate__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,false
|
||||
endUpdate__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,false
|
||||
setCallBackFunction__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,false
|
||||
startUpdate__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,true
|
||||
endUpdate__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,true
|
||||
setCallBackFunction__14ActorJointCtrlFv,ActorJointCtrl.o,LiveActor.a,true
|
||||
__ct__14ActorLightCtrlFPC9LiveActor,ActorLightCtrl.o,LiveActor.a,true
|
||||
init__14ActorLightCtrlFib,ActorLightCtrl.o,LiveActor.a,false
|
||||
__as__14ActorLightInfoFRC14ActorLightInfo,ActorLightCtrl.o,LiveActor.a,false
|
||||
@ -206,12 +206,12 @@ update__16DynamicJointCtrlFv,DynamicJointCtrl.o,LiveActor.a,false
|
||||
reset__16DynamicJointCtrlFv,DynamicJointCtrl.o,LiveActor.a,false
|
||||
setCallBackFunction__16DynamicJointCtrlFv,DynamicJointCtrl.o,LiveActor.a,false
|
||||
__ct__22DynamicJointCtrlKeeperFP9LiveActor,DynamicJointCtrl.o,LiveActor.a,false
|
||||
update__22DynamicJointCtrlKeeperFv,DynamicJointCtrl.o,LiveActor.a,false
|
||||
setCallBackFunction__22DynamicJointCtrlKeeperFv,DynamicJointCtrl.o,LiveActor.a,false
|
||||
startCtrl__22DynamicJointCtrlKeeperFPCcl,DynamicJointCtrl.o,LiveActor.a,false
|
||||
endCtrl__22DynamicJointCtrlKeeperFPCcl,DynamicJointCtrl.o,LiveActor.a,false
|
||||
reset__22DynamicJointCtrlKeeperFv,DynamicJointCtrl.o,LiveActor.a,false
|
||||
findJointCtrl__22DynamicJointCtrlKeeperFPCc,DynamicJointCtrl.o,LiveActor.a,false
|
||||
update__22DynamicJointCtrlKeeperFv,DynamicJointCtrl.o,LiveActor.a,true
|
||||
setCallBackFunction__22DynamicJointCtrlKeeperFv,DynamicJointCtrl.o,LiveActor.a,true
|
||||
startCtrl__22DynamicJointCtrlKeeperFPCcl,DynamicJointCtrl.o,LiveActor.a,true
|
||||
endCtrl__22DynamicJointCtrlKeeperFPCcl,DynamicJointCtrl.o,LiveActor.a,true
|
||||
reset__22DynamicJointCtrlKeeperFv,DynamicJointCtrl.o,LiveActor.a,true
|
||||
findJointCtrl__22DynamicJointCtrlKeeperFPCc,DynamicJointCtrl.o,LiveActor.a,true
|
||||
__dt__45JointControlDelegator<20DynamicJointCtrlNode>Fv,DynamicJointCtrl.o,LiveActor.a,false
|
||||
calcJointMatrix__45JointControlDelegator<20DynamicJointCtrlNode>FPQ29JGeometry64TPosition3<Q29JGeometry38TMatrix34<Q29JGeometry13SMatrix34C<f>>>RC19JointControllerInfo,DynamicJointCtrl.o,LiveActor.a,false
|
||||
calcJointMatrixAfterChild__45JointControlDelegator<20DynamicJointCtrlNode>FPQ29JGeometry64TPosition3<Q29JGeometry38TMatrix34<Q29JGeometry13SMatrix34C<f>>>RC19JointControllerInfo,DynamicJointCtrl.o,LiveActor.a,false
|
||||
|
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "decompiled",
|
||||
"message": "2.9028263%",
|
||||
"message": "2.9280293%",
|
||||
"color": "blue"
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Library Progress Chart
|
||||
Progress (Full Game): 2.2783341% [121316 / 5324768]
|
||||
Progress (Full Game): 2.2977152% [122348 / 5324768]
|
||||
|
||||
Progress (Only Game): 2.9028263% [118864 / 4094768]
|
||||
Progress (Only Game): 2.9280293% [119896 / 4094768]
|
||||
|
||||
You have 3 / 120 stars.
|
||||
|
||||
@ -10,7 +10,7 @@ You have 3 / 120 stars.
|
||||
| Library | Percentage |
|
||||
| ------------- | ------------- |
|
||||
| Camera.a | 26.278996% |
|
||||
| LiveActor.a | 23.753374% |
|
||||
| LiveActor.a | 24.97514% |
|
||||
| AreaObj.a | 19.111694% |
|
||||
| NameObj.a | 18.462334% |
|
||||
| Gravity.a | 17.199919% |
|
||||
|
@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <revolution.h>
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
class LiveActor;
|
||||
|
||||
class JointCtrlRate {
|
||||
public:
|
||||
@ -14,4 +17,64 @@ public:
|
||||
u32 _4;
|
||||
s32 _8;
|
||||
s32 _C;
|
||||
};
|
||||
|
||||
struct DynamicJointCtrlParam {
|
||||
f32 mGravity; // _0
|
||||
f32 mFriction; // _4
|
||||
f32 mAccelRatetoBckPos; // _8
|
||||
f32 mBendMaxDegree; // _C
|
||||
const char* mJointName; // _10
|
||||
};
|
||||
|
||||
class DynamicJointCtrlNode;
|
||||
|
||||
class DynamicJointCtrl {
|
||||
public:
|
||||
DynamicJointCtrl(LiveActor *, const char *, const DynamicJointCtrlParam *);
|
||||
|
||||
void init();
|
||||
void update();
|
||||
void reset();
|
||||
void setCallBackFunction();
|
||||
|
||||
LiveActor* mActor; // _0
|
||||
const char* mName; // _4
|
||||
u32 _8;
|
||||
DynamicJointCtrlNode** mCtrlNodes; // _C
|
||||
DynamicJointCtrlParam* mParams; // _10
|
||||
JointCtrlRate* mControlRate; // _14
|
||||
};
|
||||
|
||||
class DynamicJointCtrlNode {
|
||||
public:
|
||||
DynamicJointCtrlNode(const DynamicJointCtrl *, MtxPtr, f32);
|
||||
|
||||
void update(LiveActor *, const DynamicJointCtrlNode *);
|
||||
void reset();
|
||||
|
||||
f32 _0;
|
||||
TVec3f _4;
|
||||
TVec3f _10;
|
||||
TVec3f _1C;
|
||||
MtxPtr _28;
|
||||
u32 _2C;
|
||||
u32 _30;
|
||||
DynamicJointCtrl* mParentControl; // _34
|
||||
};
|
||||
|
||||
class DynamicJointCtrlKeeper {
|
||||
public:
|
||||
DynamicJointCtrlKeeper(LiveActor *);
|
||||
|
||||
void update();
|
||||
void setCallBackFunction();
|
||||
void startCtrl(const char *, s32);
|
||||
void endCtrl(const char *, s32);
|
||||
void reset();
|
||||
DynamicJointCtrl* findJointCtrl(const char *);
|
||||
|
||||
LiveActor* mActor; // _0
|
||||
s32 _4;
|
||||
DynamicJointCtrl** mControls; // _8
|
||||
};
|
@ -62,8 +62,11 @@ public:
|
||||
void setEndPosition(const char *, const TVec3f &, f32);
|
||||
void setEndDirection(const char *, const TVec3f &, f32);
|
||||
|
||||
void endUpdate();
|
||||
void startUpdate();
|
||||
|
||||
void endUpdate();
|
||||
void endCtrlAll();
|
||||
void setCallBackFunction();
|
||||
IKJointCtrl* findIKJointCtrl(const char *);
|
||||
|
||||
IKJointCtrl** mControls; // _0
|
||||
@ -71,4 +74,9 @@ public:
|
||||
s32 _8;
|
||||
LiveActor* mActor; // _C
|
||||
u8 _10;
|
||||
};
|
||||
|
||||
class ActorJoint {
|
||||
public:
|
||||
static IKJointCtrlHolder* createIKJointCtrlHolder(LiveActor *);
|
||||
};
|
@ -1,5 +1,37 @@
|
||||
#include "Game/LiveActor/ActorJointCtrl.h"
|
||||
#include "Game/LiveActor/DynamicJointCtrl.h"
|
||||
#include "Game/LiveActor/FaceJointCtrl.h"
|
||||
#include "Game/LiveActor/IKJointCtrl.h"
|
||||
#include "Game/LiveActor/LiveActor.h"
|
||||
|
||||
ActorJointCtrl::ActorJointCtrl(LiveActor *pActor) {
|
||||
mActor = pActor;
|
||||
mJointCtrlKeeper = 0;
|
||||
mFaceJointCtrl = 0;
|
||||
mJointCtrlHolder = 0;
|
||||
_10 = 1;
|
||||
_11 = 0;
|
||||
|
||||
mJointCtrlKeeper = new DynamicJointCtrlKeeper(mActor);
|
||||
mFaceJointCtrl = new FaceJointCtrl(mActor);
|
||||
mFaceJointCtrl->init();
|
||||
mJointCtrlHolder = ActorJoint::createIKJointCtrlHolder(mActor);
|
||||
|
||||
if (mJointCtrlHolder) {
|
||||
_11 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void ActorJointCtrl::startDynamicCtrl(const char *pName, s32 val) {
|
||||
mJointCtrlKeeper->startCtrl(pName, val);
|
||||
}
|
||||
void ActorJointCtrl::endDynamicCtrl(const char *pName, s32 val) {
|
||||
mJointCtrlKeeper->endCtrl(pName, val);
|
||||
}
|
||||
|
||||
void ActorJointCtrl::resetDynamicCtrl() {
|
||||
mJointCtrlKeeper->reset();
|
||||
}
|
||||
|
||||
void ActorJointCtrl::startFaceCtrl(s32 val) {
|
||||
mFaceJointCtrl->startCtrl(val);
|
||||
@ -9,7 +41,63 @@ void ActorJointCtrl::endFaceCtrl(s32 val) {
|
||||
mFaceJointCtrl->endCtrl(val);
|
||||
}
|
||||
|
||||
void ActorJointCtrl::setIKEndPosition(const char *pName, const TVec3f &a2, f32 a3) {
|
||||
mJointCtrlHolder->setEndPosition(pName, a2, a3);
|
||||
}
|
||||
|
||||
void ActorJointCtrl::setIKEndDirection(const char *pName, const TVec3f &a2, f32 a3) {
|
||||
mJointCtrlHolder->setEndDirection(pName, a2, a3);
|
||||
}
|
||||
|
||||
void ActorJointCtrl::endIKCtrlAll() {
|
||||
mJointCtrlHolder->endCtrlAll();
|
||||
}
|
||||
|
||||
void ActorJointCtrl::update() {
|
||||
startUpdate();
|
||||
endUpdate();
|
||||
}
|
||||
|
||||
void ActorJointCtrl::startUpdate() {
|
||||
if (mJointCtrlHolder) {
|
||||
mJointCtrlHolder->startUpdate();
|
||||
}
|
||||
|
||||
if (_11) {
|
||||
mActor->calcAnim();
|
||||
}
|
||||
|
||||
_10 = 0;
|
||||
}
|
||||
|
||||
void ActorJointCtrl::endUpdate() {
|
||||
if (mJointCtrlKeeper) {
|
||||
mJointCtrlKeeper->update();
|
||||
}
|
||||
|
||||
if (mFaceJointCtrl) {
|
||||
mFaceJointCtrl->update();
|
||||
}
|
||||
|
||||
if (mJointCtrlHolder) {
|
||||
mJointCtrlHolder->endUpdate();
|
||||
}
|
||||
|
||||
_10 = 1;
|
||||
}
|
||||
|
||||
void ActorJointCtrl::setCallBackFunction() {
|
||||
if (_10) {
|
||||
if (mJointCtrlKeeper) {
|
||||
mJointCtrlKeeper->setCallBackFunction();
|
||||
}
|
||||
|
||||
if (mFaceJointCtrl) {
|
||||
mFaceJointCtrl->setCallBackFunction();
|
||||
}
|
||||
|
||||
if (mJointCtrlHolder) {
|
||||
mJointCtrlHolder->setCallBackFunction();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
#include "Game/LiveActor/DynamicJointCtrl.h"
|
||||
#include "Game/Util.h"
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// scheduling issues
|
||||
@ -63,4 +64,40 @@ void JointCtrlRate::endCtrl(s32 val) {
|
||||
_C = -1;
|
||||
_4 = val;
|
||||
_0 = 1.0f;
|
||||
}
|
||||
|
||||
void DynamicJointCtrlKeeper::update() {
|
||||
for (s32 i = 0; i < _4; i++) {
|
||||
mControls[i]->update();
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicJointCtrlKeeper::setCallBackFunction() {
|
||||
for (s32 i = 0; i < _4; i++) {
|
||||
mControls[i]->setCallBackFunction();
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicJointCtrlKeeper::startCtrl(const char *pName, s32 a2) {
|
||||
findJointCtrl(pName)->mControlRate->startCtrl(a2);
|
||||
}
|
||||
|
||||
void DynamicJointCtrlKeeper::endCtrl(const char *pName, s32 a2) {
|
||||
findJointCtrl(pName)->mControlRate->endCtrl(a2);
|
||||
}
|
||||
|
||||
void DynamicJointCtrlKeeper::reset() {
|
||||
for (s32 i = 0; i < _4; i++) {
|
||||
mControls[i]->reset();
|
||||
}
|
||||
}
|
||||
|
||||
DynamicJointCtrl* DynamicJointCtrlKeeper::findJointCtrl(const char *pName) {
|
||||
for (s32 i = 0; i < _4; i++) {
|
||||
if (MR::isEqualString(mControls[i]->mName, pName)) {
|
||||
return mControls[i];
|
||||
}
|
||||
}
|
||||
|
||||
return mControls[0];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user