diff options
author | XANTRONIX Development | 2022-02-22 13:17:31 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-02-22 13:17:31 -0500 |
commit | d683cd0c6a02e05e558e3426f14b7040d09c9a80 (patch) | |
tree | 74279fc2a645fbea82fa206b9a84baec8a51d9a1 | |
parent | 08664e8d3f22e7d2885bef930f696e33c88827d6 (diff) | |
download | xas-d683cd0c6a02e05e558e3426f14b7040d09c9a80.tar.gz xas-d683cd0c6a02e05e558e3426f14b7040d09c9a80.tar.bz2 xas-d683cd0c6a02e05e558e3426f14b7040d09c9a80.zip |
Even better
-rw-r--r-- | src/spatial.c | 14 |
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, |