Closed athanggupte closed 2 years ago
Currently in TransformComponent the final rotation matrix is calculated by multiplying rotation matrices with respect to each axis as seen here.
This is inefficient and also has improper rotation effect as rotation in Z axis us applied after Y axis which is after X axis.
An alternative is to convert the Euler angles to quaternion and to get the Mat4 from that.
P.S. this might not solve the axis precedence issue.
#define GLM_ENABLE_EXPERIMENTAL #include <glm/gtx/quaternion.hpp> glm::mat4 rotationMatrix = glm::toMat4(glm::quat(rotation));
Currently in TransformComponent the final rotation matrix is calculated by multiplying rotation matrices with respect to each axis as seen here.
This is inefficient and also has improper rotation effect as rotation in Z axis us applied after Y axis which is after X axis.
An alternative is to convert the Euler angles to quaternion and to get the Mat4 from that.
P.S. this might not solve the axis precedence issue.