Преглед на файлове

Resolves #448 by extracting the accumulated scale factors directly from .matrixWorld

avinoamr преди 13 години
родител
ревизия
745e766a2e
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      src/core/Frustum.js

+ 2 - 1
src/core/Frustum.js

@@ -44,7 +44,8 @@ THREE.Frustum.prototype.contains = function ( object ) {
 	var distance,
 	planes = this.planes,
 	matrix = object.matrixWorld,
-	radius = - object.geometry.boundingSphere.radius * Math.max( object.scale.x, Math.max( object.scale.y, object.scale.z ) );
+	scale = new THREE.Vector3( matrix.getColumnX().length(), matrix.getColumnY().length(), matrix.getColumnZ().length() ),
+	radius = - object.geometry.boundingSphere.radius * Math.max( scale.x, Math.max( scale.y, scale.z ) );
 
 	for ( var i = 0; i < 6; i ++ ) {