mirror of https://github.com/AxioDL/zeus.git
Remove error-causing constexprs
This commit is contained in:
parent
8410394d4b
commit
6547f76752
|
@ -23,13 +23,13 @@ public:
|
|||
constexpr CMatrix3f(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
|
||||
: m{{{m00, m10, m20}, {m01, m11, m21}, {m02, m12, m22}}} {}
|
||||
|
||||
constexpr CMatrix3f(const CVector3f& scaleVec) {
|
||||
CMatrix3f(const CVector3f& scaleVec) {
|
||||
m[0][0] = scaleVec[0];
|
||||
m[1][1] = scaleVec[1];
|
||||
m[2][2] = scaleVec[2];
|
||||
}
|
||||
|
||||
constexpr CMatrix3f(float scale) : CMatrix3f(CVector3f(scale)) {}
|
||||
CMatrix3f(float scale) : CMatrix3f(CVector3f(scale)) {}
|
||||
|
||||
constexpr CMatrix3f(const CVector3f& r0, const CVector3f& r1, const CVector3f& r2) : m{{r0, r1, r2}} {}
|
||||
|
||||
|
|
|
@ -48,26 +48,26 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion operator+(const CQuaternion& q) const { return mSimd + q.mSimd; }
|
||||
[[nodiscard]] CQuaternion operator+(const CQuaternion& q) const { return mSimd + q.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion operator-(const CQuaternion& q) const { return mSimd - q.mSimd; }
|
||||
[[nodiscard]] CQuaternion operator-(const CQuaternion& q) const { return mSimd - q.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion operator*(const CQuaternion& q) const {
|
||||
[[nodiscard]] CQuaternion operator*(const CQuaternion& q) const {
|
||||
return CQuaternion(w() * q.w() - CVector3f(x(), y(), z()).dot({q.x(), q.y(), q.z()}),
|
||||
y() * q.z() - z() * q.y() + w() * q.x() + x() * q.w(),
|
||||
z() * q.x() - x() * q.z() + w() * q.y() + y() * q.w(),
|
||||
x() * q.y() - y() * q.x() + w() * q.z() + z() * q.w());
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion operator/(const CQuaternion& q) const {
|
||||
[[nodiscard]] CQuaternion operator/(const CQuaternion& q) const {
|
||||
return *this * q.inverse();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion operator*(float scale) const { return mSimd * simd<float>(scale); }
|
||||
[[nodiscard]] CQuaternion operator*(float scale) const { return mSimd * simd<float>(scale); }
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion operator/(float scale) const { return mSimd / simd<float>(scale); }
|
||||
[[nodiscard]] CQuaternion operator/(float scale) const { return mSimd / simd<float>(scale); }
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion operator-() const { return -mSimd; }
|
||||
[[nodiscard]] CQuaternion operator-() const { return -mSimd; }
|
||||
|
||||
const CQuaternion& operator+=(const CQuaternion& q) {
|
||||
mSimd += q.mSimd;
|
||||
|
@ -103,7 +103,7 @@ public:
|
|||
|
||||
void invert() { mSimd *= InvertQuat; }
|
||||
|
||||
[[nodiscard]] constexpr CQuaternion inverse() const { return mSimd * InvertQuat; }
|
||||
[[nodiscard]] CQuaternion inverse() const { return mSimd * InvertQuat; }
|
||||
|
||||
/**
|
||||
* @brief Set the rotation using axis angle notation
|
||||
|
@ -248,14 +248,14 @@ public:
|
|||
return mSimd * simd<float>(magDiv);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CNUQuaternion operator*(const CNUQuaternion& q) const {
|
||||
[[nodiscard]] CNUQuaternion operator*(const CNUQuaternion& q) const {
|
||||
return CNUQuaternion(w() * q.w() - CVector3f(x(), y(), z()).dot({q.x(), q.y(), q.z()}),
|
||||
y() * q.z() - z() * q.y() + w() * q.x() + x() * q.w(),
|
||||
z() * q.x() - x() * q.z() + w() * q.y() + y() * q.w(),
|
||||
x() * q.y() - y() * q.x() + w() * q.z() + z() * q.w());
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CNUQuaternion operator*(float f) const { return mSimd * simd<float>(f); }
|
||||
[[nodiscard]] CNUQuaternion operator*(float f) const { return mSimd * simd<float>(f); }
|
||||
|
||||
const CNUQuaternion& operator+=(const CNUQuaternion& q) {
|
||||
mSimd += q.mSimd;
|
||||
|
|
|
@ -46,23 +46,23 @@ public:
|
|||
return mSimd[0] >= rhs.mSimd[0] && mSimd[1] >= rhs.mSimd[1];
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator+(const CVector2d& rhs) const { return mSimd + rhs.mSimd; }
|
||||
[[nodiscard]] CVector2d operator+(const CVector2d& rhs) const { return mSimd + rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator-(const CVector2d& rhs) const { return mSimd - rhs.mSimd; }
|
||||
[[nodiscard]] CVector2d operator-(const CVector2d& rhs) const { return mSimd - rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator-() const { return -mSimd; }
|
||||
[[nodiscard]] CVector2d operator-() const { return -mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator*(const CVector2d& rhs) const { return mSimd * rhs.mSimd; }
|
||||
[[nodiscard]] CVector2d operator*(const CVector2d& rhs) const { return mSimd * rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator/(const CVector2d& rhs) const { return mSimd / rhs.mSimd; }
|
||||
[[nodiscard]] CVector2d operator/(const CVector2d& rhs) const { return mSimd / rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator+(double val) const { return mSimd + simd<double>(val); }
|
||||
[[nodiscard]] CVector2d operator+(double val) const { return mSimd + simd<double>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator-(double val) const { return mSimd - simd<double>(val); }
|
||||
[[nodiscard]] CVector2d operator-(double val) const { return mSimd - simd<double>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator*(double val) const { return mSimd * simd<double>(val); }
|
||||
[[nodiscard]] CVector2d operator*(double val) const { return mSimd * simd<double>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector2d operator/(double val) const {
|
||||
[[nodiscard]] CVector2d operator/(double val) const {
|
||||
double ooval = 1.0 / val;
|
||||
return mSimd * simd<double>(ooval);
|
||||
}
|
||||
|
|
|
@ -46,23 +46,23 @@ public:
|
|||
return mSimd[0] >= rhs.mSimd[0] && mSimd[1] >= rhs.mSimd[1];
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator+(const CVector2f& rhs) const { return mSimd + rhs.mSimd; }
|
||||
[[nodiscard]] CVector2f operator+(const CVector2f& rhs) const { return mSimd + rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator-(const CVector2f& rhs) const { return mSimd - rhs.mSimd; }
|
||||
[[nodiscard]] CVector2f operator-(const CVector2f& rhs) const { return mSimd - rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator-() const { return -mSimd; }
|
||||
[[nodiscard]] CVector2f operator-() const { return -mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator*(const CVector2f& rhs) const { return mSimd * rhs.mSimd; }
|
||||
[[nodiscard]] CVector2f operator*(const CVector2f& rhs) const { return mSimd * rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator/(const CVector2f& rhs) const { return mSimd / rhs.mSimd; }
|
||||
[[nodiscard]] CVector2f operator/(const CVector2f& rhs) const { return mSimd / rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator+(float val) const { return mSimd + simd<float>(val); }
|
||||
[[nodiscard]] CVector2f operator+(float val) const { return mSimd + simd<float>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator-(float val) const { return mSimd - simd<float>(val); }
|
||||
[[nodiscard]] CVector2f operator-(float val) const { return mSimd - simd<float>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator*(float val) const { return mSimd * simd<float>(val); }
|
||||
[[nodiscard]] CVector2f operator*(float val) const { return mSimd * simd<float>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector2f operator/(float val) const {
|
||||
[[nodiscard]] CVector2f operator/(float val) const {
|
||||
float ooval = 1.f / val;
|
||||
return mSimd * simd<float>(ooval);
|
||||
}
|
||||
|
|
|
@ -43,13 +43,13 @@ public:
|
|||
|
||||
void zeroOut() { mSimd = zeus::simd<double>(0.0); }
|
||||
|
||||
[[nodiscard]] constexpr CVector3d operator+(const CVector3d& rhs) const { return mSimd + rhs.mSimd; }
|
||||
[[nodiscard]] CVector3d operator+(const CVector3d& rhs) const { return mSimd + rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3d operator-(const CVector3d& rhs) const { return mSimd - rhs.mSimd; }
|
||||
[[nodiscard]] CVector3d operator-(const CVector3d& rhs) const { return mSimd - rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3d operator*(const CVector3d& rhs) const { return mSimd * rhs.mSimd; }
|
||||
[[nodiscard]] CVector3d operator*(const CVector3d& rhs) const { return mSimd * rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3d operator/(const CVector3d& rhs) const { return mSimd / rhs.mSimd; }
|
||||
[[nodiscard]] CVector3d operator/(const CVector3d& rhs) const { return mSimd / rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] simd<double>::reference operator[](size_t idx) {
|
||||
assert(idx < 3);
|
||||
|
|
|
@ -49,23 +49,23 @@ public:
|
|||
[[nodiscard]] simd<float>::mask_type operator<(const CVector3f& rhs) const { return mSimd < rhs.mSimd; }
|
||||
[[nodiscard]] simd<float>::mask_type operator<=(const CVector3f& rhs) const { return mSimd <= rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator+(const CVector3f& rhs) const { return mSimd + rhs.mSimd; }
|
||||
[[nodiscard]] CVector3f operator+(const CVector3f& rhs) const { return mSimd + rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator-(const CVector3f& rhs) const { return mSimd - rhs.mSimd; }
|
||||
[[nodiscard]] CVector3f operator-(const CVector3f& rhs) const { return mSimd - rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator-() const { return -mSimd; }
|
||||
[[nodiscard]] CVector3f operator-() const { return -mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator*(const CVector3f& rhs) const { return mSimd * rhs.mSimd; }
|
||||
[[nodiscard]] CVector3f operator*(const CVector3f& rhs) const { return mSimd * rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator/(const CVector3f& rhs) const { return mSimd / rhs.mSimd; }
|
||||
[[nodiscard]] CVector3f operator/(const CVector3f& rhs) const { return mSimd / rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator+(float val) const { return mSimd + val; }
|
||||
[[nodiscard]] CVector3f operator+(float val) const { return mSimd + val; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator-(float val) const { return mSimd - val; }
|
||||
[[nodiscard]] CVector3f operator-(float val) const { return mSimd - val; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator*(float val) const { return mSimd * val; }
|
||||
[[nodiscard]] CVector3f operator*(float val) const { return mSimd * val; }
|
||||
|
||||
[[nodiscard]] constexpr CVector3f operator/(float val) const { return mSimd / val; }
|
||||
[[nodiscard]] CVector3f operator/(float val) const { return mSimd / val; }
|
||||
|
||||
const CVector3f& operator+=(const CVector3f& rhs) {
|
||||
mSimd += rhs.mSimd;
|
||||
|
|
|
@ -69,23 +69,23 @@ public:
|
|||
return eq_mask[0] && eq_mask[1] && eq_mask[2] && eq_mask[3];
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator+(const CVector4d& rhs) const { return mSimd + rhs.mSimd; }
|
||||
[[nodiscard]] CVector4d operator+(const CVector4d& rhs) const { return mSimd + rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator-(const CVector4d& rhs) const { return mSimd - rhs.mSimd; }
|
||||
[[nodiscard]] CVector4d operator-(const CVector4d& rhs) const { return mSimd - rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator-() const { return -mSimd; }
|
||||
[[nodiscard]] CVector4d operator-() const { return -mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator*(const CVector4d& rhs) const { return mSimd * rhs.mSimd; }
|
||||
[[nodiscard]] CVector4d operator*(const CVector4d& rhs) const { return mSimd * rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator/(const CVector4d& rhs) const { return mSimd / rhs.mSimd; }
|
||||
[[nodiscard]] CVector4d operator/(const CVector4d& rhs) const { return mSimd / rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator+(double val) const { return mSimd + zeus::simd<double>(val); }
|
||||
[[nodiscard]] CVector4d operator+(double val) const { return mSimd + zeus::simd<double>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator-(double val) const { return mSimd - zeus::simd<double>(val); }
|
||||
[[nodiscard]] CVector4d operator-(double val) const { return mSimd - zeus::simd<double>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator*(double val) const { return mSimd * zeus::simd<double>(val); }
|
||||
[[nodiscard]] CVector4d operator*(double val) const { return mSimd * zeus::simd<double>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector4d operator/(double val) const {
|
||||
[[nodiscard]] CVector4d operator/(double val) const {
|
||||
double ooval = 1.0 / val;
|
||||
return mSimd * zeus::simd<double>(ooval);
|
||||
}
|
||||
|
|
|
@ -69,23 +69,23 @@ public:
|
|||
return eq_mask[0] && eq_mask[1] && eq_mask[2] && eq_mask[3];
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator+(const CVector4f& rhs) const { return mSimd + rhs.mSimd; }
|
||||
[[nodiscard]] CVector4f operator+(const CVector4f& rhs) const { return mSimd + rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator-(const CVector4f& rhs) const { return mSimd - rhs.mSimd; }
|
||||
[[nodiscard]] CVector4f operator-(const CVector4f& rhs) const { return mSimd - rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator-() const { return -mSimd; }
|
||||
[[nodiscard]] CVector4f operator-() const { return -mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator*(const CVector4f& rhs) const { return mSimd * rhs.mSimd; }
|
||||
[[nodiscard]] CVector4f operator*(const CVector4f& rhs) const { return mSimd * rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator/(const CVector4f& rhs) const { return mSimd / rhs.mSimd; }
|
||||
[[nodiscard]] CVector4f operator/(const CVector4f& rhs) const { return mSimd / rhs.mSimd; }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator+(float val) const { return mSimd + zeus::simd<float>(val); }
|
||||
[[nodiscard]] CVector4f operator+(float val) const { return mSimd + zeus::simd<float>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator-(float val) const { return mSimd - zeus::simd<float>(val); }
|
||||
[[nodiscard]] CVector4f operator-(float val) const { return mSimd - zeus::simd<float>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator*(float val) const { return mSimd * zeus::simd<float>(val); }
|
||||
[[nodiscard]] CVector4f operator*(float val) const { return mSimd * zeus::simd<float>(val); }
|
||||
|
||||
[[nodiscard]] constexpr CVector4f operator/(float val) const {
|
||||
[[nodiscard]] CVector4f operator/(float val) const {
|
||||
float ooval = 1.f / val;
|
||||
return mSimd * zeus::simd<float>(ooval);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue