alot more changes here added some matrix functions
most of the point3 and point4 is now converted over to simd functions
matrix now has a lot done by simd but transpose/normal/affine inverse/ inverse still to do
This commit is contained in:
marauder2k7 2026-02-25 20:36:53 +00:00
parent 8908bbe462
commit fb986e375d
5 changed files with 336 additions and 44 deletions

View file

@ -599,17 +599,17 @@ inline void Point3F::convolveInverse(const Point3F& c)
inline F32 Point3F::lenSquared() const
{
return (x * x) + (y * y) + (z * z);
return math_backend::float3::lengthSquared(*this);
}
inline F32 Point3F::len() const
{
return mSqrt(x*x + y*y + z*z);
return math_backend::float3::length(*this);
}
inline void Point3F::normalize()
{
m_point3F_normalize(*this);
math_backend::float3::normalize(*this);
}
inline F32 Point3F::magnitudeSafe() const
@ -626,18 +626,13 @@ inline F32 Point3F::magnitudeSafe() const
inline void Point3F::normalizeSafe()
{
F32 vmag = magnitudeSafe();
if( vmag > POINT_EPSILON )
{
*this *= F32(1.0 / vmag);
}
math_backend::float3::normalizeSafe(*this);
}
inline void Point3F::normalize(F32 val)
{
m_point3F_normalize_f(*this, val);
math_backend::float3::normalizeMag(*this, val);
}
inline bool Point3F::operator==(const Point3F& _test) const
@ -652,35 +647,35 @@ inline bool Point3F::operator!=(const Point3F& _test) const
inline Point3F Point3F::operator+(const Point3F& _add) const
{
return Point3F(x + _add.x, y + _add.y, z + _add.z);
Point3F r;
math_backend::float3::add(*this, _add, r);
return r;
}
inline Point3F Point3F::operator-(const Point3F& _rSub) const
{
return Point3F(x - _rSub.x, y - _rSub.y, z - _rSub.z);
Point3F r;
math_backend::float3::sub(*this, _rSub, r);
return r;
}
inline Point3F& Point3F::operator+=(const Point3F& _add)
{
x += _add.x;
y += _add.y;
z += _add.z;
math_backend::float3::add(*this, _add, *this);
return *this;
}
inline Point3F& Point3F::operator-=(const Point3F& _rSub)
{
x -= _rSub.x;
y -= _rSub.y;
z -= _rSub.z;
math_backend::float3::sub(*this, _rSub, *this);
return *this;
}
inline Point3F Point3F::operator*(F32 _mul) const
{
return Point3F(x * _mul, y * _mul, z * _mul);
Point3F r;
math_backend::float3::mul_scalar(*this, _mul, r);
return r;
}
inline Point3F Point3F::operator/(F32 _div) const
@ -694,10 +689,7 @@ inline Point3F Point3F::operator/(F32 _div) const
inline Point3F& Point3F::operator*=(F32 _mul)
{
x *= _mul;
y *= _mul;
z *= _mul;
math_backend::float3::mul_scalar(*this, _mul, *this);
return *this;
}
@ -715,14 +707,14 @@ inline Point3F& Point3F::operator/=(F32 _div)
inline Point3F Point3F::operator*(const Point3F &_vec) const
{
return Point3F(x * _vec.x, y * _vec.y, z * _vec.z);
Point3F r;
math_backend::float3::mul(*this, _vec, r);
return r;
}
inline Point3F& Point3F::operator*=(const Point3F &_vec)
{
x *= _vec.x;
y *= _vec.y;
z *= _vec.z;
math_backend::float3::mul(*this, _vec, *this);
return *this;
}
@ -999,7 +991,7 @@ inline Point3D operator*(F64 mul, const Point3D& multiplicand)
inline F32 mDot(const Point3F &p1, const Point3F &p2)
{
return (p1.x*p2.x + p1.y*p2.y + p1.z*p2.z);
return math_backend::float3::dot(p1, p2);
}
inline F64 mDot(const Point3D &p1, const Point3D &p2)