commit af4c65de032591da950d4b5640153d0329578e7d
parent bcfa2b7375e898f13f7e4c3e64b39ec1aaaac10d
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Thu, 7 Nov 2019 18:26:29 +0100
Merge branch 'release_0.4.1'
Diffstat:
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
@@ -35,6 +35,10 @@ variable the install directories of its dependencies.
Release notes
-------------
+### Version 0.4.1
+
+- Fix an infinite loop related to a rare numerical accuracy problem.
+
### Version 0.4
- Change signature of the senc2d_scene_add_geometry API. Thus this release
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -47,7 +47,7 @@ endif()
################################################################################
set(VERSION_MAJOR 0)
set(VERSION_MINOR 4)
-set(VERSION_PATCH 0)
+set(VERSION_PATCH 1)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
set(SENC2D_FILES_SRC
diff --git a/src/senc2d_scene_analyze.c b/src/senc2d_scene_analyze.c
@@ -116,20 +116,14 @@ self_hit_filter
const struct darray_segment_comp* segments_comp = filter_data;
const component_id_t* origin_component = ray_data;
const struct segment_comp* hit_seg_comp;
- enum senc2d_side hit_side;
- component_id_t hit_component;
(void)ray_org; (void)ray_dir;
ASSERT(hit && segments_comp && origin_component);
ASSERT(hit->prim.prim_id < darray_segment_comp_size_get(segments_comp));
hit_seg_comp = darray_segment_comp_cdata_get(segments_comp)
+ hit->prim.prim_id;
- hit_side = (hit->normal[1] > 0) ? SENC2D_FRONT : SENC2D_BACK;
- hit_component = hit_seg_comp->component[hit_side];
-
- /* If self hit, distance should be small */
- ASSERT(hit_component != *origin_component || hit->distance < 1e-6);
- return (hit_component == *origin_component);
+ return (hit_seg_comp->component[SENC2D_FRONT] == *origin_component
+ || hit_seg_comp->component[SENC2D_BACK] == *origin_component);
}
static void