Преглед изворни кода

octree support for boundingSphere with arbitrary center

collinhover пре 12 година
родитељ
комит
90d14f9839
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      examples/js/Octree.js

+ 3 - 3
examples/js/Octree.js

@@ -1,6 +1,6 @@
 /*!
  *
- * threeoctree.js (r59) / https://github.com/collinhover/threeoctree
+ * threeoctree.js (r60) / https://github.com/collinhover/threeoctree
  * (sparse) dynamic 3D spatial representation structure for fast searches.
  *
  * @author Collin Hover / http://collinhover.com/
@@ -681,15 +681,15 @@
 					}
 					
 					this.radius = this.object.geometry.boundingSphere.radius;
+					this.position.copy( this.object.geometry.boundingSphere.center ).applyMatrix4( this.object.matrixWorld );
 					
 				} else {
 					
 					this.radius = this.object.boundRadius;
+					this.position.getPositionFromMatrix( this.object.matrixWorld );
 					
 				}
 				
-				this.position.getPositionFromMatrix( this.object.matrixWorld );
-				
 			}
 			
 			this.radius = this.radius * Math.max( this.object.scale.x, this.object.scale.y, this.object.scale.z );