From 8d1f43da5d8dd40f8b92befb947dfe2067b8c4ee Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Sun, 5 May 2024 11:00:28 -0700 Subject: [PATCH 1/4] improve KeyframeTrack and subtype docs --- .../api/en/animation/tracks/BooleanKeyframeTrack.html | 6 +++++- docs/api/en/animation/tracks/ColorKeyframeTrack.html | 2 +- docs/api/en/animation/tracks/NumberKeyframeTrack.html | 2 +- .../en/animation/tracks/QuaternionKeyframeTrack.html | 10 +++++----- docs/api/en/animation/tracks/StringKeyframeTrack.html | 11 ++++++----- docs/api/en/animation/tracks/VectorKeyframeTrack.html | 2 +- src/animation/tracks/BooleanKeyframeTrack.js | 11 ++++++++++- src/animation/tracks/QuaternionKeyframeTrack.js | 3 +-- src/animation/tracks/StringKeyframeTrack.js | 11 ++++++++++- 9 files changed, 40 insertions(+), 18 deletions(-) diff --git a/docs/api/en/animation/tracks/BooleanKeyframeTrack.html b/docs/api/en/animation/tracks/BooleanKeyframeTrack.html index af3d582f2bdc66..f0f545bf279338 100644 --- a/docs/api/en/animation/tracks/BooleanKeyframeTrack.html +++ b/docs/api/en/animation/tracks/BooleanKeyframeTrack.html @@ -23,6 +23,10 @@

[page:Array times] - (required) array of keyframe times.
[page:Array values] - values for the keyframes at the times specified.

+

+ This keyframe track type has no interpolation parameter because the + interpolation is always [page:Animation InterpolateDiscrete]. +

Properties

@@ -30,7 +34,7 @@

Properties

[property:Constant DefaultInterpolation]

- The default interpolation type to use, [page:Animation InterpolateDiscrete]. + The default interpolation type to use. Only [page:Animation InterpolateDiscrete] makes sense for this track type.

[property:Array ValueBufferType]

diff --git a/docs/api/en/animation/tracks/ColorKeyframeTrack.html b/docs/api/en/animation/tracks/ColorKeyframeTrack.html index 1ed0c6aedbfe13..fcaf4da8614ab7 100644 --- a/docs/api/en/animation/tracks/ColorKeyframeTrack.html +++ b/docs/api/en/animation/tracks/ColorKeyframeTrack.html @@ -20,7 +20,7 @@

[name]

Constructor

- [name]( [param:String name], [param:Array times], [param:Array values] ) + [name]( [param:String name], [param:Array times], [param:Array values], [param:Constant interpolation] )

[page:String name] - (required) identifier for the KeyframeTrack.
diff --git a/docs/api/en/animation/tracks/NumberKeyframeTrack.html b/docs/api/en/animation/tracks/NumberKeyframeTrack.html index 94b3fef4cf2001..c505f9b8b8994b 100644 --- a/docs/api/en/animation/tracks/NumberKeyframeTrack.html +++ b/docs/api/en/animation/tracks/NumberKeyframeTrack.html @@ -16,7 +16,7 @@

[name]

Constructor

- [name]( [param:String name], [param:Array times], [param:Array values] ) + [name]( [param:String name], [param:Array times], [param:Array values], [param:Constant interpolation] )

[page:String name] - (required) identifier for the KeyframeTrack.
diff --git a/docs/api/en/animation/tracks/QuaternionKeyframeTrack.html b/docs/api/en/animation/tracks/QuaternionKeyframeTrack.html index 7f1b7a05512d81..da3a545a0d808b 100644 --- a/docs/api/en/animation/tracks/QuaternionKeyframeTrack.html +++ b/docs/api/en/animation/tracks/QuaternionKeyframeTrack.html @@ -16,14 +16,14 @@

[name]

Constructor

- [name]( [param:String name], [param:Array times], [param:Array values] ) + [name]( [param:String name], [param:Array times], [param:Array values], [param:Constant interpolation] )

- [page:String name] (required) identifier for the KeyframeTrack.
- [page:Array times] (required) array of keyframe times.
- [page:Array values] values for the keyframes at the times specified, a + [page:String name] - (required) identifier for the KeyframeTrack.
+ [page:Array times] - (required) array of keyframe times.
+ [page:Array values] - values for the keyframes at the times specified, a flat array of quaternion components.
- [page:Constant interpolation] the type of interpolation to use. See + [page:Constant interpolation] - the type of interpolation to use. See [page:Animation Animation Constants] for possible values. Default is [page:Animation InterpolateLinear].

diff --git a/docs/api/en/animation/tracks/StringKeyframeTrack.html b/docs/api/en/animation/tracks/StringKeyframeTrack.html index 8464687c2e6acd..9a471ef3a0236a 100644 --- a/docs/api/en/animation/tracks/StringKeyframeTrack.html +++ b/docs/api/en/animation/tracks/StringKeyframeTrack.html @@ -24,9 +24,10 @@

