commit f8781b3029bfaa90528775bc961cf1514d456b13
parent 162a68c8bffba4d13b5e803a7c6750f39b5114bb
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Mon, 11 May 2020 09:16:25 +0200
Fix a comment
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/s3d_mesh.c b/src/s3d_mesh.c
@@ -408,9 +408,10 @@ mesh_compute_volume(struct mesh* mesh, const char flip_surface)
ids = mesh_get_ids(mesh);
pos = mesh_get_pos(mesh);
- /* Build a tetrahedron whose face is the mesh triangle and its appex is the
- * origin. Then compute the volume of the tetrahedron and add or sub it from
- * the overall volume whether the normal point toward or backward the appex */
+ /* Build a tetrahedron whose base is the triangle and whose apex is the
+ * coordinate system's origin. Then compute the volume of the tetrahedron and
+ * add or sub it from the overall volume whether the normal point toward or
+ * backward the apex */
FOR_EACH(itri, 0, ntris) {
float E0[3], E1[3], N[3];
float B, h;
@@ -427,7 +428,7 @@ mesh_compute_volume(struct mesh* mesh, const char flip_surface)
f3_cross(N, E0, E1);
}
B = f3_normalize(N, N) * 0.5f; /* Base area */
- h = -f3_dot(N, v0); /* Height from the base to the appex */
+ h = -f3_dot(N, v0); /* Height from the base to the apex */
volume += (h*B);
}
return (float)(volume / 3.0);