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

Updated builds.

上级 c4d09a26
......@@ -2347,14 +2347,14 @@ THREE.Box2.prototype = {
containsPoint: function ( point ) {
if ( ( this.min.x <= point.x ) && ( point.x <= this.max.x ) &&
( this.min.y <= point.y ) && ( point.y <= this.max.y ) ) {
if ( point.x < this.min.x || point.x > this.max.x ||
point.y < this.min.y || point.y > this.max.y ) {
return true;
return false;
}
return false;
return true;
},
......@@ -2387,10 +2387,8 @@ THREE.Box2.prototype = {
// using 6 splitting planes to rule out intersections.
if ( ( box.max.x < this.min.x ) ||
( box.min.x > this.max.x ) ||
( box.max.y < this.min.y ) ||
( box.min.y > this.max.y ) ) {
if ( box.max.x < this.min.x || box.min.x > this.max.x ||
box.max.y < this.min.y || box.min.y > this.max.y ) {
return false;
......@@ -2615,15 +2613,15 @@ THREE.Box3.prototype = {
containsPoint: function ( point ) {
if ( ( this.min.x <= point.x ) && ( point.x <= this.max.x ) &&
( this.min.y <= point.y ) && ( point.y <= this.max.y ) &&
( this.min.z <= point.z ) && ( point.z <= this.max.z ) ) {
if ( point.x < this.min.x || point.x > this.max.x ||
point.y < this.min.y || point.y > this.max.y ||
point.z < this.min.z || point.z > this.max.z ) {
return true;
return false;
}
return false;
return true;
},
......@@ -2658,9 +2656,9 @@ THREE.Box3.prototype = {
// using 6 splitting planes to rule out intersections.
if ( ( box.max.x < this.min.x ) || ( box.min.x > this.max.x ) ||
( box.max.y < this.min.y ) || ( box.min.y > this.max.y ) ||
( box.max.z < this.min.z ) || ( box.min.z > this.max.z ) ) {
if ( box.max.x < this.min.x || box.min.x > this.max.x ||
box.max.y < this.min.y || box.min.y > this.max.y ||
box.max.z < this.min.z || box.min.z > this.max.z ) {
return false;
......@@ -6446,19 +6444,16 @@ THREE.Projector = function() {
_vertex = getNextVertexInPool();
_vertex.positionWorld.copy( vertices[ v ] );
_vertex.positionWorld.applyMatrix4( _modelMatrix );
_vertex.positionScreen.copy( _vertex.positionWorld );
_vertex.positionScreen.applyMatrix4( _viewProjectionMatrix );
_vertex.positionWorld.copy( vertices[ v ] ).applyMatrix4( _modelMatrix );
_vertex.positionScreen.copy( _vertex.positionWorld ).applyMatrix4( _viewProjectionMatrix );
_vertex.positionScreen.x /= _vertex.positionScreen.w;
_vertex.positionScreen.y /= _vertex.positionScreen.w;
_vertex.positionScreen.z /= _vertex.positionScreen.w;
_vertex.visible = ! ( _vertex.positionScreen.x < -1 || _vertex.positionScreen.x > 1 ||
_vertex.positionScreen.y < -1 || _vertex.positionScreen.y > 1 ||
_vertex.positionScreen.z < -1 || _vertex.positionScreen.z > 1 );
_vertex.positionScreen.y < -1 || _vertex.positionScreen.y > 1 ||
_vertex.positionScreen.z < -1 || _vertex.positionScreen.z > 1 );
}
......@@ -6553,14 +6548,11 @@ THREE.Projector = function() {
}
_face.normalModel.applyMatrix3( _normalMatrix );
_face.normalModel.normalize();
_face.normalModel.applyMatrix3( _normalMatrix ).normalize();
_face.normalModelView.copy( _face.normalModel );
_face.normalModelView.applyMatrix3( _normalViewMatrix );
_face.normalModelView.copy( _face.normalModel ).applyMatrix3( _normalViewMatrix );
_face.centroidModel.copy( face.centroid );
_face.centroidModel.applyMatrix4( _modelMatrix );
_face.centroidModel.copy( face.centroid ).applyMatrix4( _modelMatrix );
faceVertexNormals = face.vertexNormals;
......@@ -6575,12 +6567,10 @@ THREE.Projector = function() {
}
normalModel.applyMatrix3( _normalMatrix );
normalModel.normalize();
normalModel.applyMatrix3( _normalMatrix ).normalize();
var normalModelView = _face.vertexNormalsModelView[ n ];
normalModelView.copy( normalModel );
normalModelView.applyMatrix3( _normalViewMatrix );
normalModelView.copy( normalModel ).applyMatrix3( _normalViewMatrix );
}
......@@ -6603,8 +6593,7 @@ THREE.Projector = function() {
_face.color = face.color;
_face.material = material;
_centroid.copy( _face.centroidModel )
_centroid.applyMatrix4( _viewProjectionMatrix );
_centroid.copy( _face.centroidModel ).applyMatrix4( _viewProjectionMatrix );
_face.z = _centroid.z;
......@@ -6619,8 +6608,7 @@ THREE.Projector = function() {
vertices = object.geometry.vertices;
v1 = getNextVertexInPool();
v1.positionScreen.copy( vertices[ 0 ] );
v1.positionScreen.applyMatrix4( _modelViewProjectionMatrix );
v1.positionScreen.copy( vertices[ 0 ] ).applyMatrix4( _modelViewProjectionMatrix );
// Handle LineStrip and LinePieces
var step = object.type === THREE.LinePieces ? 2 : 1;
......@@ -6628,8 +6616,7 @@ THREE.Projector = function() {
for ( v = 1, vl = vertices.length; v < vl; v ++ ) {
v1 = getNextVertexInPool();
v1.positionScreen.copy( vertices[ v ] );
v1.positionScreen.applyMatrix4( _modelViewProjectionMatrix );
v1.positionScreen.copy( vertices[ v ] ).applyMatrix4( _modelViewProjectionMatrix );
if ( ( v + 1 ) % step > 0 ) continue;
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册