mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-09 12:24:16 -04:00
Setup imgui layout for editor
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user