From d683cd0c6a02e05e558e3426f14b7040d09c9a80 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Tue, 22 Feb 2022 13:17:31 -0500 Subject: Even better --- src/spatial.c | 14 +++----------- 1 file 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, -- cgit v1.2.3