[page:String name] - (required) identifier for the KeyframeTrack.
[page:Array times] - (required) array of keyframe times.
[page:Array values] - values for the keyframes at the times specified.
- [page:Constant interpolation] - the type of interpolation to use. See - [page:Animation Animation Constants] for possible values. Default is - [page:Animation InterpolateDiscrete]. +

+

+ This keyframe track type has no interpolation parameter because the + interpolation is always [page:Animation InterpolateDiscrete].

Properties

@@ -35,7 +36,7 @@

Properties

[property:Constant DefaultInterpolation]

- The default interpolation type to use, [page:Animation InterpolateDiscrete]. + The default interpolation type to use. Only [page:Animation InterpolateDiscrete] makes sense for this track type.

[property:Array ValueBufferType]

@@ -70,4 +71,4 @@

Source

- \ No newline at end of file + diff --git a/docs/api/en/animation/tracks/VectorKeyframeTrack.html b/docs/api/en/animation/tracks/VectorKeyframeTrack.html index 7d88ab2b4f77cc..81839922ef8b5f 100644 --- a/docs/api/en/animation/tracks/VectorKeyframeTrack.html +++ b/docs/api/en/animation/tracks/VectorKeyframeTrack.html @@ -17,7 +17,7 @@

[name]

Constructor

- [name]( [param:String name], [param:Array times], [param:Array values] ) + [name]( [param:String name], [param:Array times], [param:Array values], [param:Constant interpolation] )

