diff options
Diffstat (limited to 'arm9/lib/include/fx.h')
-rw-r--r-- | arm9/lib/include/fx.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arm9/lib/include/fx.h b/arm9/lib/include/fx.h index 5e8b5dca..de851f62 100644 --- a/arm9/lib/include/fx.h +++ b/arm9/lib/include/fx.h @@ -13,15 +13,15 @@ u16 FX_Atan(fx32 x); u16 FX_Atan2(fx32 x, fx32 y); //Vec -void VEC_Add(struct Vecx32 *x, struct Vecx32 *y, struct Vecx32 *dst); -void VEC_Subtract(struct Vecx32 *x, struct Vecx32 *y, struct Vecx32 *dst); +void VEC_Add(const struct Vecx32 *a, const struct Vecx32 *b, struct Vecx32 *dst); +void VEC_Subtract(const struct Vecx32 *a, const struct Vecx32 *b, struct Vecx32 *dst); void VEC_Fx16Add(struct Vecx16 *x, struct Vecx16 *y, struct Vecx16 *dst); fx32 VEC_DotProduct(const struct Vecx32 *a, const struct Vecx32 *b); fx32 VEC_Fx16DotProduct(struct Vecx16 *a, struct Vecx16 *b); void VEC_CrossProduct(const struct Vecx32 *a, const struct Vecx32 *b, struct Vecx32 *dst); void VEC_Fx16CrossProduct(struct Vecx16 *a, struct Vecx16 *b, struct Vecx16 *dst); fx32 VEC_Mag(struct Vecx32 *a); -void VEC_Normalize(struct Vecx32 *a, struct Vecx32 *dst); +void VEC_Normalize(const struct Vecx32 *a, struct Vecx32 *dst); void VEC_Fx16Normalize(struct Vecx16 *a, struct Vecx16 *dst); void VEC_MultAdd(fx32 factor, struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst); @@ -110,4 +110,14 @@ static inline void MTX_LookAt(const VecFx32 * camPos, const VecFx32 * camUp, con G3i_LookAt_(camPos, camUp, target, FALSE, mtx); } +static inline void MTX_Perspective(fx32 fovySin, fx32 fovyCos, fx32 aspect, fx32 n, fx32 f, MtxFx44 * mtx) +{ + G3i_PerspectiveW_(fovySin, fovyCos, aspect, n, f, FX32_ONE, FALSE, mtx); +} + +static inline void MTX_Ortho(fx32 t, fx32 b, fx32 l, fx32 r, fx32 n, fx32 f, MtxFx44 * mtx) +{ + G3i_OrthoW_(t, b, l, r, n, f, FX32_ONE, FALSE, mtx); +} + #endif //GUARD_FX_H |