aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-10-25 08:57:41 +0000
committernathan <nathansmith@disroot.org>2025-10-25 08:57:41 +0000
commitda39d95d89cf626b8b773380bb0d109c5bc41f18 (patch)
tree7bea5db94fb88913d77397ec5bfb51e4e01db0a8 /src/world.c
parente7ef990a0a3b1ddf40a2f0d517e8eb4e261b1f80 (diff)
downloadFindThings-da39d95d89cf626b8b773380bb0d109c5bc41f18.tar.gz
FindThings-da39d95d89cf626b8b773380bb0d109c5bc41f18.tar.bz2
FindThings-da39d95d89cf626b8b773380bb0d109c5bc41f18.zip
Changed things
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c12
1 files changed, 6 insertions, 6 deletions
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;
}