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

Updated builds.

上级 6c038a83
......@@ -1062,12 +1062,14 @@ THREE.Quaternion.prototype = {
},
fromArray: function ( array ) {
fromArray: function ( array, offset ) {
this._x = array[ 0 ];
this._y = array[ 1 ];
this._z = array[ 2 ];
this._w = array[ 3 ];
if ( offset === undefined ) offset = 0;
this._x = array[ offset ];
this._y = array[ offset + 1 ];
this._z = array[ offset + 2 ];
this._w = array[ offset + 3 ];
this.onChangeCallback();
......@@ -1484,10 +1486,12 @@ THREE.Vector2.prototype = {
},
fromArray: function ( array ) {
fromArray: function ( array, offset ) {
this.x = array[ 0 ];
this.y = array[ 1 ];
if ( offset === undefined ) offset = 0;
this.x = array[ offset ];
this.y = array[ offset + 1 ];
return this;
......@@ -2295,11 +2299,13 @@ THREE.Vector3.prototype = {
},
fromArray: function ( array ) {
fromArray: function ( array, offset ) {
if ( offset === undefined ) offset = 0;
this.x = array[ 0 ];
this.y = array[ 1 ];
this.z = array[ 2 ];
this.x = array[ offset ];
this.y = array[ offset + 1 ];
this.z = array[ offset + 2 ];
return this;
......@@ -2944,12 +2950,14 @@ THREE.Vector4.prototype = {
},
fromArray: function ( array ) {
fromArray: function ( array, offset ) {
if ( offset === undefined ) offset = 0;
this.x = array[ 0 ];
this.y = array[ 1 ];
this.z = array[ 2 ];
this.w = array[ 3 ];
this.x = array[ offset ];
this.y = array[ offset + 1 ];
this.z = array[ offset + 2 ];
this.w = array[ offset + 3 ];
return this;
......@@ -8630,7 +8638,7 @@ THREE.BufferGeometry.prototype = {
var normals = attributes.normal.array;
var vA, vB, vC, x, y, z,
var vA, vB, vC,
pA = new THREE.Vector3(),
pB = new THREE.Vector3(),
......@@ -8659,20 +8667,9 @@ THREE.BufferGeometry.prototype = {
vB = ( index + indices[ i + 1 ] ) * 3;
vC = ( index + indices[ i + 2 ] ) * 3;
x = positions[ vA ];
y = positions[ vA + 1 ];
z = positions[ vA + 2 ];
pA.set( x, y, z );
x = positions[ vB ];
y = positions[ vB + 1 ];
z = positions[ vB + 2 ];
pB.set( x, y, z );
x = positions[ vC ];
y = positions[ vC + 1 ];
z = positions[ vC + 2 ];
pC.set( x, y, z );
pA.fromArray( positions, vA );
pB.fromArray( positions, vB );
pC.fromArray( positions, vC );
cb.subVectors( pC, pB );
ab.subVectors( pA, pB );
......@@ -8700,20 +8697,9 @@ THREE.BufferGeometry.prototype = {
for ( var i = 0, il = positions.length; i < il; i += 9 ) {
x = positions[ i ];
y = positions[ i + 1 ];
z = positions[ i + 2 ];
pA.set( x, y, z );
x = positions[ i + 3 ];
y = positions[ i + 4 ];
z = positions[ i + 5 ];
pB.set( x, y, z );
x = positions[ i + 6 ];
y = positions[ i + 7 ];
z = positions[ i + 8 ];
pC.set( x, y, z );
pA.fromArray( positions, i );
pB.fromArray( positions, i + 3 );
pC.fromArray( positions, i + 6 );
cb.subVectors( pC, pB );
ab.subVectors( pA, pB );
......@@ -8782,13 +8768,13 @@ THREE.BufferGeometry.prototype = {
}
var xA, yA, zA,
xB, yB, zB,
xC, yC, zC,
var vA = new THREE.Vector3(),
vB = new THREE.Vector3(),
vC = new THREE.Vector3(),
uA, vA,
uB, vB,
uC, vC,
uvA = new THREE.Vector2(),
uvB = new THREE.Vector2(),
uvC = new THREE.Vector2(),
x1, x2, y1, y2, z1, z2,
s1, s2, t1, t2, r;
......@@ -8797,41 +8783,28 @@ THREE.BufferGeometry.prototype = {
function handleTriangle( a, b, c ) {
xA = positions[ a * 3 ];
yA = positions[ a * 3 + 1 ];
zA = positions[ a * 3 + 2 ];
xB = positions[ b * 3 ];
yB = positions[ b * 3 + 1 ];
zB = positions[ b * 3 + 2 ];
xC = positions[ c * 3 ];
yC = positions[ c * 3 + 1 ];
zC = positions[ c * 3 + 2 ];
uA = uvs[ a * 2 ];
vA = uvs[ a * 2 + 1 ];
vA.fromArray( positions, a * 3 );
vB.fromArray( positions, b * 3 );
vC.fromArray( positions, c * 3 );
uB = uvs[ b * 2 ];
vB = uvs[ b * 2 + 1 ];
uvA.fromArray( uvs, a * 2 );
uvB.fromArray( uvs, b * 2 );
uvC.fromArray( uvs, c * 2 );
uC = uvs[ c * 2 ];
vC = uvs[ c * 2 + 1 ];
x1 = xB - xA;
x2 = xC - xA;
x1 = vB.x - vA.x;
x2 = vC.x - vA.x;
y1 = yB - yA;
y2 = yC - yA;
y1 = vB.y - vA.y;
y2 = vC.y - vA.y;
z1 = zB - zA;
z2 = zC - zA;
z1 = vB.z - vA.z;
z2 = vC.z - vA.z;
s1 = uB - uA;
s2 = uC - uA;
s1 = uvB.x - uvA.x;
s2 = uvC.x - uvA.x;
t1 = vB - vA;
t2 = vC - vA;
t1 = uvB.y - uvA.y;
t2 = uvC.y - uvA.y;
r = 1.0 / ( s1 * t2 - s2 * t1 );
......@@ -8893,10 +8866,7 @@ THREE.BufferGeometry.prototype = {
function handleVertex( v ) {
n.x = normals[ v * 3 ];
n.y = normals[ v * 3 + 1 ];
n.z = normals[ v * 3 + 2 ];
n.fromArray( normals, v * 3 );
n2.copy( n );
t = tan1[ v ];
......@@ -12281,10 +12251,15 @@ THREE.BufferGeometryLoader.prototype = {
if ( boundingSphere !== undefined ) {
geometry.boundingSphere = new THREE.Sphere(
new THREE.Vector3().fromArray( boundingSphere.center !== undefined ? boundingSphere.center : [ 0, 0, 0 ] ),
boundingSphere.radius
);
var center = new THREE.Vector3();
if ( boundingSphere.center !== undefined ) {
center.fromArray( boundingSphere.center );
}
geometry.boundingSphere = new THREE.Sphere( center, boundingSphere.radius );
}
......@@ -14459,11 +14434,7 @@ THREE.PointCloud.prototype.raycast = ( function () {
var a = index + indices[ i ];
position.set(
positions[ a * 3 ],
positions[ a * 3 + 1 ],
positions[ a * 3 + 2 ]
);
position.fromArray( positions, a * 3 );
testPoint( position, a );
......@@ -14765,22 +14736,9 @@ THREE.Mesh.prototype.raycast = ( function () {
b = index + indices[ i + 1 ];
c = index + indices[ i + 2 ];
vA.set(
positions[ a * 3 ],
positions[ a * 3 + 1 ],
positions[ a * 3 + 2 ]
);
vB.set(
positions[ b * 3 ],
positions[ b * 3 + 1 ],
positions[ b * 3 + 2 ]
);
vC.set(
positions[ c * 3 ],
positions[ c * 3 + 1 ],
positions[ c * 3 + 2 ]
);
vA.fromArray( positions, a * 3 );
vB.fromArray( positions, b * 3 );
vC.fromArray( positions, c * 3 );
if ( material.side === THREE.BackSide ) {
......@@ -14824,22 +14782,9 @@ THREE.Mesh.prototype.raycast = ( function () {
b = i + 1;
c = i + 2;
vA.set(
positions[ j ],
positions[ j + 1 ],
positions[ j + 2 ]
);
vB.set(
positions[ j + 3 ],
positions[ j + 4 ],
positions[ j + 5 ]
);
vC.set(
positions[ j + 6 ],
positions[ j + 7 ],
positions[ j + 8 ]
);
vA.fromArray( positions, j );
vB.fromArray( positions, j + 3 );
vC.fromArray( positions, j + 6 );
if ( material.side === THREE.BackSide ) {
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册