1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-16 21:05:12 +00:00

Cleanup VecSph: Better Distinguish Between "Spherical" vs. "Geographic" Coordinates (#1407)

* begin geo and sph docs

* cleanup

* cleanup

* cleanup struct

* PR suggestions

* spacing
This commit is contained in:
engineer124 2022-10-15 09:43:59 -04:00 committed by GitHub
parent b806ac0191
commit a2d62eedb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 561 additions and 539 deletions

View file

@ -69,12 +69,19 @@ typedef struct {
/* 0x000C */ Vec3f b;
} Linef; // size = 0x18
// Defines a point in the spherical coordinate system
typedef struct {
/* 0x00 */ f32 r; // radius
/* 0x04 */ s16 pitch; // polar (zenith) angle
/* 0x06 */ s16 yaw; // azimuthal angle
} VecSph; // size = 0x08
/* 0x0 */ f32 r; // radius
/* 0x4 */ s16 pitch; // depends on coordinate system. See below.
/* 0x6 */ s16 yaw; // azimuthal angle
} VecSphGeo; // size = 0x8
// Defines a point in the spherical coordinate system.
// Pitch is 0 along the positive y-axis (up)
typedef VecSphGeo VecSph;
// Defines a point in the geographic coordinate system.
// Pitch is 0 along the xz-plane (horizon)
typedef VecSphGeo VecGeo;
#define LERP(x, y, scale) (((y) - (x)) * (scale) + (x))
#define LERP32(x, y, scale) ((s32)(((y) - (x)) * (scale)) + (x))