|
@@ -624,12 +624,6 @@
|
|
this.face3 = true;
|
|
this.face3 = true;
|
|
this.utilVec31FaceBounds = new THREE.Vector3();
|
|
this.utilVec31FaceBounds = new THREE.Vector3();
|
|
|
|
|
|
- } else if ( part instanceof THREE.Face4 ) {
|
|
|
|
-
|
|
|
|
- this.face4 = true;
|
|
|
|
- this.faces = part;
|
|
|
|
- this.utilVec31FaceBounds = new THREE.Vector3();
|
|
|
|
-
|
|
|
|
} else if ( part instanceof THREE.Vector3 ) {
|
|
} else if ( part instanceof THREE.Vector3 ) {
|
|
|
|
|
|
this.vertices = part;
|
|
this.vertices = part;
|
|
@@ -660,11 +654,6 @@
|
|
this.radius = this.getFace3BoundingRadius( this.object, this.faces );
|
|
this.radius = this.getFace3BoundingRadius( this.object, this.faces );
|
|
this.position.copy( this.faces.centroid ).applyMatrix4( this.object.matrixWorld );
|
|
this.position.copy( this.faces.centroid ).applyMatrix4( this.object.matrixWorld );
|
|
|
|
|
|
- } else if ( this.face4 ) {
|
|
|
|
-
|
|
|
|
- this.radius = this.getFace4BoundingRadius( this.object, this.faces );
|
|
|
|
- this.position.copy( this.faces.centroid ).applyMatrix4( this.object.matrixWorld );
|
|
|
|
-
|
|
|
|
} else if ( this.vertices ) {
|
|
} else if ( this.vertices ) {
|
|
|
|
|
|
this.radius = this.object.material.size || 1;
|
|
this.radius = this.object.material.size || 1;
|
|
@@ -710,22 +699,6 @@
|
|
|
|
|
|
return radius;
|
|
return radius;
|
|
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- getFace4BoundingRadius: function ( object, face ) {
|
|
|
|
-
|
|
|
|
- var geometry = object.geometry || object,
|
|
|
|
- vertices = geometry.vertices,
|
|
|
|
- centroid = face.centroid,
|
|
|
|
- va = vertices[ face.a ], vb = vertices[ face.b ], vc = vertices[ face.c ], vd = vertices[ face.d ],
|
|
|
|
- centroidToVert = this.utilVec31FaceBounds,
|
|
|
|
- radius;
|
|
|
|
-
|
|
|
|
- centroid.addVectors( va, vb ).add( vc ).add( vd ).divideScalar( 4 );
|
|
|
|
- radius = Math.max( centroidToVert.subVectors( centroid, va ).length(), centroidToVert.subVectors( centroid, vb ).length(), centroidToVert.subVectors( centroid, vc ).length(), centroidToVert.subVectors( centroid, vd ).length() );
|
|
|
|
-
|
|
|
|
- return radius;
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
};
|
|
};
|