Work on implementing quaternion

This commit is contained in:
antopilo
2022-06-29 20:05:08 -04:00
parent b2f59a189b
commit 32e63a5137
7 changed files with 48 additions and 504 deletions
@@ -7,10 +7,21 @@ namespace Nuake
{
GlobalTranslation = Vector3(0, 0, 0);
Translation = Vector3(0, 0, 0);
Orientation = Quat(0, 0, 0, 0);
GlobalOrientation = Orientation;
Rotation = Vector3(0, 0, 0);
Scale = Vector3(1, 1, 1);
}
void TransformComponent::SetRotation(float x, float y, float z)
{
Quat QuatAroundX = Quat(1.0, 0.0, 0.0, x);
Quat QuatAroundY = Quat(0.0, 1.0, 0.0, y);
Quat QuatAroundZ = Quat(0.0, 0.0, 1.0, z);
Quat finalOrientation = QuatAroundX * QuatAroundY * QuatAroundZ;
Orientation = finalOrientation;
}
Matrix4 TransformComponent::GetGlobalTransform() const
{
return GlobalTransform;