Increase view radius, remove radius parameter from get_tangibles_near

This commit is contained in:
2026-06-08 14:58:44 -04:00
parent 536abb2231
commit fa7dcdcb0d
7 changed files with 14 additions and 14 deletions

View File

@@ -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_;
};

View File

@@ -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.
//

View File

@@ -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);

View File

@@ -112,8 +112,8 @@ class World : public eng::opnew {
public:
using IdVector = util::IdVector;
using TanVector = eng::vector<const Tangible*>;
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.
//