|
@@ -832,7 +832,7 @@ Object.assign( Vector2.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- lengthManhattan: function () {
|
|
|
|
|
|
+ manhattanLength: function () {
|
|
|
|
|
|
return Math.abs( this.x ) + Math.abs( this.y );
|
|
return Math.abs( this.x ) + Math.abs( this.y );
|
|
|
|
|
|
@@ -869,7 +869,7 @@ Object.assign( Vector2.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- distanceToManhattan: function ( v ) {
|
|
|
|
|
|
+ manhattanDistanceTo: function ( v ) {
|
|
|
|
|
|
return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );
|
|
return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );
|
|
|
|
|
|
@@ -2978,7 +2978,7 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- lengthManhattan: function () {
|
|
|
|
|
|
+ manhattanLength: function () {
|
|
|
|
|
|
return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );
|
|
return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );
|
|
|
|
|
|
@@ -3105,7 +3105,7 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- distanceToManhattan: function ( v ) {
|
|
|
|
|
|
+ manhattanDistanceTo: function ( v ) {
|
|
|
|
|
|
return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );
|
|
return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );
|
|
|
|
|
|
@@ -4452,7 +4452,7 @@ Object.assign( Vector4.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- lengthManhattan: function () {
|
|
|
|
|
|
+ manhattanLength: function () {
|
|
|
|
|
|
return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );
|
|
return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );
|
|
|
|
|
|
@@ -12156,6 +12156,21 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ setFromPoints: function ( points ) {
|
|
|
|
+
|
|
|
|
+ this.vertices = [];
|
|
|
|
+
|
|
|
|
+ for ( var i = 0, l = points.length; i < l; i ++ ) {
|
|
|
|
+
|
|
|
|
+ var point = points[ i ];
|
|
|
|
+ this.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
sortFacesByMaterialIndex: function () {
|
|
sortFacesByMaterialIndex: function () {
|
|
|
|
|
|
var faces = this.faces;
|
|
var faces = this.faces;
|
|
@@ -13698,6 +13713,23 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ setFromPoints: function ( points ) {
|
|
|
|
+
|
|
|
|
+ var position = [];
|
|
|
|
+
|
|
|
|
+ for ( var i = 0, l = points.length; i < l; i ++ ) {
|
|
|
|
+
|
|
|
|
+ var point = points[ i ];
|
|
|
|
+ position.push( point.x, point.y, point.z || 0 );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.addAttribute( 'position', new Float32BufferAttribute( position, 3 ) );
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
updateFromObject: function ( object ) {
|
|
updateFromObject: function ( object ) {
|
|
|
|
|
|
var geometry = object.geometry;
|
|
var geometry = object.geometry;
|
|
@@ -14513,6 +14545,10 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments,
|
|
|
|
|
|
var scope = this;
|
|
var scope = this;
|
|
|
|
|
|
|
|
+ width = width || 1;
|
|
|
|
+ height = height || 1;
|
|
|
|
+ depth = depth || 1;
|
|
|
|
+
|
|
// segments
|
|
// segments
|
|
|
|
|
|
widthSegments = Math.floor( widthSegments ) || 1;
|
|
widthSegments = Math.floor( widthSegments ) || 1;
|
|
@@ -14699,6 +14735,9 @@ function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) {
|
|
heightSegments: heightSegments
|
|
heightSegments: heightSegments
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ width = width || 1;
|
|
|
|
+ height = height || 1;
|
|
|
|
+
|
|
var width_half = width / 2;
|
|
var width_half = width / 2;
|
|
var height_half = height / 2;
|
|
var height_half = height / 2;
|
|
|
|
|
|
@@ -24428,7 +24467,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
|
|
|
|
|
|
var sw = this.geometry.skinWeights[ i ];
|
|
var sw = this.geometry.skinWeights[ i ];
|
|
|
|
|
|
- scale = 1.0 / sw.lengthManhattan();
|
|
|
|
|
|
+ scale = 1.0 / sw.manhattanLength();
|
|
|
|
|
|
if ( scale !== Infinity ) {
|
|
if ( scale !== Infinity ) {
|
|
|
|
|
|
@@ -24455,7 +24494,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
|
|
vec.z = skinWeight.getZ( i );
|
|
vec.z = skinWeight.getZ( i );
|
|
vec.w = skinWeight.getW( i );
|
|
vec.w = skinWeight.getW( i );
|
|
|
|
|
|
- scale = 1.0 / vec.lengthManhattan();
|
|
|
|
|
|
+ scale = 1.0 / vec.manhattanLength();
|
|
|
|
|
|
if ( scale !== Infinity ) {
|
|
if ( scale !== Infinity ) {
|
|
|
|
|
|
@@ -26251,8 +26290,8 @@ function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments,
|
|
q: q
|
|
q: q
|
|
};
|
|
};
|
|
|
|
|
|
- radius = radius || 100;
|
|
|
|
- tube = tube || 40;
|
|
|
|
|
|
+ radius = radius || 1;
|
|
|
|
+ tube = tube || 0.4;
|
|
tubularSegments = Math.floor( tubularSegments ) || 64;
|
|
tubularSegments = Math.floor( tubularSegments ) || 64;
|
|
radialSegments = Math.floor( radialSegments ) || 8;
|
|
radialSegments = Math.floor( radialSegments ) || 8;
|
|
p = p || 2;
|
|
p = p || 2;
|
|
@@ -26433,8 +26472,8 @@ function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc
|
|
arc: arc
|
|
arc: arc
|
|
};
|
|
};
|
|
|
|
|
|
- radius = radius || 100;
|
|
|
|
- tube = tube || 40;
|
|
|
|
|
|
+ radius = radius || 1;
|
|
|
|
+ tube = tube || 0.4;
|
|
radialSegments = Math.floor( radialSegments ) || 8;
|
|
radialSegments = Math.floor( radialSegments ) || 8;
|
|
tubularSegments = Math.floor( tubularSegments ) || 6;
|
|
tubularSegments = Math.floor( tubularSegments ) || 6;
|
|
arc = arc || Math.PI * 2;
|
|
arc = arc || Math.PI * 2;
|
|
@@ -28145,7 +28184,7 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
|
|
thetaLength: thetaLength
|
|
thetaLength: thetaLength
|
|
};
|
|
};
|
|
|
|
|
|
- radius = radius || 50;
|
|
|
|
|
|
+ radius = radius || 1;
|
|
|
|
|
|
widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 );
|
|
widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 );
|
|
heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 );
|
|
heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 );
|
|
@@ -28287,8 +28326,8 @@ function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegment
|
|
thetaLength: thetaLength
|
|
thetaLength: thetaLength
|
|
};
|
|
};
|
|
|
|
|
|
- innerRadius = innerRadius || 20;
|
|
|
|
- outerRadius = outerRadius || 50;
|
|
|
|
|
|
+ innerRadius = innerRadius || 0.5;
|
|
|
|
+ outerRadius = outerRadius || 1;
|
|
|
|
|
|
thetaStart = thetaStart !== undefined ? thetaStart : 0;
|
|
thetaStart = thetaStart !== undefined ? thetaStart : 0;
|
|
thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;
|
|
thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;
|
|
@@ -28890,9 +28929,9 @@ function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments
|
|
|
|
|
|
var scope = this;
|
|
var scope = this;
|
|
|
|
|
|
- radiusTop = radiusTop !== undefined ? radiusTop : 20;
|
|
|
|
- radiusBottom = radiusBottom !== undefined ? radiusBottom : 20;
|
|
|
|
- height = height !== undefined ? height : 100;
|
|
|
|
|
|
+ radiusTop = radiusTop !== undefined ? radiusTop : 1;
|
|
|
|
+ radiusBottom = radiusBottom !== undefined ? radiusBottom : 1;
|
|
|
|
+ height = height || 1;
|
|
|
|
|
|
radialSegments = Math.floor( radialSegments ) || 8;
|
|
radialSegments = Math.floor( radialSegments ) || 8;
|
|
heightSegments = Math.floor( heightSegments ) || 1;
|
|
heightSegments = Math.floor( heightSegments ) || 1;
|
|
@@ -29239,7 +29278,7 @@ function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) {
|
|
thetaLength: thetaLength
|
|
thetaLength: thetaLength
|
|
};
|
|
};
|
|
|
|
|
|
- radius = radius || 50;
|
|
|
|
|
|
+ radius = radius || 1;
|
|
segments = segments !== undefined ? Math.max( 3, segments ) : 8;
|
|
segments = segments !== undefined ? Math.max( 3, segments ) : 8;
|
|
|
|
|
|
thetaStart = thetaStart !== undefined ? thetaStart : 0;
|
|
thetaStart = thetaStart !== undefined ? thetaStart : 0;
|
|
@@ -30213,6 +30252,8 @@ var DefaultLoadingManager = new LoadingManager();
|
|
* @author mrdoob / http://mrdoob.com/
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+var loading = {};
|
|
|
|
+
|
|
function FileLoader( manager ) {
|
|
function FileLoader( manager ) {
|
|
|
|
|
|
this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
|
|
this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
|
|
@@ -30247,6 +30288,20 @@ Object.assign( FileLoader.prototype, {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Check if request is duplicate
|
|
|
|
+
|
|
|
|
+ if ( loading[ url ] !== undefined ) {
|
|
|
|
+
|
|
|
|
+ loading[ url ].push( function () {
|
|
|
|
+
|
|
|
|
+ scope.load( url, onLoad, onProgress, onError );
|
|
|
|
+
|
|
|
|
+ } );
|
|
|
|
+
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
// Check for data: URI
|
|
// Check for data: URI
|
|
var dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;
|
|
var dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;
|
|
var dataUriRegexResult = url.match( dataUriRegex );
|
|
var dataUriRegexResult = url.match( dataUriRegex );
|
|
@@ -30338,7 +30393,12 @@ Object.assign( FileLoader.prototype, {
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
+ // Initialise array for duplicate requests
|
|
|
|
+
|
|
|
|
+ loading[ url ] = [];
|
|
|
|
+
|
|
var request = new XMLHttpRequest();
|
|
var request = new XMLHttpRequest();
|
|
|
|
+
|
|
request.open( 'GET', url, true );
|
|
request.open( 'GET', url, true );
|
|
|
|
|
|
request.addEventListener( 'load', function ( event ) {
|
|
request.addEventListener( 'load', function ( event ) {
|
|
@@ -30373,6 +30433,18 @@ Object.assign( FileLoader.prototype, {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Clean up duplicate requests.
|
|
|
|
+
|
|
|
|
+ var callbacks = loading[ url ];
|
|
|
|
+
|
|
|
|
+ for ( var i = 0; i < callbacks.length; i ++ ) {
|
|
|
|
+
|
|
|
|
+ callbacks[ i ]( response );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ delete loading[ url ];
|
|
|
|
+
|
|
}, false );
|
|
}, false );
|
|
|
|
|
|
if ( onProgress !== undefined ) {
|
|
if ( onProgress !== undefined ) {
|
|
@@ -35721,43 +35793,6 @@ CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), {
|
|
|
|
|
|
return points;
|
|
return points;
|
|
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**************************************************************
|
|
|
|
- * Create Geometries Helpers
|
|
|
|
- **************************************************************/
|
|
|
|
-
|
|
|
|
- /// Generate geometry from path points (for Line or Points objects)
|
|
|
|
-
|
|
|
|
- createPointsGeometry: function ( divisions ) {
|
|
|
|
-
|
|
|
|
- var pts = this.getPoints( divisions );
|
|
|
|
- return this.createGeometry( pts );
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // Generate geometry from equidistant sampling along the path
|
|
|
|
-
|
|
|
|
- createSpacedPointsGeometry: function ( divisions ) {
|
|
|
|
-
|
|
|
|
- var pts = this.getSpacedPoints( divisions );
|
|
|
|
- return this.createGeometry( pts );
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- createGeometry: function ( points ) {
|
|
|
|
-
|
|
|
|
- var geometry = new Geometry();
|
|
|
|
-
|
|
|
|
- for ( var i = 0, l = points.length; i < l; i ++ ) {
|
|
|
|
-
|
|
|
|
- var point = points[ i ];
|
|
|
|
- geometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return geometry;
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
} );
|
|
} );
|
|
@@ -42893,6 +42928,51 @@ Curve.create = function ( construct, getPoint ) {
|
|
|
|
|
|
//
|
|
//
|
|
|
|
|
|
|
|
+Object.assign( CurvePath.prototype, {
|
|
|
|
+
|
|
|
|
+ createPointsGeometry: function ( divisions ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.' );
|
|
|
|
+
|
|
|
|
+ // generate geometry from path points (for Line or Points objects)
|
|
|
|
+
|
|
|
|
+ var pts = this.getPoints( divisions );
|
|
|
|
+ return this.createGeometry( pts );
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ createSpacedPointsGeometry: function ( divisions ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.' );
|
|
|
|
+
|
|
|
|
+ // generate geometry from equidistant sampling along the path
|
|
|
|
+
|
|
|
|
+ var pts = this.getSpacedPoints( divisions );
|
|
|
|
+ return this.createGeometry( pts );
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ createGeometry: function ( points ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.' );
|
|
|
|
+
|
|
|
|
+ var geometry = new Geometry();
|
|
|
|
+
|
|
|
|
+ for ( var i = 0, l = points.length; i < l; i ++ ) {
|
|
|
|
+
|
|
|
|
+ var point = points[ i ];
|
|
|
|
+ geometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return geometry;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+} );
|
|
|
|
+
|
|
|
|
+//
|
|
|
|
+
|
|
function ClosedSplineCurve3( points ) {
|
|
function ClosedSplineCurve3( points ) {
|
|
|
|
|
|
console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' );
|
|
console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' );
|
|
@@ -43308,9 +43388,21 @@ Object.assign( Vector2.prototype, {
|
|
|
|
|
|
fromAttribute: function ( attribute, index, offset ) {
|
|
fromAttribute: function ( attribute, index, offset ) {
|
|
|
|
|
|
- console.error( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' );
|
|
|
|
|
|
+ console.warn( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' );
|
|
return this.fromBufferAttribute( attribute, index, offset );
|
|
return this.fromBufferAttribute( attribute, index, offset );
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ distanceToManhattan: function ( v ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
|
|
|
|
+ return this.manhattanDistanceTo( v );
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ lengthManhattan: function () {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().' );
|
|
|
|
+ return this.manhattanLength();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
} );
|
|
} );
|
|
@@ -43353,9 +43445,21 @@ Object.assign( Vector3.prototype, {
|
|
},
|
|
},
|
|
fromAttribute: function ( attribute, index, offset ) {
|
|
fromAttribute: function ( attribute, index, offset ) {
|
|
|
|
|
|
- console.error( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' );
|
|
|
|
|
|
+ console.warn( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' );
|
|
return this.fromBufferAttribute( attribute, index, offset );
|
|
return this.fromBufferAttribute( attribute, index, offset );
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ distanceToManhattan: function ( v ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
|
|
|
|
+ return this.manhattanDistanceTo( v );
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ lengthManhattan: function () {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().' );
|
|
|
|
+ return this.manhattanLength();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
} );
|
|
} );
|
|
@@ -43364,9 +43468,15 @@ Object.assign( Vector4.prototype, {
|
|
|
|
|
|
fromAttribute: function ( attribute, index, offset ) {
|
|
fromAttribute: function ( attribute, index, offset ) {
|
|
|
|
|
|
- console.error( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );
|
|
|
|
|
|
+ console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );
|
|
return this.fromBufferAttribute( attribute, index, offset );
|
|
return this.fromBufferAttribute( attribute, index, offset );
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ lengthManhattan: function () {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' );
|
|
|
|
+ return this.manhattanLength();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
} );
|
|
} );
|