|
187 | 187 |
|
188 | 188 | } ); |
189 | 189 |
|
190 | | - var REVISION = '88dev'; |
| 190 | + var REVISION = '88'; |
191 | 191 | var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 }; |
192 | 192 | var CullFaceNone = 0; |
193 | 193 | var CullFaceBack = 1; |
|
20810 | 20810 |
|
20811 | 20811 | this.dispose = function () { |
20812 | 20812 |
|
20813 | | - window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange ); |
| 20813 | + if ( typeof window !== 'undefined' ) { |
| 20814 | + |
| 20815 | + window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange ); |
| 20816 | + |
| 20817 | + } |
20814 | 20818 |
|
20815 | 20819 | }; |
20816 | 20820 |
|
|
35904 | 35908 |
|
35905 | 35909 | return points; |
35906 | 35910 |
|
| 35911 | + }, |
| 35912 | + |
| 35913 | + copy: function ( source ) { |
| 35914 | + |
| 35915 | + Curve.prototype.copy.call( this, source ); |
| 35916 | + |
| 35917 | + this.curves = []; |
| 35918 | + |
| 35919 | + for ( var i = 0, l = source.curves.length; i < l; i ++ ) { |
| 35920 | + |
| 35921 | + var curve = source.curves[ i ]; |
| 35922 | + |
| 35923 | + this.curves.push( curve.clone() ); |
| 35924 | + |
| 35925 | + } |
| 35926 | + |
| 35927 | + this.autoClose = source.autoClose; |
| 35928 | + |
| 35929 | + return this; |
| 35930 | + |
35907 | 35931 | } |
35908 | 35932 |
|
35909 | 35933 | } ); |
@@ -36166,13 +36190,13 @@ |
36166 | 36190 |
|
36167 | 36191 | var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), { |
36168 | 36192 |
|
36169 | | - fromPoints: function ( vectors ) { |
| 36193 | + setFromPoints: function ( points ) { |
36170 | 36194 |
|
36171 | | - this.moveTo( vectors[ 0 ].x, vectors[ 0 ].y ); |
| 36195 | + this.moveTo( points[ 0 ].x, points[ 0 ].y ); |
36172 | 36196 |
|
36173 | | - for ( var i = 1, l = vectors.length; i < l; i ++ ) { |
| 36197 | + for ( var i = 1, l = points.length; i < l; i ++ ) { |
36174 | 36198 |
|
36175 | | - this.lineTo( vectors[ i ].x, vectors[ i ].y ); |
| 36199 | + this.lineTo( points[ i ].x, points[ i ].y ); |
36176 | 36200 |
|
36177 | 36201 | } |
36178 | 36202 |
|
|
36280 | 36304 | var lastPoint = curve.getPoint( 1 ); |
36281 | 36305 | this.currentPoint.copy( lastPoint ); |
36282 | 36306 |
|
| 36307 | + }, |
| 36308 | + |
| 36309 | + copy: function ( source ) { |
| 36310 | + |
| 36311 | + CurvePath.prototype.copy.call( this, source ); |
| 36312 | + |
| 36313 | + this.currentPoint.copy( source.currentPoint ); |
| 36314 | + |
| 36315 | + return this; |
| 36316 | + |
36283 | 36317 | } |
36284 | 36318 |
|
36285 | 36319 | } ); |
|
36299 | 36333 |
|
36300 | 36334 | if ( points ) { |
36301 | 36335 |
|
36302 | | - this.fromPoints( points ); |
| 36336 | + this.setFromPoints( points ); |
36303 | 36337 |
|
36304 | 36338 | } |
36305 | 36339 |
|
|
36319 | 36353 | // STEP 3a - Extract points from each shape, turn to vertices |
36320 | 36354 | // STEP 3b - Triangulate each shape, add faces. |
36321 | 36355 |
|
36322 | | - function Shape() { |
| 36356 | + function Shape( points ) { |
36323 | 36357 |
|
36324 | | - Path.apply( this, arguments ); |
| 36358 | + Path.call( this, points ); |
36325 | 36359 |
|
36326 | 36360 | this.type = 'Shape'; |
36327 | 36361 |
|
|
36347 | 36381 |
|
36348 | 36382 | }, |
36349 | 36383 |
|
36350 | | - // Get points of shape and holes (keypoints based on segments parameter) |
| 36384 | + // get points of shape and holes (keypoints based on segments parameter) |
36351 | 36385 |
|
36352 | | - extractAllPoints: function ( divisions ) { |
| 36386 | + extractPoints: function ( divisions ) { |
36353 | 36387 |
|
36354 | 36388 | return { |
36355 | 36389 |
|
|
36360 | 36394 |
|
36361 | 36395 | }, |
36362 | 36396 |
|
36363 | | - extractPoints: function ( divisions ) { |
| 36397 | + copy: function ( source ) { |
| 36398 | + |
| 36399 | + Path.prototype.copy.call( this, source ); |
| 36400 | + |
| 36401 | + this.holes = []; |
| 36402 | + |
| 36403 | + for ( var i = 0, l = source.holes.length; i < l; i ++ ) { |
36364 | 36404 |
|
36365 | | - return this.extractAllPoints( divisions ); |
| 36405 | + var hole = source.holes[ i ]; |
| 36406 | + |
| 36407 | + this.holes.push( hole.clone() ); |
| 36408 | + |
| 36409 | + } |
| 36410 | + |
| 36411 | + return this; |
36366 | 36412 |
|
36367 | 36413 | } |
36368 | 36414 |
|
|
43232 | 43278 |
|
43233 | 43279 | // |
43234 | 43280 |
|
| 43281 | + Object.assign( Path.prototype, { |
| 43282 | + |
| 43283 | + fromPoints: function ( points ) { |
| 43284 | + |
| 43285 | + console.warn( 'THREE.Path: .fromPoints() has been renamed to .setFromPoints().' ); |
| 43286 | + this.setFromPoints( points ); |
| 43287 | + |
| 43288 | + } |
| 43289 | + |
| 43290 | + } ); |
| 43291 | + |
| 43292 | + // |
| 43293 | + |
43235 | 43294 | function ClosedSplineCurve3( points ) { |
43236 | 43295 |
|
43237 | 43296 | console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' ); |
|
43628 | 43687 |
|
43629 | 43688 | Object.assign( Shape.prototype, { |
43630 | 43689 |
|
| 43690 | + extractAllPoints: function ( divisions ) { |
| 43691 | + |
| 43692 | + console.warn( 'THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.' ); |
| 43693 | + return this.extractPoints( divisions ); |
| 43694 | + |
| 43695 | + }, |
43631 | 43696 | extrude: function ( options ) { |
43632 | 43697 |
|
43633 | 43698 | console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' ); |
|
0 commit comments