1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-18 05:44:53 +00:00

Consistent naming for Math_ functions (#542)

* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* ZAP2 stuff

* ZAP why

* ZAP again

* maths

* Factoriali -> Factorial

* soon, soon

* renames

* rand

* docs

* merged

* formatting

* little more cleanup

* asm crept back in

* changes to MathF

* smooth criminal

* functions.h
This commit is contained in:
petrie911 2020-12-26 04:44:53 -06:00 committed by GitHub
parent 81c269b417
commit 8fa6cb6ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1329 changed files with 8413 additions and 8374 deletions

View file

@ -80,10 +80,10 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) {
f32 sinYaw;
f32 cosYaw;
cosPitch = Math_Coss(sph->pitch);
cosYaw = Math_Coss(sph->yaw);
sinPitch = Math_Sins(sph->pitch);
sinYaw = Math_Sins(sph->yaw);
cosPitch = Math_CosS(sph->pitch);
cosYaw = Math_CosS(sph->yaw);
sinPitch = Math_SinS(sph->pitch);
sinYaw = Math_SinS(sph->yaw);
v.x = sph->r * sinPitch * sinYaw;
v.y = sph->r * cosPitch;
@ -122,14 +122,14 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
if ((dist == 0.0f) && (vec->y == 0.0f)) {
sph.pitch = 0;
} else {
sph.pitch = DEGF_TO_BINANG(RADF_TO_DEGF(Math_atan2f(dist, vec->y)));
sph.pitch = DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(dist, vec->y)));
}
sph.r = sqrtf(SQ(vec->y) + distSquared);
if ((vec->x == 0.0f) && (vec->z == 0.0f)) {
sph.yaw = 0;
} else {
sph.yaw = DEGF_TO_BINANG(RADF_TO_DEGF(Math_atan2f(vec->x, vec->z)));
sph.yaw = DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(vec->x, vec->z)));
}
*dest = sph;
@ -183,8 +183,8 @@ VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* dest, Vec3f* a, Vec3f* b) {
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b) {
Vec3f anglesRad;
anglesRad.x = Math_atan2f(b->z - a->z, b->y - a->y);
anglesRad.y = Math_atan2f(b->x - a->x, b->z - a->z);
anglesRad.x = Math_FAtan2F(b->z - a->z, b->y - a->y);
anglesRad.y = Math_FAtan2F(b->x - a->x, b->z - a->z);
anglesRad.z = 0;
*dest = anglesRad;