diff options
| author | lepelog <lepelog@users.noreply.github.com> | 2021-03-30 18:05:21 +0200 |
|---|---|---|
| committer | lepelog <lepelog@users.noreply.github.com> | 2021-03-30 18:05:21 +0200 |
| commit | f941a5694d28860f23a60bded5716282cdf4054c (patch) | |
| tree | d31d598b9e3697bd541a9a993072f42509bb7438 /include/SSystem/SComponent | |
| parent | e756e1760e7c703983602ac21e9ba6a993cf2568 (diff) | |
start of cXyz OK
Diffstat (limited to 'include/SSystem/SComponent')
| -rw-r--r-- | include/SSystem/SComponent/c_sxyz.h | 17 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_xyz.h | 44 |
2 files changed, 61 insertions, 0 deletions
diff --git a/include/SSystem/SComponent/c_sxyz.h b/include/SSystem/SComponent/c_sxyz.h index 8584afb414..51d8beafde 100644 --- a/include/SSystem/SComponent/c_sxyz.h +++ b/include/SSystem/SComponent/c_sxyz.h @@ -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 */ diff --git a/include/SSystem/SComponent/c_xyz.h b/include/SSystem/SComponent/c_xyz.h index e96f9da5ad..21460d2bfb 100644 --- a/include/SSystem/SComponent/c_xyz.h +++ b/include/SSystem/SComponent/c_xyz.h @@ -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 */ |
