Increase view radius, remove radius parameter from get_tangibles_near
This commit is contained in:
@@ -61,10 +61,10 @@ int64 FlxLockedWrapper::GetActor() {
|
|||||||
return Lockable.Wrapper.get_actor_id(Get());
|
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;
|
uint32 size;
|
||||||
int64* data;
|
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);
|
return IdView(data, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public:
|
|||||||
// fetch this once per frame and then store the
|
// fetch this once per frame and then store the
|
||||||
// IdView somewhere (like in the TangibleManager).
|
// IdView somewhere (like in the TangibleManager).
|
||||||
//
|
//
|
||||||
IdView GetNear(int64 id, double rx, double ry, double rz);
|
IdView GetNear(int64 id);
|
||||||
|
|
||||||
// Get animation queues.
|
// Get animation queues.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ void ALuprexGameModeBase::UpdateConsoleOutput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ALuprexGameModeBase::UpdateTangibles() {
|
void ALuprexGameModeBase::UpdateTangibles() {
|
||||||
double radius = 1000.0; // Hardwired for now.
|
double radius = 100000.0; // Hardwired for now.
|
||||||
using TanArray = UlxTangibleManager::TanArray;
|
using TanArray = UlxTangibleManager::TanArray;
|
||||||
if (!Playing) return;
|
if (!Playing) return;
|
||||||
UlxTangibleManager *TM = GetGameInstance()->GetSubsystem<UlxTangibleManager>();
|
UlxTangibleManager *TM = GetGameInstance()->GetSubsystem<UlxTangibleManager>();
|
||||||
@@ -83,7 +83,7 @@ void ALuprexGameModeBase::UpdateTangibles() {
|
|||||||
{
|
{
|
||||||
FlxLockedWrapper w;
|
FlxLockedWrapper w;
|
||||||
PlayerId = w.GetActor();
|
PlayerId = w.GetActor();
|
||||||
IdView nearids = w.GetNear(PlayerId, radius, radius, radius);
|
IdView nearids = w.GetNear(PlayerId);
|
||||||
TM->UpdateNearAccordingToLuprex(nearids);
|
TM->UpdateNearAccordingToLuprex(nearids);
|
||||||
alltans = TM->GetAllTangibles();
|
alltans = TM->GetAllTangibles();
|
||||||
IdArray allids = TM->GetIds(alltans);
|
IdArray allids = TM->GetIds(alltans);
|
||||||
|
|||||||
@@ -778,7 +778,7 @@ static int64_t empty_id_list_ = 0;
|
|||||||
|
|
||||||
void DrivenEngine::unexpose_world_to_driver(EngineWrapper *w) {
|
void DrivenEngine::unexpose_world_to_driver(EngineWrapper *w) {
|
||||||
w->world = nullptr;
|
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;
|
*count = 0;
|
||||||
*ids = &empty_id_list_;
|
*ids = &empty_id_list_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ struct EngineWrapper {
|
|||||||
// Returns a count and a pointer to an array of tangible IDs. The returned
|
// 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.
|
// 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.
|
// Get the animation queues for the specified tangibles.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -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();
|
uint32_t hash1 = eng::memhash();
|
||||||
wrapper_scan_result_.clear();
|
wrapper_scan_result_.clear();
|
||||||
if (tanid != 0) {
|
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_near(tanid, true);
|
||||||
scan.set_omit_nowhere(true);
|
scan.set_omit_nowhere(true);
|
||||||
scan.set_sorted(false);
|
scan.set_sorted(false);
|
||||||
scan.set_radius(util::XYZ(rx, ry, rz));
|
scan.set_radius(RadiusVisibility);
|
||||||
scan.set_shape(PlaneScan::CYLINDER);
|
scan.set_shape(PlaneScan::CYLINDER);
|
||||||
get_near(scan, &wrapper_scan_result_);
|
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) {
|
void World::expose_world_to_driver(EngineWrapper *w) {
|
||||||
w->world = this;
|
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->get_tangibles_near = [](EngineWrapper *w, uint64_t tanid, uint32_t *count, int64_t **ids) {
|
||||||
w->world->get_tangibles_near(tanid, rx, ry, rz, count, 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->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);
|
w->world->get_animation_queues(count, ids, lengths, strings);
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ class World : public eng::opnew {
|
|||||||
public:
|
public:
|
||||||
using IdVector = util::IdVector;
|
using IdVector = util::IdVector;
|
||||||
using TanVector = eng::vector<const Tangible*>;
|
using TanVector = eng::vector<const Tangible*>;
|
||||||
const float RadiusVisibility = 1000.0;
|
const float RadiusVisibility = 100000.0;
|
||||||
const float RadiusClose = 1000.0;
|
const float RadiusClose = 5000.0;
|
||||||
|
|
||||||
// Constructor.
|
// Constructor.
|
||||||
//
|
//
|
||||||
@@ -157,7 +157,7 @@ public:
|
|||||||
// returned pointer remains valid until the next call to
|
// returned pointer remains valid until the next call to
|
||||||
// get_tangibles_near.
|
// 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.
|
// Get the animation queues for the specified tangibles.
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user