start of cXyz OK

This commit is contained in:
lepelog
2021-03-30 18:05:21 +02:00
parent e756e1760e
commit f941a5694d
5 changed files with 116 additions and 87 deletions
+17
View File
@@ -3,4 +3,21 @@
#include "dolphin/types.h"
struct SVec {
s16 mX, mY, mZ;
};
class csXyz : public SVec {
public:
static const csXyz Zero;
/* 80018BD0 */ ~csXyz() {}
/* inline */ csXyz() {}
/* inline */ csXyz(const csXyz& other) : SVec(other){};
/* 802673F4 */ csXyz(s16, s16, s16);
/* 80267404 */ csXyz operator+(csXyz&);
/* 8026745C */ void operator+=(csXyz&);
/* 80267490 */ csXyz operator-(csXyz&);
/* 802674E8 */ csXyz operator*(f32);
};
#endif /* C_SXYZ_H */
+44
View File
@@ -2,5 +2,49 @@
#define C_XYZ_H
#include "dolphin/types.h"
#include "mtx_vec.h"
struct cXyz : Vec {
/* 80009184 */ ~cXyz() {}
/* inlined */ cXyz() {}
cXyz(f32 x, f32 y, f32 z) {
this->x = x;
this->y = y;
this->z = z;
}
cXyz(const cXyz& vec) {
this->x = vec.x;
this->y = vec.y;
this->z = vec.z;
}
cXyz(const Vec& vec) {
this->x = vec.x;
this->y = vec.y;
this->z = vec.z;
}
void operator=(const Vec& vec) {
this->x = vec.x;
this->y = vec.y;
this->z = vec.z;
}
/* 80266AE4 */ cXyz operator+(Vec const&) const;
/* 80266B34 */ cXyz operator-(Vec const&) const;
/* 80266B84 */ cXyz operator*(f32) const;
/* 80266BD0 */ cXyz operator*(Vec const&) const;
/* 80266C18 */ cXyz operator/(f32) const;
/* 80266C6C */ cXyz getCrossProduct(Vec const&) const;
/* 80266CBC */ cXyz outprod(Vec const&) const;
/* 80266CE4 */ cXyz norm() const;
/* 80266D30 */ cXyz normZP() const;
/* 80266DC4 */ cXyz normZC() const;
/* 80266EF4 */ cXyz normalize();
/* 80266F48 */ cXyz normalizeZP();
/* 80266FDC */ bool normalizeRS();
/* 8026702C */ bool operator==(Vec const&) const;
/* 8026706C */ bool operator!=(Vec const&) const;
/* 802670AC */ bool isZero() const;
/* 80267128 */ s16 atan2sX_Z() const;
/* 80267150 */ s16 atan2sY_XZ() const;
};
#endif /* C_XYZ_H */