summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXANTRONIX Development2022-02-22 13:17:31 -0500
committerXANTRONIX Development2022-02-22 13:17:31 -0500
commitd683cd0c6a02e05e558e3426f14b7040d09c9a80 (patch)
tree74279fc2a645fbea82fa206b9a84baec8a51d9a1 /src
parent08664e8d3f22e7d2885bef930f696e33c88827d6 (diff)
downloadxas-d683cd0c6a02e05e558e3426f14b7040d09c9a80.tar.gz
xas-d683cd0c6a02e05e558e3426f14b7040d09c9a80.tar.bz2
xas-d683cd0c6a02e05e558e3426f14b7040d09c9a80.zip
Even better
Diffstat (limited to 'src')
-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,