diff --git a/Salmon Engine/Salmon Engine.vcxproj b/Salmon Engine/Salmon Engine.vcxproj index 1d644c5..5bea888 100644 --- a/Salmon Engine/Salmon Engine.vcxproj +++ b/Salmon Engine/Salmon Engine.vcxproj @@ -57,6 +57,7 @@ + diff --git a/include/Utils/DataTypes/NewDataTypes.h b/include/Utils/DataTypes/NewDataTypes.h index c8b84e3..23bdb75 100644 --- a/include/Utils/DataTypes/NewDataTypes.h +++ b/include/Utils/DataTypes/NewDataTypes.h @@ -168,6 +168,8 @@ typedef tmat3 mat3; mat3 TransposeMatrix(const mat3& m); mat3 InverseMatrix(const mat3& m); +mat3 CreateZRotationMatrix(float angle); + //Outside: inline vec2 operator*(const vec2& a, float c) { diff --git a/src/Utils/DataTypes/NewDataTypes.cpp b/src/Utils/DataTypes/NewDataTypes.cpp index cb8b73d..cf19ca1 100644 --- a/src/Utils/DataTypes/NewDataTypes.cpp +++ b/src/Utils/DataTypes/NewDataTypes.cpp @@ -53,5 +53,17 @@ mat3 InverseMatrix(const mat3& m) 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 \ No newline at end of file