提交 1bce53a6 编写于 作者: M Mr.doob

Octree: Removed dead code.

上级 43fd5f7c
......@@ -624,12 +624,6 @@
this.face3 = true;
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 ) {
this.vertices = part;
......@@ -660,11 +654,6 @@
this.radius = this.getFace3BoundingRadius( this.object, this.faces );
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 ) {
this.radius = this.object.material.size || 1;
......@@ -710,22 +699,6 @@
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;
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册