commit f53dee01af97e55b4db71be838f1dbe1a6e3c3d8
parent f3158b627ec22170aec3bce5b430aa84167f5a51
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sat, 28 Sep 2019 14:33:57 +0200
Fix the compute_volume function
It returns an error due to a null mask submitted to the s3d_scene_view
function.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/schiff_geometry.c b/src/schiff_geometry.c
@@ -327,7 +327,10 @@ compute_s3d_shape_volume
if(RES_OK != (res = s3d_scene_create(s3d, &scn))) goto error;
if(RES_OK != (res = s3d_scene_attach_shape(scn, shape))) goto error;
- if(RES_OK != (res = s3d_scene_view_create(scn, 0, &view))) goto error;
+ /* FIXME the scene view should not required a specific creation mask, but
+ * right now, Star-3D return an error if the mask is NULL. So the
+ * S3D_GET_PRIMITIVE to workaround this issue */
+ if(RES_OK != (res = s3d_scene_view_create(scn, S3D_GET_PRIMITIVE, &view))) goto error;
if(RES_OK != (res = s3d_scene_view_compute_volume(view, &volume))) goto error;
exit:
@@ -346,6 +349,7 @@ shape_release(struct shape* shape)
ASSERT(shape);
schiff_mesh_release(&shape->mesh);
if(shape->shape) S3D(shape_ref_put(shape->shape));
+ memset(shape, 0, sizeof(*shape));
}
static res_T