Game viewport now resizing
This commit is contained in:
@@ -68,6 +68,7 @@ void ViewportWidget::Draw()
|
||||
Vector2 viewportPanelSize = glm::vec2(regionAvail.x, regionAvail.y);
|
||||
|
||||
bool needsResize = sceneViewport->QueueResize(viewportPanelSize);
|
||||
editorContext.GetScene()->GetCurrentCamera()->OnWindowResize(regionAvail.x, regionAvail.y);
|
||||
|
||||
// This is important for make UI mouse coord relative to viewport
|
||||
// Nuake::Input::SetViewportDimensions(m_ViewportPos, viewportPanelSize);
|
||||
@@ -208,7 +209,7 @@ void ViewportWidget::OnSceneChanged(Ref<Nuake::Scene> scene)
|
||||
}
|
||||
|
||||
// Create new viewport with same reoslution
|
||||
const UUID viewId = editorContext.GetScene()->m_EditorCamera->ID;
|
||||
const UUID viewId = editorContext.GetScene()->GetCurrentCamera()->ID;
|
||||
auto viewport = vkRenderer.CreateViewport(viewId, currentResolution);
|
||||
vkRenderer.RegisterSceneViewport(scene, viewport->GetID());
|
||||
|
||||
|
||||
@@ -238,8 +238,8 @@ void VkSceneRenderer::Init()
|
||||
std::vector<Vertex> sphereVertices;
|
||||
std::vector<uint32_t> sphereIndices;
|
||||
|
||||
const int ringSegments = 32;
|
||||
const float sphereRadius = 1.0f;
|
||||
const int ringSegments = 16;
|
||||
const float sphereRadius = 0.5f;
|
||||
|
||||
// XY Ring
|
||||
for (int i = 0; i < ringSegments; ++i)
|
||||
@@ -293,8 +293,8 @@ void VkSceneRenderer::Init()
|
||||
std::vector<uint32_t> cylinderIndices;
|
||||
|
||||
const int segments = 16;
|
||||
const float radius = 1.0f;
|
||||
const float halfHeight = 2.0f;
|
||||
const float radius = 0.5f;
|
||||
const float halfHeight = 1.0f;
|
||||
|
||||
// Vertex pairs: top and bottom
|
||||
for (int i = 0; i < segments; ++i)
|
||||
|
||||
Reference in New Issue
Block a user