Skip to content

Commit fdc1793

Browse files
committed
BufferGeometry.computeBoundingBox() / Box3.setFromArray() clean up.
1 parent bb52d29 commit fdc1793

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/core/BufferGeometry.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,13 +560,11 @@ THREE.BufferGeometry.prototype = {
560560

561561
var positions = this.attributes.position.array;
562562

563-
if ( positions ) {
563+
if ( positions !== undefined ) {
564564

565565
this.boundingBox.setFromArray( positions );
566566

567-
}
568-
569-
if ( positions === undefined || positions.length === 0 ) {
567+
} else {
570568

571569
this.boundingBox.makeEmpty();
572570

src/math/Box3.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ THREE.Box3.prototype = {
2525

2626
setFromArray: function ( array ) {
2727

28-
this.makeEmpty();
29-
3028
var minX = + Infinity;
3129
var minY = + Infinity;
3230
var minZ = + Infinity;
@@ -35,7 +33,7 @@ THREE.Box3.prototype = {
3533
var maxY = - Infinity;
3634
var maxZ = - Infinity;
3735

38-
for ( var i = 0, il = array.length; i < il; i += 3 ) {
36+
for ( var i = 0, l = array.length; i < l; i += 3 ) {
3937

4038
var x = array[ i ];
4139
var y = array[ i + 1 ];

0 commit comments

Comments
 (0)