star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

commit b5e60bf7de8dfc7ea045c21573823b99c71e5519
parent 1a2901628e769475ad079776a5812c2fb205277a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri,  2 Jun 2017 11:12:45 +0200

Merge branch 'release-0.4.1'

Diffstat:
MREADME.md | 6++++++
Mcmake/CMakeLists.txt | 2+-
Msrc/s3d_scene_view.c | 7+++++--
Msrc/s3d_scene_view_c.h | 1+
4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md @@ -113,6 +113,12 @@ with `<STAR3D_INSTALL_DIR>` the install directory of Star-3D and ## Release notes +### Version 0.4.1 + +- Fix the `s3d_scene_view` consistency when it is created from a scene + containing instances: the geometries might be not correctly synchronised and + thus could be outdated. + ### Version 0.4 - Implement the `s3d_scene_view` API; it replaces the diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -58,7 +58,7 @@ rcmake_append_runtime_dirs(_runtime_dirs RSys Embree) ################################################################################ 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(S3D_FILES_SRC diff --git a/src/s3d_scene_view.c b/src/s3d_scene_view.c @@ -365,7 +365,9 @@ scene_view_setup_embree(struct s3d_scene_view* scnview) /* Define whether or not the embree scene is outdated */ if(geom->embree_outdated_mask) rtc_outdated = 1; - + if(geom->type == GEOM_INSTANCE && geom->data.instance->scnview->rtc_commit) + rtc_outdated = 1; + /* Register the embree geometry */ res = embree_geometry_register(scnview, geom); if(res != RES_OK) goto error; @@ -390,6 +392,7 @@ scene_view_setup_embree(struct s3d_scene_view* scnview) /* Commit the embree changes */ if(rtc_outdated) { rtcCommit(scnview->rtc_scn); + scnview->rtc_commit = 1; /* Notify that the scene view was committed */ scnview->rtc_scn_update = 0; } @@ -791,7 +794,6 @@ scene_view_compute_volume return volume; } - static res_T scene_view_sync (struct s3d_scene_view* scnview, @@ -945,6 +947,7 @@ scene_view_release(ref_T* ref) f3_splat(scnview->lower, FLT_MAX); f3_splat(scnview->upper,-FLT_MAX); scnview->mask = 0; + scnview->rtc_commit = 0; /* Do not physically release the memory space of the scnview. Add it to the * available scnviews pool of the scene */ diff --git a/src/s3d_scene_view_c.h b/src/s3d_scene_view_c.h @@ -106,6 +106,7 @@ struct s3d_scene_view { int mask; /* Combination of enum s3d_scene_view_flag */ int rtc_scn_update; /* Define if Embree geometries were deleted/added */ + int rtc_commit; /* Define whether or not the Embree scene was committed */ RTCScene rtc_scn; /* Embree scene */ ref_T ref;