Files
tp/include/dolphin/mtx/vec.h
T
lepelog 8fd9f2ab5d Copy JKernel (#126)
* start JSystem

* JKRAram and JUTGamePad

* started heap and thread

* more JKernel

* mostly finished JKernel

* delete unused asm

* JKRFileFinder

* delete unused asm and match findNextFile

* format

* fix mtx_vec
2021-05-02 20:03:24 -04:00

32 lines
1.1 KiB
C

#ifndef VEC_H
#define VEC_H
#include "dolphin/types.h"
struct Vec {
float x, y, z;
float GetX() const { return x; }
float GetY() const { return y; }
float GetZ() const { return z; }
float getXDiff(const Vec* other) const { return x - other->x; }
float getYDiff(const Vec* other) const { return y - other->y; }
float getZDiff(const Vec* other) const { return z - other->z; }
};
extern "C" {
void PSVECAdd(const Vec* src_a, const Vec* src_b, Vec* dst);
void PSVECSubtract(const Vec* a, const Vec* b, Vec* dst);
void PSVECScale(const Vec* src, Vec* dst, float scale);
void PSVECNormalize(const Vec* src, Vec* dst);
float PSVECSquareMag(const Vec* vec);
float PSVECMag(const Vec* data);
float PSVECDotProduct(const Vec* a, const Vec* b);
void PSVECCrossProduct(const Vec* src_a, const Vec* src_b, Vec* dst);
void C_VECHalfAngle(const Vec* incident, const Vec* line_of_sight, Vec* out_half);
void C_VECReflect(const Vec* src, const Vec* surface_normal, Vec* dst);
float PSVECSquareDistance(const Vec* a, const Vec* b);
float PSVECDistance(const Vec* a, const Vec* b);
}
#endif /* VEC_H */