Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
mat2.h
1 #pragma once
2 
14 #include "core.h"
15 #include "vec2.h"
16 #include <iostream>
17 
18 namespace rune{
19 
20 class RUNE_ENGINE Mat2
21 {
22 private:
24  double row1[2];
26  double row2[2];
27 public:
29  Mat2();
31  Mat2(double a11, double a12, double a21, double a22);
33  Mat2 operator- (const Mat2& right);
35  Mat2 operator-();
37  Mat2 operator+ (const Mat2& right);
39  Mat2 operator* (const Mat2& right);
41  Mat2 operator* (double scalar);
43  Vec2 operator*(const Vec2& right);
45  Mat2 operator/ (const Mat2& right);
47  Mat2& operator-=(const Mat2& right);
49  Mat2& operator+=(const Mat2& right);
51  Mat2& operator+=(const double scalar);
53  Mat2& operator*=(const Mat2& right);
55  Mat2& operator*=(const double right);
57  bool operator==(const Mat2& right);
59  bool operator!=(const Mat2& right);
61  rune::Mat2 operator/ (double scalar);
63  Mat2 invert();
65  double determinant();
67  double* operator[](int index);
69  friend RUNE_ENGINE std::ostream& operator<<(std::ostream& os, const Mat2& vector);
70 };
71 
73 RUNE_ENGINE rune::Vec2 operator*(rune::Vec2 const& vec, rune::Mat2& mat);
75 RUNE_ENGINE Mat2 operator* (double scalar, rune::Mat2& mat);
76 
77 }
rune::Mat2::operator<<
friend RUNE_ENGINE std::ostream & operator<<(std::ostream &os, const Mat2 &vector)
Overload of stream operator for printing.
rune::Mat2
2 x 2 matrix to be used for math.
Definition: mat2.h:21
rune::Vec2
1 x 2 vector to be used for math.
Definition: vec2.h:20
rune::operator/
RUNE_ENGINE Vec2 operator/(double scalar, Vec2 vec)
Overload of / operator for a scalar.
rune
The main namespace to be used for interfacing with the engine.
Definition: animator.h:21
rune::operator*
RUNE_ENGINE rune::Vec2 operator*(rune::Vec2 const &vec, rune::Mat2 &mat)
Overload of multiplication operator for a rune::Mat2.