diff options
| author | Max Roncace <me@caseif.net> | 2025-09-17 08:01:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-17 15:01:59 +0300 |
| commit | fe5e8aff986950b5a6fc1e7e5a7b308cb2a2a0f3 (patch) | |
| tree | eb7839c7370e6a209ffbc0404ca42b2c560f2405 /include/SSystem | |
| parent | 2106c56f60a5552aa7175e65a65181958fce4012 (diff) | |
More miscellaneous TU improvements (#2665)
Diffstat (limited to 'include/SSystem')
| -rw-r--r-- | include/SSystem/SComponent/c_xyz.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/SSystem/SComponent/c_xyz.h b/include/SSystem/SComponent/c_xyz.h index 2084f8eeeb..b5e2410d71 100644 --- a/include/SSystem/SComponent/c_xyz.h +++ b/include/SSystem/SComponent/c_xyz.h @@ -64,13 +64,22 @@ struct cXyz : Vec { z *= other.z; } - void operator-=(const Vec& other) { VECSubtract(this, &other, this); } + cXyz* operator-=(const Vec& other) { + PSVECSubtract(this, &other, this); + return this; + } cXyz* operator+=(const Vec& other) { - VECAdd(this, &other, this); + PSVECAdd(this, &other, this); + return this; + } + cXyz* operator*=(f32 scale) { + PSVECScale(this, this, scale); + return this; + } + cXyz* operator/=(f32 scale) { + PSVECScale(this, this, 1.0f / scale); return this; } - void operator*=(f32 scale) { VECScale(this, this, scale); } - void operator/=(f32 scale) { VECScale(this, this, 1.0f / scale); } /* 80266C6C */ cXyz getCrossProduct(Vec const&) const; /* 80266CBC */ cXyz outprod(Vec const&) const; /* 80266CE4 */ cXyz norm() const; @@ -105,7 +114,7 @@ struct cXyz : Vec { void zero() { set(0.0f, 0.0f, 0.0f); } - f32 getSquareMag() const { return VECSquareMag(this); } + f32 getSquareMag() const { return PSVECSquareMag(this); } f32 getSquareDistance(const Vec& other) const { return PSVECSquareDistance(this, &other); } static f32 getNearZeroValue() { return 8e-11f; } |
