mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
sys_math3d
This commit is contained in:
@@ -582,7 +582,7 @@ void func_80B057A4(Vec3f* arg0, Vec3f* arg1, f32 arg2) {
|
||||
}
|
||||
|
||||
if (!(arg2 < (M_PI / 180.0f))) {
|
||||
Math3D_CrossProduct(arg0, arg1, &sp34);
|
||||
Math3D_Vec3f_Cross(arg0, arg1, &sp34);
|
||||
if (func_80B0573C(&sp34)) {
|
||||
Matrix_RotateAxisF(arg2, &sp34, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(arg0, &sp28);
|
||||
@@ -2444,7 +2444,7 @@ void func_80B0B660(BossHakugin* this, PlayState* play) {
|
||||
sp7C.x = spA0->normal.x * COLPOLY_NORMAL_FRAC;
|
||||
sp7C.y = spA0->normal.y * COLPOLY_NORMAL_FRAC;
|
||||
sp7C.z = spA0->normal.z * COLPOLY_NORMAL_FRAC;
|
||||
func_80179F64(&this->unk_37AC, &sp7C, &sp70);
|
||||
Math3D_Vec3fReflect(&this->unk_37AC, &sp7C, &sp70);
|
||||
Math_Vec3f_Copy(&this->unk_37AC, &sp70);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -456,7 +456,7 @@ f32 EnInvadepoh_GetPathLength(EnInvadepoh* this) {
|
||||
for (curPathPoint++, i = 1; i < pointCount; curPathPoint++, i++) {
|
||||
Math_Vec3f_Copy(&prevPathVec, &curPathVec);
|
||||
Math_Vec3s_ToVec3f(&curPathVec, curPathPoint);
|
||||
pathLength += Math3D_Distance(&prevPathVec, &curPathVec);
|
||||
pathLength += Math3D_Vec3f_DistXYZ(&prevPathVec, &curPathVec);
|
||||
}
|
||||
return pathLength;
|
||||
}
|
||||
@@ -503,7 +503,7 @@ s32 EnInvadepoh_Dog_IsOnPath(EnInvadepoh* thisx, f32 highValue, f32 lowValue) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pathSegmentLength = Math3D_XZLength(pathSegmentX, pathSegmentZ);
|
||||
pathSegmentLength = Math3D_Dist1D(pathSegmentX, pathSegmentZ);
|
||||
distAlongPath = (travelSegmentZ * pathUnitVecZ) + (travelSegmentX * pathUnitVecX);
|
||||
if ((distAlongPath < 0.0f) || (pathSegmentLength < distAlongPath)) {
|
||||
return false;
|
||||
@@ -567,7 +567,7 @@ void EnInvadepoh_Invader_SetCheckpoints(EnInvadepoh* this) {
|
||||
for (i = 1; i < endPoint; i++, pathPoint++, checkpoints++) {
|
||||
Math_Vec3f_Copy(&prevPathPoint, &pathPointF);
|
||||
Math_Vec3s_ToVec3f(&pathPointF, pathPoint);
|
||||
pathPointLength += Math3D_Distance(&prevPathPoint, &pathPointF);
|
||||
pathPointLength += Math3D_Vec3f_DistXYZ(&prevPathPoint, &pathPointF);
|
||||
*checkpoints = pathPointLength * invPathLength;
|
||||
if (*checkpoints < 0.0f) {
|
||||
*checkpoints = 0.0f;
|
||||
@@ -798,7 +798,7 @@ s32 EnInvadepoh_Dog_MoveAlongPath(EnInvadepoh* this, PlayState* play) {
|
||||
worldToCurrent.z = curPathPointZ - this->actor.world.pos.z;
|
||||
|
||||
if (this->actor.speed > 0.0f) {
|
||||
if (Math3D_AngleBetweenVectors(¤tToNext, &worldToNext, &angleToNext)) {
|
||||
if (Math3D_CosOut(¤tToNext, &worldToNext, &angleToNext)) {
|
||||
reachedNext = true;
|
||||
} else if (angleToNext <= 0.0f) {
|
||||
reachedNext = true;
|
||||
@@ -874,7 +874,7 @@ void EnInvadepoh_Alien_SetTexAnim(void) {
|
||||
s32 EnInvadepoh_StepTowardXZ(f32* pxValue, f32* pzValue, f32 xTarget, f32 zTarget, f32 speed) {
|
||||
f32 xDiff = xTarget - *pxValue;
|
||||
f32 zDiff = zTarget - *pzValue;
|
||||
f32 distToTarget = Math3D_XZLength(xDiff, zDiff);
|
||||
f32 distToTarget = Math3D_Dist1D(xDiff, zDiff);
|
||||
|
||||
if (speed < distToTarget) {
|
||||
f32 progressStep = speed / distToTarget;
|
||||
|
||||
@@ -213,7 +213,7 @@ void func_809613E8(ObjMure2* this) {
|
||||
}
|
||||
|
||||
void func_809613FC(ObjMure2* this, PlayState* play) {
|
||||
if (Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z) <
|
||||
if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) <
|
||||
D_80961590[this->actor.params & 3] * this->unk_17C) {
|
||||
this->actor.flags |= 0x10;
|
||||
func_8096104C(this, play);
|
||||
@@ -228,7 +228,7 @@ void func_8096147C(ObjMure2* this) {
|
||||
void func_80961490(ObjMure2* this, PlayState* play) {
|
||||
ObjMure2_ClearChildrenList(this);
|
||||
if ((D_8096159C[this->actor.params & 3] * this->unk_17C) <=
|
||||
Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z)) {
|
||||
Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z)) {
|
||||
this->actor.flags &= ~0x10;
|
||||
func_809611BC(this, play);
|
||||
func_809613E8(this);
|
||||
|
||||
Reference in New Issue
Block a user