Files
mm/include/z64olib.h
T
Anghelo Carvajal cd087d8511 Introduce a bunch of small new headers (#1649)
* regs.h

* gfxalloc.h

* z64inventory.h

* gfx.h

* graph.h

* z64olib.h

* z64elf_message.h

* fix missing include

* Include z64inventory.h on z64save.h

* fix bss

* Move PosRot to z64math.h

* So dumb

* Update src/overlays/actors/ovl_En_Kusa/z_en_kusa.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* review

* Remove graph.h

* bss

---------

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
2024-07-28 13:53:28 -07:00

41 lines
1.4 KiB
C

#ifndef Z64OLIB_H
#define Z64OLIB_H
#include "ultra64.h"
#include "z64math.h"
// To be used with OLib_Vec3fAdd()
typedef enum {
/* 0 */ OLIB_ADD_COPY, // Copy `b` to dest
/* 1 */ OLIB_ADD_OFFSET, // Add `a` and `b` to dest, and also add the yaw of `a` to the dest
/* 2 */ OLIB_ADD // Add `a` and `b` to dest
} OlibVec3fAdd;
typedef enum {
/* 0 */ OLIB_DIFF_COPY, // Copy `b` to dest
/* 1 */ OLIB_DIFF_OFFSET, // Sub `a` and `b` to dest, and also subs the yaw of `a` to the dest
/* 2 */ OLIB_DIFF // Sub `a` and `b` to dest
} OlibVec3fDiff;
f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b);
f32 OLib_Vec3fDistOutDiff(Vec3f* a, Vec3f* b, Vec3f* dest);
f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b);
f32 OLib_ClampMinDist(f32 val, f32 min);
f32 OLib_ClampMaxDist(f32 val, f32 max);
Vec3f OLib_Vec3fDistNormalize(Vec3f* a, Vec3f* b);
Vec3f OLib_VecSphToVec3f(VecSph* sph);
Vec3f OLib_VecGeoToVec3f(VecGeo* geo);
VecSph OLib_Vec3fToVecSph(Vec3f* vec);
VecGeo OLib_Vec3fToVecGeo(Vec3f* vec);
VecSph OLib_Vec3fDiffToVecSph(Vec3f* a, Vec3f* b);
VecGeo OLib_Vec3fDiffToVecGeo(Vec3f* a, Vec3f* b);
Vec3f OLib_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo);
Vec3f OLib_Vec3fDiffRad(Vec3f* a, Vec3f* b);
Vec3f OLib_Vec3fDiffDegF(Vec3f* a, Vec3f* b);
Vec3s OLib_Vec3fDiffBinAng(Vec3f* a, Vec3f* b);
void OLib_Vec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
void OLib_Vec3fAdd(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
#endif