Browse Source

Brought back automatic centroid computation.

Mr.doob 14 years ago
parent
commit
11461f0b5d
2 changed files with 10 additions and 9 deletions
  1. 2 1
      src/extras/io/JSONLoader.js
  2. 8 8
      src/extras/io/SceneLoader.js

+ 2 - 1
src/extras/io/JSONLoader.js

@@ -56,8 +56,9 @@ THREE.JSONLoader.prototype.createModel = function ( json, callback, texture_path
 	parseMorphing( scale );
 	parseEdges();
 
+	geometry.computeCentroids();
 	geometry.computeFaceNormals();
-	// geometry.computeCentroids();
+
 	// geometry.computeEdgeFaces();
 
 	function parseModel( scale ) {

+ 8 - 8
src/extras/io/SceneLoader.js

@@ -7,7 +7,7 @@ THREE.SceneLoader = function () {
 	this.onLoadStart = function () {};
 	this.onLoadProgress = function() {};
 	this.onLoadComplete = function () {};
-		
+
 	this.callbackSync = function () {};
 	this.callbackProgress = function () {};
 
@@ -60,24 +60,24 @@ THREE.SceneLoader.prototype = {
 			};
 
 			// find out if there are some colliders
-			
+
 			var hasColliders = false;
-			
+
 			for( dd in data.objects ) {
-				
+
 				o = data.objects[ dd ];
 
 				if ( o.meshCollider )  {
-					
+
 					hasColliders = true;
 					break;
 
 				}
-				
+
 			}
-			
+
 			if ( hasColliders ) {
-			
+
 				result.scene.collisions = new THREE.CollisionSystem();
 
 			}