From fa7dcdcb0ddf173c031f4e60e4d652451f87714f Mon Sep 17 00:00:00 2001 From: jyelon Date: Mon, 8 Jun 2026 14:58:44 -0400 Subject: [PATCH] Increase view radius, remove radius parameter from get_tangibles_near --- Source/Integration/LockedWrapper.cpp | 4 ++-- Source/Integration/LockedWrapper.h | 2 +- Source/Integration/LuprexGameModeBase.cpp | 4 ++-- luprex/cpp/core/drivenengine.cpp | 2 +- luprex/cpp/core/enginewrapper.hpp | 2 +- luprex/cpp/core/world-core.cpp | 8 ++++---- luprex/cpp/core/world.hpp | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/Integration/LockedWrapper.cpp b/Source/Integration/LockedWrapper.cpp index 2c3b701d..035e2ee6 100644 --- a/Source/Integration/LockedWrapper.cpp +++ b/Source/Integration/LockedWrapper.cpp @@ -61,10 +61,10 @@ int64 FlxLockedWrapper::GetActor() { return Lockable.Wrapper.get_actor_id(Get()); } -IdView FlxLockedWrapper::GetNear(int64 id, double rx, double ry, double rz) { +IdView FlxLockedWrapper::GetNear(int64 id) { uint32 size; int64* data; - Lockable.Wrapper.get_tangibles_near(Get(), id, rx, ry, rz, &size, (int64_t**)&data); + Lockable.Wrapper.get_tangibles_near(Get(), id, &size, (int64_t**)&data); return IdView(data, size); } diff --git a/Source/Integration/LockedWrapper.h b/Source/Integration/LockedWrapper.h index ec227432..530cb8e1 100644 --- a/Source/Integration/LockedWrapper.h +++ b/Source/Integration/LockedWrapper.h @@ -120,7 +120,7 @@ public: // fetch this once per frame and then store the // IdView somewhere (like in the TangibleManager). // - IdView GetNear(int64 id, double rx, double ry, double rz); + IdView GetNear(int64 id); // Get animation queues. // diff --git a/Source/Integration/LuprexGameModeBase.cpp b/Source/Integration/LuprexGameModeBase.cpp index e54618a8..57201882 100644 --- a/Source/Integration/LuprexGameModeBase.cpp +++ b/Source/Integration/LuprexGameModeBase.cpp @@ -75,7 +75,7 @@ void ALuprexGameModeBase::UpdateConsoleOutput() { } void ALuprexGameModeBase::UpdateTangibles() { - double radius = 1000.0; // Hardwired for now. + double radius = 100000.0; // Hardwired for now. using TanArray = UlxTangibleManager::TanArray; if (!Playing) return; UlxTangibleManager *TM = GetGameInstance()->GetSubsystem(); @@ -83,7 +83,7 @@ void ALuprexGameModeBase::UpdateTangibles() { { FlxLockedWrapper w; PlayerId = w.GetActor(); - IdView nearids = w.GetNear(PlayerId, radius, radius, radius); + IdView nearids = w.GetNear(PlayerId); TM->UpdateNearAccordingToLuprex(nearids); alltans = TM->GetAllTangibles(); IdArray allids = TM->GetIds(alltans); diff --git a/luprex/cpp/core/drivenengine.cpp b/luprex/cpp/core/drivenengine.cpp index 12f1f1c2..e9472d31 100644 --- a/luprex/cpp/core/drivenengine.cpp +++ b/luprex/cpp/core/drivenengine.cpp @@ -778,7 +778,7 @@ static int64_t empty_id_list_ = 0; void DrivenEngine::unexpose_world_to_driver(EngineWrapper *w) { w->world = nullptr; - w->get_tangibles_near = [](EngineWrapper *, uint64_t, double, double, double, uint32_t *count, int64_t **ids) { + w->get_tangibles_near = [](EngineWrapper *, uint64_t, uint32_t *count, int64_t **ids) { *count = 0; *ids = &empty_id_list_; }; diff --git a/luprex/cpp/core/enginewrapper.hpp b/luprex/cpp/core/enginewrapper.hpp index bcafc9fe..ffcf9e5d 100644 --- a/luprex/cpp/core/enginewrapper.hpp +++ b/luprex/cpp/core/enginewrapper.hpp @@ -139,7 +139,7 @@ struct EngineWrapper { // Returns a count and a pointer to an array of tangible IDs. The returned // pointer is valid until the next call to get_tangibles_near. // - void (*get_tangibles_near)(EngineWrapper *w, uint64_t tanid, double rx, double ry, double rz, uint32_t *count, int64_t **ids); + void (*get_tangibles_near)(EngineWrapper *w, uint64_t tanid, uint32_t *count, int64_t **ids); // Get the animation queues for the specified tangibles. // diff --git a/luprex/cpp/core/world-core.cpp b/luprex/cpp/core/world-core.cpp index 7dbddfa0..7ec83e1e 100644 --- a/luprex/cpp/core/world-core.cpp +++ b/luprex/cpp/core/world-core.cpp @@ -1376,7 +1376,7 @@ void World::get_animation_queues(uint32_t count, const int64_t *ids, uint32_t *l } } -void World::get_tangibles_near(uint64_t tanid, double rx, double ry, double rz, uint32_t *count, int64_t **ids) { +void World::get_tangibles_near(uint64_t tanid, uint32_t *count, int64_t **ids) { uint32_t hash1 = eng::memhash(); wrapper_scan_result_.clear(); if (tanid != 0) { @@ -1384,7 +1384,7 @@ void World::get_tangibles_near(uint64_t tanid, double rx, double ry, double rz, scan.set_near(tanid, true); scan.set_omit_nowhere(true); scan.set_sorted(false); - scan.set_radius(util::XYZ(rx, ry, rz)); + scan.set_radius(RadiusVisibility); scan.set_shape(PlaneScan::CYLINDER); get_near(scan, &wrapper_scan_result_); } @@ -1396,8 +1396,8 @@ void World::get_tangibles_near(uint64_t tanid, double rx, double ry, double rz, void World::expose_world_to_driver(EngineWrapper *w) { w->world = this; - w->get_tangibles_near = [](EngineWrapper *w, uint64_t tanid, double rx, double ry, double rz, uint32_t *count, int64_t **ids) { - w->world->get_tangibles_near(tanid, rx, ry, rz, count, ids); + w->get_tangibles_near = [](EngineWrapper *w, uint64_t tanid, uint32_t *count, int64_t **ids) { + w->world->get_tangibles_near(tanid, count, ids); }; w->get_animation_queues = [](EngineWrapper *w, uint32_t count, const int64_t *ids, uint32_t *lengths, const char **strings) { w->world->get_animation_queues(count, ids, lengths, strings); diff --git a/luprex/cpp/core/world.hpp b/luprex/cpp/core/world.hpp index 418f48ef..45331e73 100644 --- a/luprex/cpp/core/world.hpp +++ b/luprex/cpp/core/world.hpp @@ -112,8 +112,8 @@ class World : public eng::opnew { public: using IdVector = util::IdVector; using TanVector = eng::vector; - const float RadiusVisibility = 1000.0; - const float RadiusClose = 1000.0; + const float RadiusVisibility = 100000.0; + const float RadiusClose = 5000.0; // Constructor. // @@ -157,7 +157,7 @@ public: // returned pointer remains valid until the next call to // get_tangibles_near. // - void get_tangibles_near(uint64_t tanid, double rx, double ry, double rz, uint32_t *count, int64_t **ids); + void get_tangibles_near(uint64_t tanid, uint32_t *count, int64_t **ids); // Get the animation queues for the specified tangibles. //