diff --git a/examples/jsm/loaders/VRMLLoader.js b/examples/jsm/loaders/VRMLLoader.js index 61164c73e6c625..de35a700acf5d1 100644 --- a/examples/jsm/loaders/VRMLLoader.js +++ b/examples/jsm/loaders/VRMLLoader.js @@ -220,7 +220,7 @@ class VRMLLoader extends Loader { // - const StringLiteral = createToken( { name: 'StringLiteral', pattern: /"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/ } ); + const StringLiteral = createToken( { name: 'StringLiteral', pattern: /"(?:[^\\"]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/ } ); const HexLiteral = createToken( { name: 'HexLiteral', pattern: /0[xX][0-9a-fA-F]+/ } ); const NumberLiteral = createToken( { name: 'NumberLiteral', pattern: /[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/ } ); const TrueLiteral = createToken( { name: 'TrueLiteral', pattern: /TRUE/ } ); diff --git a/examples/models/vrml/multilineString.wrl b/examples/models/vrml/multilineString.wrl new file mode 100644 index 00000000000000..095a65769be4cb --- /dev/null +++ b/examples/models/vrml/multilineString.wrl @@ -0,0 +1,24 @@ +#VRML V2.0 utf8 +WorldInfo { title "Multi-line string literal test" } +NavigationInfo { type "EXAMINE" } +Background { skyColor [ 0.2 0.2 0.3 ] } + +Transform { + translation 0 0 0 + children [ + Shape { + appearance Appearance { + material Material { diffuseColor 0.2 0.8 0.4 } + } + geometry Box { size 1 1 1 } + } + ] +} + +DEF S Script { + url "javascript: +function touched(value) { + console.log('Box was touched at ' + value); +} +" +} diff --git a/examples/webgl_loader_vrml.html b/examples/webgl_loader_vrml.html index 327c293bd3be77..7bf64bc786e4c7 100644 --- a/examples/webgl_loader_vrml.html +++ b/examples/webgl_loader_vrml.html @@ -56,7 +56,8 @@ 'meshWithTexture', 'pixelTexture', 'points', - 'camera' + 'camera', + 'multilineString' ]; let vrmlScene; diff --git a/src/animation/AnimationAction.js b/src/animation/AnimationAction.js index c1a26f17dcb628..62ded0f4fe8dcd 100644 --- a/src/animation/AnimationAction.js +++ b/src/animation/AnimationAction.js @@ -56,6 +56,7 @@ class AnimationAction { this._byClipCacheIndex = null; // for the memory manager this._timeScaleInterpolant = null; + this._restoreTimeScale = null; this._weightInterpolant = null; /** @@ -343,6 +344,10 @@ class AnimationAction { startEndRatio = fadeOutDuration / fadeInDuration, endStartRatio = fadeInDuration / fadeOutDuration; + + fadeOutAction._restoreTimeScale = fadeOutAction.timeScale; + this._restoreTimeScale = this.timeScale; + fadeOutAction.warp( 1.0, startEndRatio, duration ); this.warp( endStartRatio, 1.0, duration ); @@ -511,6 +516,8 @@ class AnimationAction { } + this._restoreTimeScale = null; + return this; } @@ -683,8 +690,6 @@ class AnimationAction { if ( time > interpolant.parameterPositions[ 1 ] ) { - this.stopWarping(); - if ( timeScale === 0 ) { // motion has halted, pause @@ -692,11 +697,19 @@ class AnimationAction { } else { + if ( this._restoreTimeScale !== null ) { + + timeScale = this._restoreTimeScale; + + } + // warp done - apply final time scale this.timeScale = timeScale; } + this.stopWarping(); + } } diff --git a/test/unit/src/extras/curves/CatmullRomCurve3.tests.js b/test/unit/src/extras/curves/CatmullRomCurve3.tests.js index 12168610739bcc..f626a10edecf42 100644 --- a/test/unit/src/extras/curves/CatmullRomCurve3.tests.js +++ b/test/unit/src/extras/curves/CatmullRomCurve3.tests.js @@ -387,7 +387,7 @@ export default QUnit.module( 'Extras', () => { assert.deepEqual( points, expectedPoints, 'Correct points calculated' ); } ); - + QUnit.test( 'two points', ( assert ) => { const curve = new CatmullRomCurve3( [