MCPcopy Create free account
hub / github.com/doldecomp/mkdd / localMove

Method localMove

src/Shiraiwa/JugemMain.cpp:645–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643
644
645void TJugem::localMove(JGeometry::TVec3f *vec) {
646 const f32 half = 0.5f;
647 f32 someX = _208.x;
648 f32 someY = _208.y;
649 f32 someZ = _208.z;
650
651 if ((getGlobalState() == 1) && !mIsStartPoint) {
652 someX *= -1.0f;
653 }
654
655 static JGeometry::TQuat4f qtAxisY;
656
657 f32 dx = vec->x - _22c.x;
658 f32 dz = vec->z - _22c.z;
659
660 f32 theta = atan2f(dx, dz) * half;
661 f32 s = sinf(theta);
662 f32 c = cosf(theta);
663
664 qtAxisY.set(0.0f, s, 0.0f, c);
665
666 JGeometry::TVec3f local;
667 local.set(someX, someY, someZ);
668
669 JGeometry::TVec3f rotated;
670 qtAxisY.transform(local, rotated);
671
672 vec->add(rotated);
673}
674
675void TJugem::globalMove(JGeometry::TVec3f *param_1) {
676 param_1->add(_22c);

Callers

nothing calls this directly

Calls 6

transformMethod · 0.80
atan2fFunction · 0.50
sinfFunction · 0.50
cosfFunction · 0.50
setMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected