fix flipped camera movements
This commit is contained in:
@@ -99,7 +99,7 @@ namespace OpenVulkano::Scene
|
||||
{
|
||||
//TODO this should be done based on the clipspace used by the rendering api
|
||||
// In vulkan the screen space is defined as y=0=top and y=1=bottom and thus the coordinate have to be flipped
|
||||
m_viewProjection = m_projection * Math::Matrix4f(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) * m_view;
|
||||
m_viewProjection = m_projection * m_view;
|
||||
}
|
||||
|
||||
void UpdateWorldMatrix(const Math::Matrix4f& parentWorldMat) override
|
||||
@@ -252,6 +252,7 @@ namespace OpenVulkano::Scene
|
||||
void UpdateProjectionMatrix() override
|
||||
{
|
||||
m_projection = Math::Utils::perspectiveRH_ZO(m_fov, m_aspect, m_nearPlane, m_farPlane);
|
||||
m_projection *= Math::Matrix4f(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
UpdateViewProjectionMatrix();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user