summaryrefslogtreecommitdiffstats
path: root/src/spatial.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/spatial.c')
-rw-r--r--src/spatial.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/spatial.c b/src/spatial.c
index 4a93fdd..9885418 100644
--- a/src/spatial.c
+++ b/src/spatial.c
@@ -81,20 +81,12 @@ static int within_cone(xas_spatial_coord coord,
xas_spatial_coord apex_to_x_vect,
axis_vect;
- int is_infinite;
-
diff(&apex_to_x_vect, cone.apex, coord);
diff(&axis_vect, cone.apex, cone.base);
- is_infinite = dotf(apex_to_x_vect, axis_vect)
- / magnf(apex_to_x_vect)
- / magnf(axis_vect) > cosf(cone.angle / 2.0f);
-
- if (!is_infinite) {
- return 0;
- }
-
- return dotf(apex_to_x_vect, axis_vect) / magnf(axis_vect) < magnf(axis_vect);
+ return dotf(apex_to_x_vect, axis_vect)
+ / magnf(apex_to_x_vect)
+ / magnf(axis_vect) > cosf(cone.angle / 2.0f);
}
static int buffer_realloc(xas_spatial_scene *scene,