From e065244ac75d1d0f25fd5c75cb58e714a13fe16b Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 14 Mar 2012 08:59:17 -0700 Subject: Squashed commit of the following: merge master into timeline Signed-off-by: Jonathan Duran --- js/helper-classes/3D/math-utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/helper-classes/3D/math-utils.js') diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 562a6e73..2f0283a9 100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js @@ -729,7 +729,10 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { // the area of the polygon is the length of the normal var area = VecUtils.vecMag(3, normal ); if (this.fpSign(area) != 0) - vec3.scale(normal, 1.0/area); + { + //vec3.scale(normal, 1.0/area); + normal = VecUtils.vecNormalize(3, normal, 1.0); + } return normal; } -- cgit v1.2.3