commit 4045400a30318df9e3a9514f46b6f643531b7bfc
parent cf6a33010b3d1acaebafd81863da9ad519d6b45b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 21 Oct 2019 22:28:41 +0200
Add minor comments to the scene view sync AABB part
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/s3d_scene_view.c b/src/s3d_scene_view.c
@@ -974,13 +974,16 @@ scene_view_sync
if(res != RES_OK) goto error;
}
- /* Compute the scene AABB is updated */
+ /* Compute the scene AABB if it is updated */
if(scnview->aabb_update) {
if((mask & S3D_TRACE) == 0) {
+ /* Compute from scratch */
f3_splat(scnview->lower, FLT_MAX);
f3_splat(scnview->upper,-FLT_MAX);
scene_view_compute_scene_aabb(scnview);
} else {
+ /* Retrieve the scene AABB from Embree since it was already computed to
+ * build the acceleration data structure */
struct RTCBounds bounds;
rtcGetSceneBounds(scnview->rtc_scn, &bounds);
scnview->lower[0] = bounds.lower_x;