|
@@ -179,7 +179,7 @@ Object.assign( EventDispatcher.prototype, {
|
|
|
|
|
|
} );
|
|
|
|
|
|
-var REVISION = '107dev';
|
|
|
+var REVISION = '107';
|
|
|
var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
|
var TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
|
var CullFaceNone = 0;
|
|
@@ -2343,6 +2343,8 @@ Object.assign( Vector3.prototype, {
|
|
|
* @author tschw
|
|
|
*/
|
|
|
|
|
|
+var _vector;
|
|
|
+
|
|
|
function Matrix3() {
|
|
|
|
|
|
this.elements = [
|
|
@@ -2426,29 +2428,25 @@ Object.assign( Matrix3.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- applyToBufferAttribute: function () {
|
|
|
-
|
|
|
- var v1 = new Vector3();
|
|
|
-
|
|
|
- return function applyToBufferAttribute( attribute ) {
|
|
|
+ applyToBufferAttribute: function ( attribute ) {
|
|
|
|
|
|
- for ( var i = 0, l = attribute.count; i < l; i ++ ) {
|
|
|
+ if ( _vector === undefined ) _vector = new Vector3();
|
|
|
|
|
|
- v1.x = attribute.getX( i );
|
|
|
- v1.y = attribute.getY( i );
|
|
|
- v1.z = attribute.getZ( i );
|
|
|
+ for ( var i = 0, l = attribute.count; i < l; i ++ ) {
|
|
|
|
|
|
- v1.applyMatrix3( this );
|
|
|
+ _vector.x = attribute.getX( i );
|
|
|
+ _vector.y = attribute.getY( i );
|
|
|
+ _vector.z = attribute.getZ( i );
|
|
|
|
|
|
- attribute.setXYZ( i, v1.x, v1.y, v1.z );
|
|
|
+ _vector.applyMatrix3( this );
|
|
|
|
|
|
- }
|
|
|
+ attribute.setXYZ( i, _vector.x, _vector.y, _vector.z );
|
|
|
|
|
|
- return attribute;
|
|
|
+ }
|
|
|
|
|
|
- };
|
|
|
+ return attribute;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
multiply: function ( m ) {
|
|
|
|
|
@@ -3565,27 +3563,16 @@ Object.assign( Vector4.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- clampScalar: function () {
|
|
|
-
|
|
|
- var min, max;
|
|
|
-
|
|
|
- return function clampScalar( minVal, maxVal ) {
|
|
|
-
|
|
|
- if ( min === undefined ) {
|
|
|
-
|
|
|
- min = new Vector4();
|
|
|
- max = new Vector4();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- min.set( minVal, minVal, minVal, minVal );
|
|
|
- max.set( maxVal, maxVal, maxVal, maxVal );
|
|
|
+ clampScalar: function ( minVal, maxVal ) {
|
|
|
|
|
|
- return this.clamp( min, max );
|
|
|
+ this.x = Math.max( minVal, Math.min( maxVal, this.x ) );
|
|
|
+ this.y = Math.max( minVal, Math.min( maxVal, this.y ) );
|
|
|
+ this.z = Math.max( minVal, Math.min( maxVal, this.z ) );
|
|
|
+ this.w = Math.max( minVal, Math.min( maxVal, this.w ) );
|
|
|
|
|
|
- };
|
|
|
+ return this;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
clampLength: function ( min, max ) {
|
|
|
|
|
@@ -4830,6 +4817,8 @@ Object.assign( Matrix4.prototype, {
|
|
|
* @author bhouston / http://clara.io
|
|
|
*/
|
|
|
|
|
|
+var _matrix, _quaternion;
|
|
|
+
|
|
|
function Euler( x, y, z, order ) {
|
|
|
|
|
|
this._x = x || 0;
|
|
@@ -5074,19 +5063,15 @@ Object.assign( Euler.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- setFromQuaternion: function () {
|
|
|
+ setFromQuaternion: function ( q, order, update ) {
|
|
|
|
|
|
- var matrix = new Matrix4();
|
|
|
-
|
|
|
- return function setFromQuaternion( q, order, update ) {
|
|
|
+ if ( _matrix === undefined ) _matrix = new Matrix4();
|
|
|
|
|
|
- matrix.makeRotationFromQuaternion( q );
|
|
|
+ _matrix.makeRotationFromQuaternion( q );
|
|
|
|
|
|
- return this.setFromRotationMatrix( matrix, order, update );
|
|
|
+ return this.setFromRotationMatrix( _matrix, order, update );
|
|
|
|
|
|
- };
|
|
|
-
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
setFromVector3: function ( v, order ) {
|
|
|
|
|
@@ -5094,21 +5079,17 @@ Object.assign( Euler.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- reorder: function () {
|
|
|
+ reorder: function ( newOrder ) {
|
|
|
|
|
|
// WARNING: this discards revolution information -bhouston
|
|
|
|
|
|
- var q = new Quaternion();
|
|
|
-
|
|
|
- return function reorder( newOrder ) {
|
|
|
+ if ( _quaternion === undefined ) _quaternion = new Quaternion();
|
|
|
|
|
|
- q.setFromEuler( this );
|
|
|
+ _quaternion.setFromEuler( this );
|
|
|
|
|
|
- return this.setFromQuaternion( q, newOrder );
|
|
|
+ return this.setFromQuaternion( _quaternion, newOrder );
|
|
|
|
|
|
- };
|
|
|
-
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
equals: function ( euler ) {
|
|
|
|
|
@@ -6812,6 +6793,8 @@ Object.assign( Box3.prototype, {
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
*/
|
|
|
|
|
|
+var _box;
|
|
|
+
|
|
|
function Sphere( center, radius ) {
|
|
|
|
|
|
this.center = ( center !== undefined ) ? center : new Vector3();
|
|
@@ -6830,39 +6813,35 @@ Object.assign( Sphere.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- setFromPoints: function () {
|
|
|
-
|
|
|
- var box = new Box3();
|
|
|
-
|
|
|
- return function setFromPoints( points, optionalCenter ) {
|
|
|
+ setFromPoints: function ( points, optionalCenter ) {
|
|
|
|
|
|
- var center = this.center;
|
|
|
+ if ( _box === undefined ) _box = new Box3();
|
|
|
|
|
|
- if ( optionalCenter !== undefined ) {
|
|
|
+ var center = this.center;
|
|
|
|
|
|
- center.copy( optionalCenter );
|
|
|
+ if ( optionalCenter !== undefined ) {
|
|
|
|
|
|
- } else {
|
|
|
+ center.copy( optionalCenter );
|
|
|
|
|
|
- box.setFromPoints( points ).getCenter( center );
|
|
|
+ } else {
|
|
|
|
|
|
- }
|
|
|
+ _box.setFromPoints( points ).getCenter( center );
|
|
|
|
|
|
- var maxRadiusSq = 0;
|
|
|
+ }
|
|
|
|
|
|
- for ( var i = 0, il = points.length; i < il; i ++ ) {
|
|
|
+ var maxRadiusSq = 0;
|
|
|
|
|
|
- maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );
|
|
|
+ for ( var i = 0, il = points.length; i < il; i ++ ) {
|
|
|
|
|
|
- }
|
|
|
+ maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );
|
|
|
|
|
|
- this.radius = Math.sqrt( maxRadiusSq );
|
|
|
+ }
|
|
|
|
|
|
- return this;
|
|
|
+ this.radius = Math.sqrt( maxRadiusSq );
|
|
|
|
|
|
- };
|
|
|
+ return this;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
clone: function () {
|
|
|
|
|
@@ -11195,7 +11174,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, uv, a, b, c ) {
|
|
|
+ function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, uv, uv2, a, b, c ) {
|
|
|
|
|
|
vA.fromBufferAttribute( position, a );
|
|
|
vB.fromBufferAttribute( position, b );
|
|
@@ -11246,6 +11225,16 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if ( uv2 ) {
|
|
|
+
|
|
|
+ uvA.fromBufferAttribute( uv2, a );
|
|
|
+ uvB.fromBufferAttribute( uv2, b );
|
|
|
+ uvC.fromBufferAttribute( uv2, c );
|
|
|
+
|
|
|
+ intersection.uv2 = Triangle.getUV( intersectionPoint, vA, vB, vC, uvA, uvB, uvC, new Vector2() );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
var face = new Face3( a, b, c );
|
|
|
Triangle.getNormal( vA, vB, vC, face.normal );
|
|
|
|
|
@@ -11296,6 +11285,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
var position = geometry.attributes.position;
|
|
|
var morphPosition = geometry.morphAttributes.position;
|
|
|
var uv = geometry.attributes.uv;
|
|
|
+ var uv2 = geometry.attributes.uv2;
|
|
|
var groups = geometry.groups;
|
|
|
var drawRange = geometry.drawRange;
|
|
|
var i, j, il, jl;
|
|
@@ -11322,7 +11312,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = index.getX( j + 1 );
|
|
|
c = index.getX( j + 2 );
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|
|
@@ -11347,7 +11337,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = index.getX( i + 1 );
|
|
|
c = index.getX( i + 2 );
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|
|
@@ -11380,7 +11370,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = j + 1;
|
|
|
c = j + 2;
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|
|
@@ -11405,7 +11395,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = i + 1;
|
|
|
c = i + 2;
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|
|
@@ -27841,7 +27831,7 @@ function PolyhedronBufferGeometry( vertices, indices, radius, detail ) {
|
|
|
|
|
|
// all vertices should lie on a conceptual sphere with a given radius
|
|
|
|
|
|
- appplyRadius( radius );
|
|
|
+ applyRadius( radius );
|
|
|
|
|
|
// finally, create the uv data
|
|
|
|
|
@@ -27954,7 +27944,7 @@ function PolyhedronBufferGeometry( vertices, indices, radius, detail ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function appplyRadius( radius ) {
|
|
|
+ function applyRadius( radius ) {
|
|
|
|
|
|
var vertex = new Vector3();
|
|
|
|
|
@@ -40132,7 +40122,13 @@ function createPath( char, scale, offsetX, offsetY, data ) {
|
|
|
|
|
|
var glyph = data.glyphs[ char ] || data.glyphs[ '?' ];
|
|
|
|
|
|
- if ( ! glyph ) return;
|
|
|
+ if ( ! glyph ) {
|
|
|
+
|
|
|
+ console.error( 'THREE.Font: character "' + char + '" does not exists in font family ' + data.familyName + '.' );
|
|
|
+
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
var path = new ShapePath();
|
|
|
|
|
@@ -45152,6 +45148,8 @@ Object.assign( Box2.prototype, {
|
|
|
* @author bhouston / http://clara.io
|
|
|
*/
|
|
|
|
|
|
+var _startP, _startEnd;
|
|
|
+
|
|
|
function Line3( start, end ) {
|
|
|
|
|
|
this.start = ( start !== undefined ) ? start : new Vector3();
|
|
@@ -45236,32 +45234,32 @@ Object.assign( Line3.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- closestPointToPointParameter: function () {
|
|
|
+ closestPointToPointParameter: function ( point, clampToLine ) {
|
|
|
|
|
|
- var startP = new Vector3();
|
|
|
- var startEnd = new Vector3();
|
|
|
+ if ( _startP === undefined ) {
|
|
|
|
|
|
- return function closestPointToPointParameter( point, clampToLine ) {
|
|
|
+ _startP = new Vector3();
|
|
|
+ _startEnd = new Vector3();
|
|
|
|
|
|
- startP.subVectors( point, this.start );
|
|
|
- startEnd.subVectors( this.end, this.start );
|
|
|
+ }
|
|
|
|
|
|
- var startEnd2 = startEnd.dot( startEnd );
|
|
|
- var startEnd_startP = startEnd.dot( startP );
|
|
|
+ _startP.subVectors( point, this.start );
|
|
|
+ _startEnd.subVectors( this.end, this.start );
|
|
|
|
|
|
- var t = startEnd_startP / startEnd2;
|
|
|
+ var startEnd2 = _startEnd.dot( _startEnd );
|
|
|
+ var startEnd_startP = _startEnd.dot( _startP );
|
|
|
|
|
|
- if ( clampToLine ) {
|
|
|
+ var t = startEnd_startP / startEnd2;
|
|
|
|
|
|
- t = _Math.clamp( t, 0, 1 );
|
|
|
+ if ( clampToLine ) {
|
|
|
|
|
|
- }
|
|
|
+ t = _Math.clamp( t, 0, 1 );
|
|
|
|
|
|
- return t;
|
|
|
+ }
|
|
|
|
|
|
- };
|
|
|
+ return t;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
closestPointToPoint: function ( point, clampToLine, target ) {
|
|
|
|