Setup imgui layout for editor

This commit is contained in:
MegaMech
2025-03-07 14:52:36 -07:00
parent 8f1458902a
commit 55b905f377
12 changed files with 179 additions and 110 deletions
+4 -2
View File
@@ -23,10 +23,12 @@ FVector ScreenRayTrace() {
Camera* camera = &cameras[0];
Ship::Coords mouse = wnd->GetMousePos();
mouse.x -= gfx_current_game_window_viewport.x;
mouse.y -= gfx_current_game_window_viewport.y;
// Get screen dimensions
uint32_t width = wnd->GetWidth();
uint32_t height = wnd->GetHeight();
uint32_t width = OTRGetGameRenderWidth();
uint32_t height = OTRGetGameRenderHeight();
// Convert mouse to NDS screen coordinates
float x = (2.0f * mouse.x) / width - 1.0f; // Normalized X: -1 to 1
+5
View File
@@ -21,6 +21,7 @@ extern "C" {
#include "math_util_2.h"
#include "camera.h"
#include "courses/harbour/ship_model.h"
#include "src/racing/collision.h"
}
Gizmo::Gizmo() {
@@ -93,6 +94,10 @@ void Gizmo::Translate() {
break;
}
if (CVarGetInteger("gEditorSnapToGround", false) == true) {
_selected->Pos->y = spawn_actor_on_surface(_selected->Pos->x, 2000.0f, _selected->Pos->z);
}
Pos = FVector(
_selected->Pos->x,
_selected->Pos->y,