|
@@ -43,8 +43,8 @@ class SelectionBox {
|
|
|
this.startPoint = new Vector3();
|
|
|
this.endPoint = new Vector3();
|
|
|
this.collection = [];
|
|
|
+ this.instances = {};
|
|
|
this.deep = deep;
|
|
|
- this.instanceDetection = {};
|
|
|
|
|
|
}
|
|
|
|
|
@@ -175,39 +175,39 @@ class SelectionBox {
|
|
|
|
|
|
if ( object.isMesh || object.isLine || object.isPoints ) {
|
|
|
|
|
|
- if ( object instanceof InstancedMesh ) {
|
|
|
+ if ( object.isInstancedMesh ) {
|
|
|
|
|
|
- this.instanceDetection[ object.uuid ] = [];
|
|
|
+ this.instances[ object.uuid ] = [];
|
|
|
|
|
|
- for ( let instanceId = 0; instanceId < object.count; instanceId ++ ) {
|
|
|
+ for ( let instanceId = 0; instanceId < object.count; instanceId ++ ) {
|
|
|
|
|
|
- object.getMatrixAt( instanceId, _matrix );
|
|
|
- _matrix.decompose( _center, _quaternion, _scale );
|
|
|
+ object.getMatrixAt( instanceId, _matrix );
|
|
|
+ _matrix.decompose( _center, _quaternion, _scale );
|
|
|
|
|
|
- if ( frustum.containsPoint( _center ) ) {
|
|
|
-
|
|
|
- this.instanceDetection[ object.uuid ].push( instanceId );
|
|
|
+ if ( frustum.containsPoint( _center ) ) {
|
|
|
|
|
|
- }
|
|
|
+ this.instances[ object.uuid ].push( instanceId );
|
|
|
|
|
|
}
|
|
|
|
|
|
- } else {
|
|
|
+ }
|
|
|
|
|
|
- if ( object.geometry.boundingSphere === null ) object.geometry.computeBoundingSphere();
|
|
|
+ } else {
|
|
|
|
|
|
- _center.copy( object.geometry.boundingSphere.center );
|
|
|
+ if ( object.geometry.boundingSphere === null ) object.geometry.computeBoundingSphere();
|
|
|
|
|
|
- _center.applyMatrix4( object.matrixWorld );
|
|
|
+ _center.copy( object.geometry.boundingSphere.center );
|
|
|
|
|
|
- if ( frustum.containsPoint( _center ) ) {
|
|
|
+ _center.applyMatrix4( object.matrixWorld );
|
|
|
|
|
|
- this.collection.push( object );
|
|
|
+ if ( frustum.containsPoint( _center ) ) {
|
|
|
|
|
|
- }
|
|
|
+ this.collection.push( object );
|
|
|
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if ( object.children.length > 0 ) {
|