6 #include <steeriously/Utilities.hpp>
7 #include <steeriously/Vector2.hpp>
32 _11=0.0; _12=0.0; _13=0.0;
33 _21=0.0; _22=0.0; _23=0.0;
34 _31=0.0; _32=0.0; _33=0.0;
47 inline void MatrixMultiply(Matrix &mIn);
84 inline void Scale(
float xScale,
float yScale);
92 inline void Rotate(
float rotation);
120 void _11(
float val){m_Matrix._11 = val;}
121 void _12(
float val){m_Matrix._12 = val;}
122 void _13(
float val){m_Matrix._13 = val;}
124 void _21(
float val){m_Matrix._21 = val;}
125 void _22(
float val){m_Matrix._22 = val;}
126 void _23(
float val){m_Matrix._23 = val;}
128 void _31(
float val){m_Matrix._31 = val;}
129 void _32(
float val){m_Matrix._32 = val;}
130 void _33(
float val){m_Matrix._33 = val;}
137 inline void steer::Matrix2D::MatrixMultiply(Matrix &mIn)
139 steer::Matrix2D::Matrix mat_temp;
142 mat_temp._11 = (m_Matrix._11*mIn._11) + (m_Matrix._12*mIn._21) + (m_Matrix._13*mIn._31);
143 mat_temp._12 = (m_Matrix._11*mIn._12) + (m_Matrix._12*mIn._22) + (m_Matrix._13*mIn._32);
144 mat_temp._13 = (m_Matrix._11*mIn._13) + (m_Matrix._12*mIn._23) + (m_Matrix._13*mIn._33);
147 mat_temp._21 = (m_Matrix._21*mIn._11) + (m_Matrix._22*mIn._21) + (m_Matrix._23*mIn._31);
148 mat_temp._22 = (m_Matrix._21*mIn._12) + (m_Matrix._22*mIn._22) + (m_Matrix._23*mIn._32);
149 mat_temp._23 = (m_Matrix._21*mIn._13) + (m_Matrix._22*mIn._23) + (m_Matrix._23*mIn._33);
152 mat_temp._31 = (m_Matrix._31*mIn._11) + (m_Matrix._32*mIn._21) + (m_Matrix._33*mIn._31);
153 mat_temp._32 = (m_Matrix._31*mIn._12) + (m_Matrix._32*mIn._22) + (m_Matrix._33*mIn._32);
154 mat_temp._33 = (m_Matrix._31*mIn._13) + (m_Matrix._32*mIn._23) + (m_Matrix._33*mIn._33);
162 for (
unsigned int i=0; i<vPoint.size(); ++i)
164 float tempX =(m_Matrix._11*vPoint[i].x) + (m_Matrix._21*vPoint[i].y) + (m_Matrix._31);
166 float tempY = (m_Matrix._12*vPoint[i].x) + (m_Matrix._22*vPoint[i].y) + (m_Matrix._32);
179 float tempX =(m_Matrix._11*vPoint.x) + (m_Matrix._21*vPoint.y) + (m_Matrix._31);
181 float tempY = (m_Matrix._12*vPoint.x) + (m_Matrix._22*vPoint.y) + (m_Matrix._32);
193 m_Matrix._11 = 1; m_Matrix._12 = 0; m_Matrix._13 = 0;
195 m_Matrix._21 = 0; m_Matrix._22 = 1; m_Matrix._23 = 0;
197 m_Matrix._31 = 0; m_Matrix._32 = 0; m_Matrix._33 = 1;
204 steer::Matrix2D::Matrix mat;
206 mat._11 = 1; mat._12 = 0; mat._13 = 0;
208 mat._21 = 0; mat._22 = 1; mat._23 = 0;
210 mat._31 = x; mat._32 = y; mat._33 = 1;
219 steer::Matrix2D::Matrix mat;
221 mat._11 = xScale; mat._12 = 0; mat._13 = 0;
223 mat._21 = 0; mat._22 = yScale; mat._23 = 0;
225 mat._31 = 0; mat._32 = 0; mat._33 = 1;
235 steer::Matrix2D::Matrix mat;
237 float Sin = sin(rot);
238 float Cos = cos(rot);
240 mat._11 = Cos; mat._12 = Sin; mat._13 = 0;
242 mat._21 = -Sin; mat._22 = Cos; mat._23 = 0;
244 mat._31 = 0; mat._32 = 0;mat._33 = 1;
254 steer::Matrix2D::Matrix mat;
256 mat._11 = fwd.x; mat._12 = fwd.y; mat._13 = 0;
258 mat._21 = side.x; mat._22 = side.y; mat._23 = 0;
260 mat._31 = 0; mat._32 = 0;mat._33 = 1;
266 #endif //MATRIX2D_HPP