mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-17 05:15:16 +00:00
Fix misc 18 (#1423)
* two more ABS * fixup item_name_static texs outnames * fixup CollisionCheck_SetOCvsOC docs * Cleanup int comments alignments * collsion -> collision * `SQ*` macros fixup * use `LERP` more * static -> `s` prefix * grammar: dont -> don't * 3
This commit is contained in:
parent
efe485f017
commit
abb4201e57
20 changed files with 93 additions and 101 deletions
|
@ -816,10 +816,10 @@ Vec3f* Camera_BGCheckCorner(Vec3f* dst, Vec3f* linePointA, Vec3f* linePointB, Ca
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks collision between at and eyeNext, if `checkEye` is set, if there is no collsion between
|
||||
* Checks collision between at and eyeNext, if `checkEye` is set, if there is no collision between
|
||||
* eyeNext->at, then eye->at is also checked.
|
||||
* Returns:
|
||||
* 0 if no collsion is found between at->eyeNext
|
||||
* 0 if no collision is found between at->eyeNext
|
||||
* 2 if the angle between the polys is between 60 degrees and 120 degrees
|
||||
* 3 ?
|
||||
* 6 if the angle between the polys is greater than 120 degrees
|
||||
|
@ -2531,7 +2531,7 @@ s32 Camera_Jump2(Camera* camera) {
|
|||
Camera_AddVecGeoToVec3f(&camBgChk.pos, at, &bgChkPara);
|
||||
if (Camera_BGCheckInfo(camera, at, &camBgChk)) {
|
||||
// Collision found between parallel at->eyeNext, set eye position to
|
||||
// first collsion point.
|
||||
// first collision point.
|
||||
*eye = bgChkPos;
|
||||
} else {
|
||||
// no collision found with the parallel at->eye, animate to be parallel
|
||||
|
|
|
@ -2648,8 +2648,8 @@ void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* lef
|
|||
f32 zDelta;
|
||||
Actor* leftActor = left->actor;
|
||||
Actor* rightActor = right->actor;
|
||||
s32 leftMassType;
|
||||
s32 rightMassType;
|
||||
s32 leftMassType;
|
||||
|
||||
left->ocFlags1 |= OC1_HIT;
|
||||
left->oc = rightActor;
|
||||
|
@ -2666,8 +2666,8 @@ void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* lef
|
|||
if (leftActor == NULL || rightActor == NULL || left->ocFlags1 & OC1_NO_PUSH || right->ocFlags1 & OC1_NO_PUSH) {
|
||||
return;
|
||||
}
|
||||
rightMassType = CollisionCheck_GetMassType(leftActor->colChkInfo.mass);
|
||||
leftMassType = CollisionCheck_GetMassType(rightActor->colChkInfo.mass);
|
||||
leftMassType = CollisionCheck_GetMassType(leftActor->colChkInfo.mass);
|
||||
rightMassType = CollisionCheck_GetMassType(rightActor->colChkInfo.mass);
|
||||
leftMass = leftActor->colChkInfo.mass;
|
||||
rightMass = rightActor->colChkInfo.mass;
|
||||
totalMass = leftMass + rightMass;
|
||||
|
@ -2679,30 +2679,30 @@ void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* lef
|
|||
zDelta = rightPos->z - leftPos->z;
|
||||
xzDist = sqrtf(SQ(xDelta) + SQ(zDelta));
|
||||
|
||||
if (rightMassType == MASSTYPE_IMMOVABLE) {
|
||||
if (leftMassType == MASSTYPE_IMMOVABLE) {
|
||||
if (leftMassType == MASSTYPE_IMMOVABLE) {
|
||||
if (rightMassType == MASSTYPE_IMMOVABLE) {
|
||||
return;
|
||||
} else { // leftMassType == MASS_HEAVY | MASS_NORMAL
|
||||
} else { // rightMassType == MASSTYPE_HEAVY or MASSTYPE_NORMAL
|
||||
leftDispRatio = 0;
|
||||
rightDispRatio = 1;
|
||||
}
|
||||
} else if (rightMassType == MASSTYPE_HEAVY) {
|
||||
if (leftMassType == MASSTYPE_IMMOVABLE) {
|
||||
} else if (leftMassType == MASSTYPE_HEAVY) {
|
||||
if (rightMassType == MASSTYPE_IMMOVABLE) {
|
||||
leftDispRatio = 1;
|
||||
rightDispRatio = 0;
|
||||
} else if (leftMassType == MASSTYPE_HEAVY) {
|
||||
} else if (rightMassType == MASSTYPE_HEAVY) {
|
||||
leftDispRatio = 0.5f;
|
||||
rightDispRatio = 0.5f;
|
||||
} else { // leftMassType == MASS_NORMAL
|
||||
} else { // rightMassType == MASSTYPE_NORMAL
|
||||
leftDispRatio = 0;
|
||||
rightDispRatio = 1;
|
||||
}
|
||||
} else { // rightMassType == MASS_NORMAL
|
||||
if (leftMassType == MASSTYPE_NORMAL) {
|
||||
} else { // leftMassType == MASSTYPE_NORMAL
|
||||
if (rightMassType == MASSTYPE_NORMAL) {
|
||||
inverseTotalMass = 1 / totalMass;
|
||||
leftDispRatio = rightMass * inverseTotalMass;
|
||||
rightDispRatio = leftMass * inverseTotalMass;
|
||||
} else { // leftMassType == MASS_HEAVY | MASS_IMMOVABLE
|
||||
} else { // rightMassType == MASSTYPE_HEAVY or MASSTYPE_IMMOVABLE
|
||||
leftDispRatio = 1;
|
||||
rightDispRatio = 0;
|
||||
}
|
||||
|
@ -3494,7 +3494,7 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a
|
|||
}
|
||||
radSqDiff = SQXZ(actorToItem) - SQ(radius);
|
||||
if (!IS_ZERO(SQXZ(itemStep))) {
|
||||
actorDotItemXZ = DOTXZ(2.0f * itemStep, actorToItem);
|
||||
actorDotItemXZ = (2.0f * itemStep.x * actorToItem.x) + (2.0f * itemStep.z * actorToItem.z);
|
||||
if (SQ(actorDotItemXZ) < (4.0f * SQXZ(itemStep) * radSqDiff)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -3511,10 +3511,10 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a
|
|||
if (intersect2 == true) {
|
||||
frac2 = (-actorDotItemXZ - closeDist) / (2.0f * SQXZ(itemStep));
|
||||
}
|
||||
} else if (!IS_ZERO(DOTXZ(2.0f * itemStep, actorToItem))) {
|
||||
} else if (!IS_ZERO((2.0f * itemStep.x * actorToItem.x) + (2.0f * itemStep.z * actorToItem.z))) {
|
||||
intersect1 = true;
|
||||
intersect2 = false;
|
||||
frac1 = -radSqDiff / DOTXZ(2.0f * itemStep, actorToItem);
|
||||
frac1 = -radSqDiff / ((2.0f * itemStep.x * actorToItem.x) + (2.0f * itemStep.z * actorToItem.z));
|
||||
} else {
|
||||
if (radSqDiff <= 0.0f) {
|
||||
test1 = (0.0f < actorToItem.y) && (actorToItem.y < height);
|
||||
|
|
|
@ -748,7 +748,7 @@ void EffectSsFhgFlash_SpawnLightBall(PlayState* play, Vec3f* pos, Vec3f* velocit
|
|||
* Spawn a shock effect
|
||||
*
|
||||
* param determines where the ligntning should go
|
||||
* 0: dont attach to any actor. spawns at the position specified by pos
|
||||
* 0: don't attach to any actor. spawns at the position specified by pos
|
||||
* 1: spawn at one of Player's body parts, chosen at random
|
||||
* 2: spawn at one of Phantom Ganon's body parts, chosen at random
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue