121 return Vector3D(fabs(other.
x), fabs(other.
y), fabs(other.
z));
133 return a.
x < scalar && a.
y < scalar && a.
z < scalar;
144 return a.
x * b.
x + a.
y * b.
y + a.
z * b.
z;
199 return sqrtf32(v.
x * v.
x + v.
y * v.
y + v.
z * v.
z);
236 return (a / mag) * (
Dot(a, b) / mag);
248 if (mag == 0) mag = 1;
267 return x == other.
x &&
y == other.
y &&
z == other.
z;
273 return abs(*
this - other) < tolerance;
300 float n10,
float n11,
float n12,
301 float n20,
float n21,
float n22)
354 return (*
reinterpret_cast<Vector3D *
>(n[i]));
362 return (*
reinterpret_cast<const Vector3D *
>(n[i]));
370 return Vector3D(n[0][j], n[1][j], n[2][j]);
378 return Vector3D(n[0][j], n[1][j], n[2][j]);
386 return (*
this)[0] == other[0] && (*this)[1] == other[1] && (*this)[2] == other[2];
394 return (*
this)[0].equals(other[0], tolerance) && (*this)[1].equals(other[2], tolerance) && (*this)[1].equals(other[2], tolerance);
407 Dot(A[1], col0),
Dot(A[1], col1),
Dot(A[1], col2),
408 Dot(A[2], col0),
Dot(A[2], col1),
Dot(A[2], col2));
427 os <<
"Vector: " << v.
x <<
", " << v.
y <<
", " << v.
z;
439 os <<
"Matrix: " << std::endl
bool operator==(const Matrix3D &other)
Definition: TinyMath.hpp:384
const Vector3D & operator[](int i) const
Definition: TinyMath.hpp:360
float & operator ()(int i, int j)
Definition: TinyMath.hpp:335
Matrix3D(const Vector3D &a, const Vector3D &b, const Vector3D &c)
Definition: TinyMath.hpp:317
Matrix3D(float n00, float n01, float n02, float n10, float n11, float n12, float n20, float n21, float n22)
Definition: TinyMath.hpp:299
Matrix3D() = default
Default constructor.
Vector3D CrossProduct(const Vector3D &a, const Vector3D &b)
Definition: TinyMath.hpp:260
Vector3D Normalize(const Vector3D &v)
Definition: TinyMath.hpp:245
Vector3D Project(const Vector3D &a, const Vector3D &b)
Definition: TinyMath.hpp:233
Vector3D operator+(const Vector3D &a, const Vector3D &b)
Definition: TinyMath.hpp:208
float Magnitude(const Vector3D &v)
Definition: TinyMath.hpp:197
Vector3D column(int j) const
Definition: TinyMath.hpp:376
Vector3D operator-(const Vector3D &a, const Vector3D &b)
Definition: TinyMath.hpp:221
Vector3D operator/(const Vector3D &v, float s)
Definition: TinyMath.hpp:176
float Dot(const Vector3D &a, const Vector3D &b)
Definition: TinyMath.hpp:142
bool operator<(const Vector3D &a, float scalar)
Definition: TinyMath.hpp:131
bool equals(const Matrix3D &other, float tolerance)
Definition: TinyMath.hpp:392
static Vector3D abs(const Vector3D &other)
Definition: TinyMath.hpp:119
bool equals(const Vector3D &other, float tolerance)
Definition: TinyMath.hpp:271
bool operator==(const Vector3D &other)
Definition: TinyMath.hpp:265
Vector3D operator*(const Matrix3D &M, const Vector3D &v)
Definition: TinyMath.hpp:414
Vector3D & operator-=(const Vector3D &v)
Definition: TinyMath.hpp:90
static ostream & operator<<(ostream &os, const Level &l)
Definition: LevelManager.cpp:9
Vector3D & operator+=(const Vector3D &v)
Definition: TinyMath.hpp:76
Vector3D column(int j)
Definition: TinyMath.hpp:368
Vector3D & operator*=(float s)
Definition: TinyMath.hpp:51
Vector3D & operator[](int i)
Definition: TinyMath.hpp:352
const float & operator[](int i) const
Definition: TinyMath.hpp:42
Vector3D & operator/=(float s)
Definition: TinyMath.hpp:62
float & operator[](int i)
Definition: TinyMath.hpp:33
Vector3D(float a, float b, float c)
Definition: TinyMath.hpp:27
Vector3D() = default
Default constructor.
float y
Definition: TinyMath.hpp:19
float x
Definition: TinyMath.hpp:19
Definition: TinyMath.hpp:279
float z
Definition: TinyMath.hpp:19
Definition: TinyMath.hpp:15