1
0
forked from josh/j3ml

Implement ToQuat

This commit is contained in:
2024-01-07 02:14:31 -05:00
parent a1d4df30c7
commit cc9ff95daa
5 changed files with 42 additions and 31 deletions

View File

@@ -12,10 +12,20 @@ namespace LinearAlgebra {
static const Matrix2x2 Identity;
static const Matrix2x2 NaN;
Matrix2x2() {}
Matrix2x2(float val);
Matrix2x2(float m00, float m01, float m10, float m11);
Matrix2x2(const Vector2& r1, const Vector2& r2);
Vector2 GetRow(int index) const;
Vector2 GetColumn(int index) const;
float At(int x, int y) const;
float Determinant() const;
Matrix2x2 Inverse() const;
Matrix2x2 Transpose() const;
Vector2 Transform(const Vector2& rhs) const;
Vector2 operator * (const Vector2& rhs) const;
Matrix2x2 operator * (const Matrix2x2 &rhs) const;

View File

@@ -99,13 +99,9 @@ namespace LinearAlgebra {
Matrix3x3 Transpose() const;
// Transforms the given vectors by this matrix M, i.e. returns M * (x,y,z)
Vector2 Transform(const Vector2& rhs) const;
Vector3 Transform(const Vector3& rhs) const;
Vector3 operator[] (float index) const;
Vector3 operator * (const Vector3& rhs) const;
Matrix3x3 operator * (const Matrix3x3& rhs) const;

View File

@@ -2,8 +2,6 @@
#include <J3ML/LinearAlgebra.h>
namespace LinearAlgebra {
/// A 4-by-4 matrix for affine transformations and perspective projections of 3D geometry.
/* This matrix can represent the most generic form of transformations for 3D objects,

View File

@@ -123,12 +123,9 @@ public:
Vector3 operator+() const; // TODO: Implement
// Unary - operator (Negation)
Vector3 operator-() const;
public:
float x = 0;
float y = 0;
float z = 0;
};
}