|
@@ -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 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 TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
var CullFaceNone = 0;
|
|
var CullFaceNone = 0;
|
|
@@ -2343,6 +2343,8 @@ Object.assign( Vector3.prototype, {
|
|
* @author tschw
|
|
* @author tschw
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+var _vector;
|
|
|
|
+
|
|
function Matrix3() {
|
|
function Matrix3() {
|
|
|
|
|
|
this.elements = [
|
|
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 ) {
|
|
multiply: function ( m ) {
|
|
|
|
|
|
@@ -4819,6 +4817,8 @@ Object.assign( Matrix4.prototype, {
|
|
* @author bhouston / http://clara.io
|
|
* @author bhouston / http://clara.io
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+var _matrix, _quaternion;
|
|
|
|
+
|
|
function Euler( x, y, z, order ) {
|
|
function Euler( x, y, z, order ) {
|
|
|
|
|
|
this._x = x || 0;
|
|
this._x = x || 0;
|
|
@@ -5063,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 ) {
|
|
setFromVector3: function ( v, order ) {
|
|
|
|
|
|
@@ -5083,21 +5079,17 @@ Object.assign( Euler.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- reorder: function () {
|
|
|
|
|
|
+ reorder: function ( newOrder ) {
|
|
|
|
|
|
// WARNING: this discards revolution information -bhouston
|
|
// WARNING: this discards revolution information -bhouston
|
|
|
|
|
|
- var q = new Quaternion();
|
|
|
|
|
|
+ if ( _quaternion === undefined ) _quaternion = new Quaternion();
|
|
|
|
|
|
- return function reorder( newOrder ) {
|
|
|
|
|
|
+ _quaternion.setFromEuler( this );
|
|
|
|
|
|
- q.setFromEuler( this );
|
|
|
|
|
|
+ return this.setFromQuaternion( _quaternion, newOrder );
|
|
|
|
|
|
- return this.setFromQuaternion( q, newOrder );
|
|
|
|
-
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- }(),
|
|
|
|
|
|
+ },
|
|
|
|
|
|
equals: function ( euler ) {
|
|
equals: function ( euler ) {
|
|
|
|
|
|
@@ -6801,6 +6793,8 @@ Object.assign( Box3.prototype, {
|
|
* @author mrdoob / http://mrdoob.com/
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+var _box;
|
|
|
|
+
|
|
function Sphere( center, radius ) {
|
|
function Sphere( center, radius ) {
|
|
|
|
|
|
this.center = ( center !== undefined ) ? center : new Vector3();
|
|
this.center = ( center !== undefined ) ? center : new Vector3();
|
|
@@ -6819,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 () {
|
|
clone: function () {
|
|
|
|
|
|
@@ -27841,7 +27831,7 @@ function PolyhedronBufferGeometry( vertices, indices, radius, detail ) {
|
|
|
|
|
|
// all vertices should lie on a conceptual sphere with a given radius
|
|
// all vertices should lie on a conceptual sphere with a given radius
|
|
|
|
|
|
- appplyRadius( radius );
|
|
|
|
|
|
+ applyRadius( radius );
|
|
|
|
|
|
// finally, create the uv data
|
|
// 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();
|
|
var vertex = new Vector3();
|
|
|
|
|
|
@@ -40132,7 +40122,13 @@ function createPath( char, scale, offsetX, offsetY, data ) {
|
|
|
|
|
|
var glyph = data.glyphs[ char ] || data.glyphs[ '?' ];
|
|
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();
|
|
var path = new ShapePath();
|
|
|
|
|
|
@@ -45152,6 +45148,8 @@ Object.assign( Box2.prototype, {
|
|
* @author bhouston / http://clara.io
|
|
* @author bhouston / http://clara.io
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+var _startP, _startEnd;
|
|
|
|
+
|
|
function Line3( start, end ) {
|
|
function Line3( start, end ) {
|
|
|
|
|
|
this.start = ( start !== undefined ) ? start : new Vector3();
|
|
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 ) {
|
|
closestPointToPoint: function ( point, clampToLine, target ) {
|
|
|
|
|