From b934e98fc34964970ab5efacb2fb7c3372ae0b1a Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sat, 13 Dec 2025 11:50:28 -0700 Subject: Refactor Track Class To Instantiate On Track Load (#587) * Initial Commit * First compilation of Registry template * Further changes * wip changes * Impl TrackBrowser and Registry Info * Remove const from TInfo * Prep GetWorld * Name refactor * Refactor gWorldInstance to GetWorld() * wip * Should work now * Data menu work again * Fix editor staying open after program close * Rename LoadLevel to LoadTrackDataFromJson * More changes * Add statue * Add search to content browser using tags * Fix statue pos and register tags * Fix actor loading * Fix delete all bug which deleted cameras * reduce some boiler plate in actor and object * Remove unused rulesets * Search bar for all tabs * fix data screen * fix actor spawning * temp editor fix * Clean up * improve extra mode transformation * fix podium crash * Fix editor clicking * Fix editor clicking 2 * fix extra in custom track * Fix FI for three actors * Fix divide by zero error * Ids managed by Registry * Add scary comment --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> Co-authored-by: coco875 --- src/engine/editor/EditorMath.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/engine/editor/EditorMath.cpp') diff --git a/src/engine/editor/EditorMath.cpp b/src/engine/editor/EditorMath.cpp index 93d826ace..620aa2b48 100644 --- a/src/engine/editor/EditorMath.cpp +++ b/src/engine/editor/EditorMath.cpp @@ -42,7 +42,7 @@ bool IsInGameScreen() { FVector ScreenRayTrace() { auto wnd = GameEngine::Instance->context->GetWindow(); - Camera* camera = gEditor.eCamera; + Camera* camera = gScreenOneCtx->camera; Ship::Coords mouse = wnd->GetMousePos(); auto gfx_current_game_window_viewport = GetInterpreter()->mGameWindowViewport; @@ -62,7 +62,7 @@ FVector ScreenRayTrace() { Mat4 perspMtx; u16 perspNorm; - guPerspectiveF(perspMtx, &perspNorm, gCameraFOV[0], OTRGetAspectRatio(), CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f); + guPerspectiveF(perspMtx, &perspNorm, 40, OTRGetAspectRatio(), CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f); Mat4 inversePerspMtx; if (InverseMatrix((float*)&perspMtx, (float*)&inversePerspMtx) != 2) { @@ -412,7 +412,7 @@ void SetRotatorFromDirection(FVector direction, IRotator* rot) { } FVector GetPositionAheadOfCamera(f32 dist) { - Camera* camera = gEditor.eCamera; + Camera* camera = gScreenOneCtx->camera; FVector pos = FVector(camera->pos[0], camera->pos[1], camera->pos[2]); f32 pitch = (camera->rot[2] / 65535.0f) * 360.0f; -- cgit v1.2.3