diff options
Diffstat (limited to 'src/4dvecops/rotations4d.cpp')
-rw-r--r-- | src/4dvecops/rotations4d.cpp | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/4dvecops/rotations4d.cpp b/src/4dvecops/rotations4d.cpp index 62746eb..4943c7f 100644 --- a/src/4dvecops/rotations4d.cpp +++ b/src/4dvecops/rotations4d.cpp @@ -1,6 +1,7 @@ #include "raytracer/raytracer.h" +#include "4dvecops/vec4ops.h" -glm::mat4 getRotationMatrix4XY( +glm::mat4 Vec4Ops::getRotationMatrix4XY( float angleRadians) { glm::mat4 result; result[0][0] = cos(angleRadians); @@ -12,7 +13,7 @@ glm::mat4 getRotationMatrix4XY( return result; } -glm::mat4 getRotationMatrix4YZ( +glm::mat4 Vec4Ops::getRotationMatrix4YZ( float angleRadians) { glm::mat4 result; result[1][1] = cos(angleRadians); @@ -24,7 +25,7 @@ glm::mat4 getRotationMatrix4YZ( return result; } -glm::mat4 getRotationMatrix4ZX( +glm::mat4 Vec4Ops::getRotationMatrix4ZX( float angleRadians) { glm::mat4 result; result[2][2] = cos(angleRadians); @@ -36,7 +37,7 @@ glm::mat4 getRotationMatrix4ZX( return result; } -glm::mat4 getRotationMatrix4XW( +glm::mat4 Vec4Ops::getRotationMatrix4XW( float angleRadians) { glm::mat4 result; result[0][0] = cos(angleRadians); @@ -48,7 +49,7 @@ glm::mat4 getRotationMatrix4XW( return result; } -glm::mat4 getRotationMatrix4YW( +glm::mat4 Vec4Ops::getRotationMatrix4YW( float angleRadians) { glm::mat4 result; result[1][1] = cos(angleRadians); @@ -60,7 +61,7 @@ glm::mat4 getRotationMatrix4YW( return result; } -glm::mat4 getRotationMatrix4ZW( +glm::mat4 Vec4Ops::getRotationMatrix4ZW( float angleRadians) { glm::mat4 result; result[2][2] = cos(angleRadians); @@ -70,19 +71,4 @@ glm::mat4 getRotationMatrix4ZW( result[0][0] = 1; result[1][1] = 1; return result; -} - -glm::mat4 RayTracer::getRotationMatrix4( - float angleRadiansXY, - float angleRadiansYZ, - float angleRadiansZX, - float angleRadiansXW, - float angleRadiansYW, - float angleRadiansZW) { - return getRotationMatrix4XY(angleRadiansXY) * - getRotationMatrix4YZ(angleRadiansYZ) * - getRotationMatrix4ZX(angleRadiansZX) * - getRotationMatrix4XW(angleRadiansXW) * - getRotationMatrix4YW(angleRadiansYW) * - getRotationMatrix4ZW(angleRadiansZW); }
\ No newline at end of file |