From 6ee9213d04ad4179f5fb813d4877229becbb3941 Mon Sep 17 00:00:00 2001 From: Irlan <-> Date: Mon, 26 Mar 2018 18:16:34 -0300 Subject: [PATCH] bugfix --- include/bounce/common/math/vec3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bounce/common/math/vec3.h b/include/bounce/common/math/vec3.h index a29248e..25f380b 100644 --- a/include/bounce/common/math/vec3.h +++ b/include/bounce/common/math/vec3.h @@ -195,13 +195,13 @@ inline float32 b3DistanceSquared(const b3Vec3& a, const b3Vec3& b) // Compute the triangle area. inline float32 b3Area(const b3Vec3& a, const b3Vec3& b, const b3Vec3& c) { - return b3Length(b3Cross(b - a, c - a)); + return 0.5f * b3Length(b3Cross(b - a, c - a)); } // Compute the squared triangle area. inline float32 b3AreaSquared(const b3Vec3& a, const b3Vec3& b, const b3Vec3& c) { - return b3LengthSquared(b3Cross(b - a, c - a)); + return 0.25f * b3LengthSquared(b3Cross(b - a, c - a)); } // Compute the tetrahedron volume.