aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
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;
}