From 182f05f2f7a8f43f1589c9b8c15bf00d6e983676 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 6 Mar 2012 11:41:09 -0800 Subject: File IO --- 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 37044763..f084cf9f 100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js @@ -709,7 +709,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