1#include "Game/LiveActor/IKJointCtrl.hpp"
2#include "Game/LiveActor/LiveActor.hpp"
3#include "Game/Util.hpp"
7void IKJointCtrl::setEndPosition(
const TVec3f &rPos, f32 a2) {
9 MR::copyJointPos(mActor, _B4, &joint_pos);
10 MR::vecBlend(joint_pos, rPos, &joint_pos, a2);
11 mJoint->update(MR::getJointMtx(mActor, _B0), MR::getJointMtx(mActor, _B2), MR::getJointMtx(mActor, _B4), joint_pos);
15void IKJointCtrl::setEndDirection(
const TVec3f &rDirection, f32 a2) {
16 s32 val = MR::vecBlendSphere(_78, rDirection, &_78, a2);
19 MR::turnRandomVector(&_78, _78, 0.0099999998f);
25void IKJointCtrl::endCtrl() {
30void IKJointCtrl::setCallBackFunction() {
33 mRootCtrl->registerCallBack();
34 mMiddleCtrl->registerCallBack();
40 mEndCtrl->registerCallBack();
46 pPos->concat(mJoint->_30, _4);
50bool IKJointCtrl::updateMiddleJointCallBack(TPos3f *pPos,
const JointControllerInfo &rInfo) {
51 pPos->concat(mJoint->_60, _34);
54IKJointCtrlHolder::IKJointCtrlHolder(
LiveActor *pActor, u32 count) {
65 if (mNumControls > _8) {
70 mControls[cnt] = ctrl;
74void IKJointCtrlHolder::setEndPosition(
const char *pName,
const TVec3f &rPos, f32 a3) {
75 findIKJointCtrl(pName)->setEndPosition(rPos, a3);
78void IKJointCtrlHolder::setEndDirection(
const char *pName,
const TVec3f &rDirection, f32 a3) {
79 findIKJointCtrl(pName)->setEndDirection(rDirection, a3);
84void IKJointCtrlHolder::endUpdate() {
85 for_each(mControls, &mControls[mNumControls], mem_fun(&IKJointCtrl::endCtrl));
90IKJointCtrl* IKJointCtrlHolder::findIKJointCtrl(
const char *pName) {
91 for (u32 i = 0; i < mNumControls; i++) {
92 const char* ctrlName = mControls[i]->mName;
94 if (MR::isEqualString(pName, ctrlName)) {
102void IKJointCtrl::disableCallBack() {
106void IKJointCtrl::enableCallBack() {
The basis of a drawable actor that can contain states (see: Nerve)