[page:String name] - (required) identifier for the KeyframeTrack.
diff --git a/src/animation/tracks/BooleanKeyframeTrack.js b/src/animation/tracks/BooleanKeyframeTrack.js index 277b3696318a3b..ecdcc197a5a096 100644 --- a/src/animation/tracks/BooleanKeyframeTrack.js +++ b/src/animation/tracks/BooleanKeyframeTrack.js @@ -4,7 +4,16 @@ import { KeyframeTrack } from '../KeyframeTrack.js'; /** * A Track of Boolean keyframe values. */ -class BooleanKeyframeTrack extends KeyframeTrack {} +class BooleanKeyframeTrack extends KeyframeTrack { + + // No interpolation parameter because only InterpolateDiscrete makes sense. + constructor( name, times, values ) { + + super( name, times, values ); + + } + +} BooleanKeyframeTrack.prototype.ValueTypeName = 'bool'; BooleanKeyframeTrack.prototype.ValueBufferType = Array; diff --git a/src/animation/tracks/QuaternionKeyframeTrack.js b/src/animation/tracks/QuaternionKeyframeTrack.js index d070e4e0f84db1..702bea92e640a3 100644 --- a/src/animation/tracks/QuaternionKeyframeTrack.js +++ b/src/animation/tracks/QuaternionKeyframeTrack.js @@ -1,4 +1,3 @@ -import { InterpolateLinear } from '../../constants.js'; import { KeyframeTrack } from '../KeyframeTrack.js'; import { QuaternionLinearInterpolant } from '../../math/interpolants/QuaternionLinearInterpolant.js'; @@ -17,7 +16,7 @@ class QuaternionKeyframeTrack extends KeyframeTrack { QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion'; // ValueBufferType is inherited -QuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; +// DefaultInterpolation is inherited; QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; export { QuaternionKeyframeTrack }; diff --git a/src/animation/tracks/StringKeyframeTrack.js b/src/animation/tracks/StringKeyframeTrack.js index e7e615703e183c..75a57f75bf0c12 100644 --- a/src/animation/tracks/StringKeyframeTrack.js +++ b/src/animation/tracks/StringKeyframeTrack.js @@ -4,7 +4,16 @@ import { KeyframeTrack } from '../KeyframeTrack.js'; /** * A Track that interpolates Strings */ -class StringKeyframeTrack extends KeyframeTrack {} +class StringKeyframeTrack extends KeyframeTrack { + + // No interpolation parameter because only InterpolateDiscrete makes sense. + constructor( name, times, values ) { + + super( name, times, values ); + + } + +} StringKeyframeTrack.prototype.ValueTypeName = 'string'; StringKeyframeTrack.prototype.ValueBufferType = Array; From bdc3bbd368f7aa66d57e7d807feec30db8a93620 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Mon, 6 May 2024 09:50:50 -0700 Subject: [PATCH 2/4] change comment wording, remove unneeded tests --- src/animation/tracks/BooleanKeyframeTrack.js | 2 +- src/animation/tracks/StringKeyframeTrack.js | 2 +- test/unit/src/animation/tracks/BooleanKeyframeTrack.tests.js | 5 ----- test/unit/src/animation/tracks/StringKeyframeTrack.tests.js | 5 ----- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/animation/tracks/BooleanKeyframeTrack.js b/src/animation/tracks/BooleanKeyframeTrack.js index ecdcc197a5a096..2b3ff85dc27850 100644 --- a/src/animation/tracks/BooleanKeyframeTrack.js +++ b/src/animation/tracks/BooleanKeyframeTrack.js @@ -6,7 +6,7 @@ import { KeyframeTrack } from '../KeyframeTrack.js'; */ class BooleanKeyframeTrack extends KeyframeTrack { - // No interpolation parameter because only InterpolateDiscrete makes sense. + // No interpolation parameter because only InterpolateDiscrete is valid. constructor( name, times, values ) { super( name, times, values ); diff --git a/src/animation/tracks/StringKeyframeTrack.js b/src/animation/tracks/StringKeyframeTrack.js index 75a57f75bf0c12..64049a02227445 100644 --- a/src/animation/tracks/StringKeyframeTrack.js +++ b/src/animation/tracks/StringKeyframeTrack.js @@ -6,7 +6,7 @@ import { KeyframeTrack } from '../KeyframeTrack.js'; */ class StringKeyframeTrack extends KeyframeTrack { - // No interpolation parameter because only InterpolateDiscrete makes sense. + // No interpolation parameter because only InterpolateDiscrete is valid. constructor( name, times, values ) { super( name, times, values ); diff --git a/test/unit/src/animation/tracks/BooleanKeyframeTrack.tests.js b/test/unit/src/animation/tracks/BooleanKeyframeTrack.tests.js index a206386f7f5114..8b56fbdfd457d0 100644 --- a/test/unit/src/animation/tracks/BooleanKeyframeTrack.tests.js +++ b/test/unit/src/animation/tracks/BooleanKeyframeTrack.tests.js @@ -14,7 +14,6 @@ export default QUnit.module( 'Animation', () => { name: '.visible', times: [ 0, 1 ], values: [ true, false ], - interpolation: BooleanKeyframeTrack.DefaultInterpolation }; // INHERITANCE @@ -35,10 +34,6 @@ export default QUnit.module( 'Animation', () => { const object = new BooleanKeyframeTrack( parameters.name, parameters.times, parameters.values ); assert.ok( object, 'Can instantiate a BooleanKeyframeTrack.' ); - // name, times, values, interpolation - const object_all = new BooleanKeyframeTrack( parameters.name, parameters.times, parameters.values, parameters.interpolation ); - assert.ok( object_all, 'Can instantiate a BooleanKeyframeTrack with name, times, values, interpolation.' ); - } ); } ); diff --git a/test/unit/src/animation/tracks/StringKeyframeTrack.tests.js b/test/unit/src/animation/tracks/StringKeyframeTrack.tests.js index 8c75d030fa7345..7a54ca08f20451 100644 --- a/test/unit/src/animation/tracks/StringKeyframeTrack.tests.js +++ b/test/unit/src/animation/tracks/StringKeyframeTrack.tests.js @@ -14,7 +14,6 @@ export default QUnit.module( 'Animation', () => { name: '.name', times: [ 0, 1 ], values: [ 'foo', 'bar' ], - interpolation: StringKeyframeTrack.DefaultInterpolation }; // INHERITANCE @@ -35,10 +34,6 @@ export default QUnit.module( 'Animation', () => { const object = new StringKeyframeTrack( parameters.name, parameters.times, parameters.values ); assert.ok( object, 'Can instantiate a StringKeyframeTrack.' ); - // name, times, values, interpolation - const object_all = new StringKeyframeTrack( parameters.name, parameters.times, parameters.values, parameters.interpolation ); - assert.ok( object_all, 'Can instantiate a StringKeyframeTrack with name, times, values, interpolation.' ); - } ); } ); From 79150246dade9878c0afc516e03f3244bf7e1f2c Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Tue, 7 May 2024 10:17:24 +0200 Subject: [PATCH 3/4] Update BooleanKeyframeTrack.html Improve text. --- docs/api/en/animation/tracks/BooleanKeyframeTrack.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/en/animation/tracks/BooleanKeyframeTrack.html b/docs/api/en/animation/tracks/BooleanKeyframeTrack.html index f0f545bf279338..aee2b5704c9fb6 100644 --- a/docs/api/en/animation/tracks/BooleanKeyframeTrack.html +++ b/docs/api/en/animation/tracks/BooleanKeyframeTrack.html @@ -34,7 +34,7 @@

Properties

[property:Constant DefaultInterpolation]

- The default interpolation type to use. Only [page:Animation InterpolateDiscrete] makes sense for this track type. + The default interpolation type to use. Only [page:Animation InterpolateDiscrete] is valid for this track type.

[property:Array ValueBufferType]

From accbf5a1e2a3ed6f4925374a272a9ffb9ec1ebb1 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Tue, 7 May 2024 10:17:54 +0200 Subject: [PATCH 4/4] Update StringKeyframeTrack.html Improve text. --- docs/api/en/animation/tracks/StringKeyframeTrack.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/en/animation/tracks/StringKeyframeTrack.html b/docs/api/en/animation/tracks/StringKeyframeTrack.html index 9a471ef3a0236a..a6c6a7a73f8624 100644 --- a/docs/api/en/animation/tracks/StringKeyframeTrack.html +++ b/docs/api/en/animation/tracks/StringKeyframeTrack.html @@ -36,7 +36,7 @@

Properties

[property:Constant DefaultInterpolation]

- The default interpolation type to use. Only [page:Animation InterpolateDiscrete] makes sense for this track type. + The default interpolation type to use. Only [page:Animation InterpolateDiscrete] is valid for this track type.

[property:Array ValueBufferType]