1
0
forked from josh/j3ml

Implement Mat4x4::Determinant

This commit is contained in:
2024-02-01 14:20:25 -05:00
parent 19b5630deb
commit a32719cdeb
2 changed files with 54 additions and 8 deletions

View File

@@ -65,14 +65,7 @@ namespace LinearAlgebra {
Matrix4x4(const Quaternion& orientation, const Vector3 &translation);
Vector3 GetTranslatePart() const;
Matrix3x3 GetRotatePart() const
{
return Matrix3x3 {
At(0, 0), At(0, 1), At(0, 2),
At(1, 0), At(1, 1), At(1, 2),
At(2, 0), At(2, 1), At(2, 2)
};
}
Matrix3x3 GetRotatePart() const;
void SetTranslatePart(float translateX, float translateY, float translateZ);
void SetTranslatePart(const Vector3& offset);
void SetRotatePart(const Quaternion& q);
@@ -103,10 +96,15 @@ namespace LinearAlgebra {
Vector4 WorldY() const;
Vector4 WorldZ() const;
float Determinant3x3() const;
/// Computes the determinant of this matrix.
// If the determinant is nonzero, this matrix is invertible.
float Determinant() const;
#define SKIPNUM(val, skip) (val >= skip ? (val+1) : val)
float Minor(int i, int j) const;
Matrix4x4 Inverse() const;
Matrix4x4 Transpose() const;