more intrinsics

add transform plane
added first batch function for mulp to intrinsics
This commit is contained in:
marauder2k7 2026-03-05 18:54:28 +00:00
parent ac6ec05690
commit add7f2a5d7
14 changed files with 710 additions and 113 deletions

View file

@ -231,6 +231,8 @@ public:
void mul( Point4F& p ) const; ///< M * p -> p (full [4x4] * [1x4])
void mulP( Point3F& p ) const; ///< M * p -> p (assume w = 1.0f)
void mulP( const Point3F &p, Point3F *d) const; ///< M * p -> d (assume w = 1.0f)
void batch_mulP(Point3F* points, size_t count) const;
void batch_mulP(const Point3F* points, size_t count, Point3F* out) const;
void mulV( VectorF& p ) const; ///< M * v -> v (assume w = 0.0f)
void mulV( const VectorF &p, Point3F *d) const; ///< M * v -> d (assume w = 0.0f)
@ -477,6 +479,40 @@ inline void MatrixF::mulP( const Point3F &p, Point3F *d) const
GetMat44().mul_pos3(*this, p, *d);
}
inline void MatrixF::batch_mulP(Point3F* points, size_t count) const
{
// Allocate temporary buffer
Point3F* temp = new Point3F[count];
GetMat44().batch_mul_pos3(m, reinterpret_cast<const float*>(points), count, reinterpret_cast<float*>(temp));
// Copy the results back to out
for (size_t i = 0; i < count; ++i)
{
points[i] = temp[i];
}
// Free temporary buffer
delete[] temp;
}
inline void MatrixF::batch_mulP(const Point3F* points, size_t count, Point3F* out) const
{
// Allocate temporary buffer
Point3F* temp = new Point3F[count];
GetMat44().batch_mul_pos3(m, reinterpret_cast<const float*>(points), count, reinterpret_cast<float*>(temp));
// Copy the results back to out
for (size_t i = 0; i < count; ++i)
{
out[i] = temp[i];
}
// Free temporary buffer
delete[] temp;
}
inline void MatrixF::mulV( VectorF& v) const
{
// M * v -> v
@ -663,7 +699,9 @@ inline bool MatrixF::isNaN()
inline void mTransformPlane(const MatrixF& mat, const Point3F& scale, const PlaneF& plane, PlaneF * result)
{
m_matF_x_scale_x_planeF(mat, &scale.x, &plane.x, &result->x);
//m_matF_x_scale_x_planeF(mat, &scale.x, &plane.x, &result->x);
GetMat44().transform_plane(mat, scale, plane, *result);
}
#else // !USE_TEMPLATE_MATRIX