draw camera info on top of the screen, not above
This commit is contained in:
parent
ceb630b6ce
commit
2fdb95b6c4
|
|
@ -16,16 +16,20 @@ namespace NzEditor
|
||||||
|
|
||||||
if (ImGui::Begin("MainWindow"))
|
if (ImGui::Begin("MainWindow"))
|
||||||
{
|
{
|
||||||
|
auto pos = ImGui::GetCursorPos();
|
||||||
|
ImGui::Image(GetApplication()->GetEngineTexture());
|
||||||
|
ImGui::SetCursorPos(pos); // everything else will be drawn on top of the texture
|
||||||
|
|
||||||
auto cam = GetApplication()->GetMainCamera();
|
auto cam = GetApplication()->GetMainCamera();
|
||||||
auto& camcomponent = cam.get<Nz::EditorCameraComponent>();
|
auto& camcomponent = cam.get<Nz::EditorCameraComponent>();
|
||||||
auto& transform = cam.get<Nz::NodeComponent>();
|
auto& transform = cam.get<Nz::NodeComponent>();
|
||||||
|
|
||||||
auto desiredRotation = camcomponent.GetOrientation();
|
auto desiredRotation = camcomponent.GetOrientation();
|
||||||
auto rotation = transform.GetRotation().ToEulerAngles();
|
auto rotation = transform.GetRotation().ToEulerAngles();
|
||||||
|
|
||||||
ImGui::Text("Camera position: %.2f %.2f %.2f", transform.GetPosition().x, transform.GetPosition().y, transform.GetPosition().z);
|
ImGui::Text("Camera position: %.2f %.2f %.2f", transform.GetPosition().x, transform.GetPosition().y, transform.GetPosition().z);
|
||||||
ImGui::Text("Camera rotation: %.2f %.2f %.2f", rotation.roll.value, rotation.pitch.value, rotation.yaw.value);
|
ImGui::Text("Camera rotation: %.2f %.2f %.2f", rotation.roll.value, rotation.pitch.value, rotation.yaw.value);
|
||||||
|
|
||||||
ImGui::Image(GetApplication()->GetEngineTexture());
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue