Switch to right handed coordinate system
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user