minor matrix function

This commit is contained in:
Vladislav Khorev 2013-05-27 20:15:24 +00:00
parent efad72f2ac
commit 925225df0e
3 changed files with 15 additions and 0 deletions

View File

@ -57,6 +57,7 @@
<ClInclude Include="..\include\Utils\Network\SignalSender.h" /> <ClInclude Include="..\include\Utils\Network\SignalSender.h" />
<ClInclude Include="..\include\Utils\PngHelper.h" /> <ClInclude Include="..\include\Utils\PngHelper.h" />
<ClInclude Include="..\include\Utils\SerializeInterface\SerializeInterface.h" /> <ClInclude Include="..\include\Utils\SerializeInterface\SerializeInterface.h" />
<ClInclude Include="..\include\Utils\SimpleTimer.h" />
<ClInclude Include="..\include\Utils\TgaLoader.h" /> <ClInclude Include="..\include\Utils\TgaLoader.h" />
<ClInclude Include="..\include\Utils\ThreadUtils.h" /> <ClInclude Include="..\include\Utils\ThreadUtils.h" />
<ClInclude Include="..\include\Utils\ThreadUtilsImpl.h" /> <ClInclude Include="..\include\Utils\ThreadUtilsImpl.h" />

View File

@ -168,6 +168,8 @@ typedef tmat3<float> mat3;
mat3 TransposeMatrix(const mat3& m); mat3 TransposeMatrix(const mat3& m);
mat3 InverseMatrix(const mat3& m); mat3 InverseMatrix(const mat3& m);
mat3 CreateZRotationMatrix(float angle);
//Outside: //Outside:
inline vec2 operator*(const vec2& a, float c) inline vec2 operator*(const vec2& a, float c)
{ {

View File

@ -53,5 +53,17 @@ mat3 InverseMatrix(const mat3& m)
return r; return r;
} }
mat3 CreateZRotationMatrix(float angle)
{
mat3 result = IdentityMatrix;
result.m[0] = cosf(angle);
result.m[1] = -sinf(angle);
result.m[3] = sinf(angle);
result.m[4] = cosf(angle);
return result;
}
} //namespace SE } //namespace SE