From da39d95d89cf626b8b773380bb0d109c5bc41f18 Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 25 Oct 2025 02:57:41 -0600 Subject: Changed things --- src/world.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index 75fc0ab..dd76cf8 100644 --- a/src/world.c +++ b/src/world.c @@ -936,7 +936,7 @@ float getWorldHeightAtLocation(const World* world, float x, float y) return 0.0; } -void castRayBVH(const World* world, BVHNode node, Ray ray, bool includePlaces, +void castRayBVH(const World* world, BVHNode node, Ray ray, bool allowAll, int* tests, WorldUID* closest, float* closestDistance) { if (!GetRayCollisionBox(ray, node.box).hit) @@ -964,8 +964,8 @@ void castRayBVH(const World* world, BVHNode node, Ray ray, bool includePlaces, ray.position); // Don't include places. - if (!includePlaces && - entityIsPlace(world->entities[node.entities[index]].id)) + if (!allowAll && + !entityCanBeSelected(world->entities[node.entities[index]].id)) { continue; } @@ -982,7 +982,7 @@ void castRayBVH(const World* world, BVHNode node, Ray ray, bool includePlaces, { for (int index = 0; index < node.branchCount; ++index) { - castRayBVH(world, *node.branches[index], ray, includePlaces, tests, + castRayBVH(world, *node.branches[index], ray, allowAll, tests, closest, closestDistance); } } @@ -990,12 +990,12 @@ void castRayBVH(const World* world, BVHNode node, Ray ray, bool includePlaces, return; } -WorldUID castRayAtWorld(const World* world, Ray ray, bool includePlaces, +WorldUID castRayAtWorld(const World* world, Ray ray, bool allowAll, int* tests) { WorldUID uid = -1; float distance = Vector3LengthSqr(world->size); - castRayBVH(world, world->bvh, ray, includePlaces, tests, &uid, &distance); + castRayBVH(world, world->bvh, ray, allowAll, tests, &uid, &distance); return uid; } -- cgit v1.2.3