diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2017-06-03 23:48:44 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2017-06-03 23:48:44 -0700 |
commit | 3206fc10cb2cf01e61232a04f68917b0c244e552 (patch) | |
tree | ee254da5c3a2f5dea65d5ad3ac8ad3ce6ac76b55 /src/modules/ray/ray_object_plane.h | |
parent | 902e535fce76b7790a4c010651b2233ed3945781 (diff) |
ray: convert from recursive to iterative tracing
Small speedup, I personally find the code cleaner this way too.
Everything in the hot path should now be inlined, no function calls.
Diffstat (limited to 'src/modules/ray/ray_object_plane.h')
-rw-r--r-- | src/modules/ray/ray_object_plane.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/ray/ray_object_plane.h b/src/modules/ray/ray_object_plane.h index 5fcc619..490238c 100644 --- a/src/modules/ray/ray_object_plane.h +++ b/src/modules/ray/ray_object_plane.h @@ -32,7 +32,7 @@ static inline int ray_object_plane_intersects_ray(ray_object_plane_t *plane, uns if (d >= 0.00001f) { float distance = plane->_prepared.primary_dot_plus; - if (depth != 1) + if (depth) distance = (ray_3f_dot(&plane->normal, &ray->origin) + plane->distance); distance /= d; |