1#include "Game/Util/IKJoint.hpp"
2#include "Game/Util.hpp"
4IKJoint::IKJoint() : mRootBoneLength(100.0f), mMiddleBoneLength(100.0f), _0(), _30(), _60() {
10void IKJoint::setRootBoneLength(f32 boneLength) {
11 mRootBoneLength = boneLength;
14void IKJoint::setMiddleBoneLength(f32 boneLength) {
15 mMiddleBoneLength = boneLength;
18void IKJoint::setFirstPose(
const TVec3f &a1,
const TVec3f &a2) {
19 MR::makeMtxSideUp(&_0, a1, a2);
22s32 IKJoint::checkReachIKTarget(f32 a1, f32 a2, f32 a3) {
29 if (a1 < __fabs(a2 - a3)) {
43f32 IKJoint::calcIKRootAngleCosign(f32 a1, f32 a2, f32 a3) {
44 s32 targ = checkReachIKTarget(a1, a2, a3);
62 f32 more_val = (a3_sqr - a1_sqr) - a2_sqr;
63 f32 val = (more_val / ((-2.0f * a2) * a1));