commit 104c9015c9d4b3d20a7a688f6f503d324776f5a9
parent e3af82ccc252ca6c9daae3fd4a08cf9b95eae6b9
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 31 May 2018 16:55:21 +0200
Fix the scene_get_medium_<2|3>d functions
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/sdis_scene.c b/src/sdis_scene.c
@@ -499,7 +499,8 @@ scene_get_medium_2d
}
/* Discard the hit if it is on a vertex, i.e. between 2 segments, and
* target a new position onto the current primitive */
- } while(hit_on_vertex(&hit) && (s+=s_step) <= s_range[1]);
+ } while((S2D_HIT_NONE(&hit) || hit_on_vertex(&hit))
+ && (s+=s_step) <= s_range[1]);
/* The hits of all targeted positions on the current primitive are on
* vertices. Challenge positions on another primitive. */
@@ -586,7 +587,7 @@ scene_get_medium_3d
}
/* Discard the hit if it is on an edge, i.e. between 2 triangles, and
* target a new position onto the current primitive */
- } while(hit_on_edge(&hit) && ++istep < nsteps);
+ } while((S3D_HIT_NONE(&hit) || hit_on_edge(&hit)) && ++istep < nsteps);
/* The hits of all targeted positions on the current primitive are on
* edges. Challenge positions on another primitive. */