Switch to right handed coordinate system

This commit is contained in:
2021-02-23 03:32:11 +01:00
parent 9b4821a102
commit 71855a1d9f
2 changed files with 21 additions and 21 deletions

View File

@@ -80,7 +80,7 @@ namespace openVulkanoCpp
void UpdateViewProjectionMatrix()
{ // In vulkan the screen space is defined as y=0=top and y=1=bottom and thus the coordinate have to be flipped
viewProjection = projection * Math::Matrix4f(1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,1) * view;
viewProjection = projection * Math::Matrix4f(1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1) * view;
}
void UpdateWorldMatrix(const Math::Matrix4f& parentWorldMat) override
@@ -179,7 +179,7 @@ namespace openVulkanoCpp
void UpdateProjectionMatrix() override
{
projection = Math::Utils::perspectiveLH_ZO(fov, aspect, nearPlane, farPlane);
projection = Math::Utils::perspectiveRH_ZO(fov, aspect, nearPlane, farPlane);
UpdateViewProjectionMatrix();
}
};
@@ -190,7 +190,7 @@ namespace openVulkanoCpp
void UpdateProjectionMatrix() override
{
const float widthHalf = width * 0.5f, heightHalf = height * 0.5f;
projection = Math::Utils::orthoLH_ZO(-widthHalf, widthHalf, -heightHalf, heightHalf, nearPlane, farPlane);
projection = Math::Utils::orthoRH_ZO(-widthHalf, widthHalf, -heightHalf, heightHalf, nearPlane, farPlane);
UpdateViewProjectionMatrix();
}
};