@woosh/meep-engine 2.110.4 → 2.110.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/meep.cjs +117 -111
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +118 -109
- package/package.json +1 -1
- package/src/core/events/signal/Signal.d.ts.map +1 -1
- package/src/core/events/signal/Signal.js +3 -98
- package/src/core/events/signal/dispatchViaProxy.d.ts +7 -0
- package/src/core/events/signal/dispatchViaProxy.d.ts.map +1 -0
- package/src/core/events/signal/dispatchViaProxy.js +60 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandle.d.ts +9 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandle.d.ts.map +1 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandle.js +26 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandleAndContext.d.ts +9 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandleAndContext.d.ts.map +1 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandleAndContext.js +21 -0
- package/src/core/fsm/simple/SimpleStateMachine.d.ts.map +1 -1
- package/src/core/fsm/simple/SimpleStateMachine.js +2 -1
- package/src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.d.ts +2 -2
- package/src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.d.ts.map +1 -1
- package/src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.js +1 -1
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.d.ts +18 -0
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.js +51 -0
- package/src/engine/animation/clip/AnimationClip.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationClip.js +4 -0
- package/src/engine/animation/clip/AnimationInterpolationKind.d.ts +7 -0
- package/src/engine/animation/clip/AnimationInterpolationKind.d.ts.map +1 -0
- package/src/engine/animation/clip/AnimationInterpolationKind.js +9 -0
- package/src/engine/animation/clip/AnimationTrack.d.ts +12 -0
- package/src/engine/animation/clip/AnimationTrack.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationTrack.js +20 -1
- package/src/engine/animation/clip/AnimationTrackBinding.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationTrackBinding.js +12 -0
- package/src/engine/animation/clip/bind_property_writer.d.ts +9 -0
- package/src/engine/animation/clip/bind_property_writer.d.ts.map +1 -0
- package/src/engine/animation/clip/bind_property_writer.js +118 -0
- package/src/engine/animation/clip/curve_from_track_data.d.ts +12 -0
- package/src/engine/animation/clip/curve_from_track_data.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data.js +27 -0
- package/src/engine/animation/clip/curve_from_track_data_cubic_tangents.d.ts +10 -0
- package/src/engine/animation/clip/curve_from_track_data_cubic_tangents.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data_cubic_tangents.js +33 -0
- package/src/engine/animation/clip/curve_from_track_data_discrete.d.ts +10 -0
- package/src/engine/animation/clip/curve_from_track_data_discrete.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data_discrete.js +30 -0
- package/src/engine/animation/clip/curve_from_track_data_linear.d.ts +10 -0
- package/src/engine/animation/clip/curve_from_track_data_linear.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data_linear.js +25 -0
- package/src/engine/animation/clip/ecd_bind_animation_curve.d.ts.map +1 -1
- package/src/engine/animation/clip/ecd_bind_animation_curve.js +14 -239
- package/src/engine/animation/curve/AnimationCurve.d.ts +17 -17
- package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +30 -20
- package/src/engine/animation/curve/Keyframe.d.ts +5 -0
- package/src/engine/animation/curve/Keyframe.d.ts.map +1 -1
- package/src/engine/animation/curve/Keyframe.js +6 -0
- package/src/engine/animation/curve/binding/BoundValueWriter.d.ts +7 -0
- package/src/engine/animation/curve/binding/BoundValueWriter.d.ts.map +1 -1
- package/src/engine/animation/curve/binding/BoundValueWriter.js +9 -1
- package/src/engine/animation/curve/compute_curve_aabb.d.ts +1 -1
- package/src/engine/animation/curve/compute_curve_aabb.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +9 -7
- package/src/engine/ecs/components/Tag.d.ts +2 -0
- package/src/engine/ecs/parent/EntityNode.d.ts.map +1 -1
- package/src/engine/ecs/parent/EntityNode.js +2 -1
- package/src/engine/graphics/geometry/buffered/makeGeometryIndexed.d.ts +2 -1
- package/src/engine/graphics/geometry/buffered/makeGeometryIndexed.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/makeGeometryIndexed.js +4 -1
- package/src/engine/graphics/sh3/gi/material/common.glsl +3 -3
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +4 -3
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.d.ts +2 -1
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.js +6 -30
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map_fibonacci.d.ts +13 -0
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map_fibonacci.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map_fibonacci.js +163 -0
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +2 -2
- package/src/engine/graphics/trail/x/RibbonXMaterialSpec.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXMaterialSpec.js +10 -2
- package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXPlugin.js +7 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationClip.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/AnimationClip.js"],"names":[],"mappings":"AAEA;IACI,aAAS;IACT;;;OAGG;IACH,QAFU,gBAAgB,CAEf;IAEX,uBAWC;CACJ"}
|
|
1
|
+
{"version":3,"file":"AnimationClip.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/AnimationClip.js"],"names":[],"mappings":"AAEA;IACI,aAAS;IACT;;;OAGG;IACH,QAFU,gBAAgB,CAEf;IAEX;;;OAGG;IACH,uBAWC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimationInterpolationKind.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/AnimationInterpolationKind.js"],"names":[],"mappings":"yCAEU,MAAM"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents animation of a meaningful multi-variate thing, such as 3d vector or single scalar
|
|
3
|
+
*/
|
|
1
4
|
export class AnimationTrack {
|
|
2
5
|
/**
|
|
3
6
|
*
|
|
@@ -33,6 +36,10 @@ export class AnimationTrack {
|
|
|
33
36
|
* @return {number}
|
|
34
37
|
*/
|
|
35
38
|
get duration(): number;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @return {number}
|
|
42
|
+
*/
|
|
36
43
|
get curveCount(): number;
|
|
37
44
|
/**
|
|
38
45
|
*
|
|
@@ -41,5 +48,10 @@ export class AnimationTrack {
|
|
|
41
48
|
* @param {number} time
|
|
42
49
|
*/
|
|
43
50
|
sample(output: number[] | Float32Array | Float64Array, output_offset: number, time: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* @readonly
|
|
53
|
+
* @type {boolean}
|
|
54
|
+
*/
|
|
55
|
+
readonly isAnimationTrack: boolean;
|
|
44
56
|
}
|
|
45
57
|
//# sourceMappingURL=AnimationTrack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationTrack.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/AnimationTrack.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationTrack.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/AnimationTrack.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAwEI;;;;;OAKG;IACH,qBAJW,gBAAgB,SAChB,MAAM,GACL,cAAc,CAYzB;IAvFD;;;OAGG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,MAFU,MAAM,EAAE,CAET;IAET;;;OAGG;IACH,QAFU,gBAAgB,CAEf;IAEX;;;;;OAKG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,uBAYC;IAED;;;OAGG;IACH,yBAEC;IAED;;;;;OAKG;IACH,eAJW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,QACN,MAAM,QAahB;IAqBL;;;OAGG;IACH,2BAFU,OAAO,CAEwB;CANxC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
1
2
|
import { max2 } from "../../../core/math/max2.js";
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Represents animation of a meaningful multi-variate thing, such as 3d vector or single scalar
|
|
6
|
+
*/
|
|
3
7
|
export class AnimationTrack {
|
|
4
8
|
/**
|
|
5
9
|
* Human-readable label
|
|
@@ -45,6 +49,10 @@ export class AnimationTrack {
|
|
|
45
49
|
return r;
|
|
46
50
|
}
|
|
47
51
|
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @return {number}
|
|
55
|
+
*/
|
|
48
56
|
get curveCount() {
|
|
49
57
|
return this.curves.length;
|
|
50
58
|
}
|
|
@@ -59,6 +67,8 @@ export class AnimationTrack {
|
|
|
59
67
|
const curves = this.curves;
|
|
60
68
|
const curve_count = curves.length;
|
|
61
69
|
|
|
70
|
+
assert.greaterThanOrEqual(output.length, output_offset + curve_count, 'output overflow');
|
|
71
|
+
|
|
62
72
|
for (let i = 0; i < curve_count; i++) {
|
|
63
73
|
const curve = curves[i];
|
|
64
74
|
|
|
@@ -73,6 +83,9 @@ export class AnimationTrack {
|
|
|
73
83
|
* @return {AnimationTrack}
|
|
74
84
|
*/
|
|
75
85
|
static from(curves = [], name = "") {
|
|
86
|
+
assert.isString(name, 'name');
|
|
87
|
+
assert.isArray(curves, 'curves');
|
|
88
|
+
|
|
76
89
|
const r = new AnimationTrack();
|
|
77
90
|
|
|
78
91
|
r.curves = curves;
|
|
@@ -80,4 +93,10 @@ export class AnimationTrack {
|
|
|
80
93
|
|
|
81
94
|
return r;
|
|
82
95
|
}
|
|
83
|
-
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @readonly
|
|
100
|
+
* @type {boolean}
|
|
101
|
+
*/
|
|
102
|
+
AnimationTrack.prototype.isAnimationTrack = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationTrackBinding.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/AnimationTrackBinding.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationTrackBinding.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/AnimationTrackBinding.js"],"names":[],"mappings":"AAIA;IAaI;;;;;OAKG;IACH,8DAFa,qBAAqB,CAqBjC;IArCD;;;OAGG;IACH,QAFU,mBAAiB,IAAI,CAElB;IAEb;;;OAGG;IACH,sBAAY;IA6BZ;;;OAGG;IACH,cAFW,MAAM,QAMhB;CACJ"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
|
|
1
3
|
const sample = new Float64Array(1024);
|
|
2
4
|
|
|
3
5
|
export class AnimationTrackBinding {
|
|
@@ -20,6 +22,16 @@ export class AnimationTrackBinding {
|
|
|
20
22
|
* @returns {AnimationTrackBinding}
|
|
21
23
|
*/
|
|
22
24
|
static from(writer, track) {
|
|
25
|
+
assert.defined(writer,'writer');
|
|
26
|
+
assert.isObject(writer,'writer');
|
|
27
|
+
assert.notNull(writer,'writer');
|
|
28
|
+
assert.equal(writer.isBoundValueWriter,true,'writer.isBoundValueWriter !== true');
|
|
29
|
+
|
|
30
|
+
assert.defined(track,'track');
|
|
31
|
+
assert.isObject(track,'track');
|
|
32
|
+
assert.notNull(track,'track');
|
|
33
|
+
assert.equal(track.isAnimationTrack,true,'track.isAnimationTrack !== true');
|
|
34
|
+
|
|
23
35
|
|
|
24
36
|
const r = new AnimationTrackBinding();
|
|
25
37
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {EntityNode} node
|
|
4
|
+
* @param {string} path
|
|
5
|
+
* @returns {BoundValueWriter}
|
|
6
|
+
*/
|
|
7
|
+
export function bind_property_writer(node: EntityNode, path: string): BoundValueWriter;
|
|
8
|
+
import { BoundValueWriter } from "../curve/binding/BoundValueWriter.js";
|
|
9
|
+
//# sourceMappingURL=bind_property_writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind_property_writer.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/bind_property_writer.js"],"names":[],"mappings":"AAqFA;;;;;GAKG;AACH,6DAHW,MAAM,GACJ,gBAAgB,CA4B5B;iCAnHgC,sCAAsC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import Name from "../../ecs/name/Name.js";
|
|
2
|
+
import { BoundQuaternionWriter } from "../curve/binding/BoundQuaternionWriter.js";
|
|
3
|
+
import { BoundValueWriter } from "../curve/binding/BoundValueWriter.js";
|
|
4
|
+
import { BoundVector3Writer } from "../curve/binding/BoundVector3Writer.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {EntityNode} node
|
|
9
|
+
* @returns {string|undefined}
|
|
10
|
+
*/
|
|
11
|
+
function get_node_name(node) {
|
|
12
|
+
/**
|
|
13
|
+
* @type {Name}
|
|
14
|
+
*/
|
|
15
|
+
const name = node.entity.getComponent(Name);
|
|
16
|
+
|
|
17
|
+
if (name === null) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return name.getValue();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Following THREE.js PropertyBinding.findNode implementation
|
|
26
|
+
* @param {EntityNode} root
|
|
27
|
+
* @param {string} nodeName
|
|
28
|
+
* @returns {EntityNode|undefined}
|
|
29
|
+
*/
|
|
30
|
+
function find_node(root, nodeName) {
|
|
31
|
+
|
|
32
|
+
const root_name = get_node_name(root);
|
|
33
|
+
|
|
34
|
+
if (root_name === nodeName) {
|
|
35
|
+
return root;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// search into node subtree.
|
|
39
|
+
const children = root.children;
|
|
40
|
+
|
|
41
|
+
const child_count = children.length;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
for (let j = 0; j < child_count; j++) {
|
|
45
|
+
/**
|
|
46
|
+
* @type {EntityNode}
|
|
47
|
+
*/
|
|
48
|
+
const child = children[j];
|
|
49
|
+
|
|
50
|
+
const subtree_result = find_node(child, nodeName);
|
|
51
|
+
|
|
52
|
+
if (subtree_result !== undefined) {
|
|
53
|
+
return subtree_result;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param {EntityNode} root
|
|
61
|
+
* @param {string[]} path_parts
|
|
62
|
+
*/
|
|
63
|
+
function entity_node_resolve_path(root, path_parts) {
|
|
64
|
+
|
|
65
|
+
let node = root;
|
|
66
|
+
|
|
67
|
+
const part_count = path_parts.length;
|
|
68
|
+
for (let i = 0; i < part_count; i++) {
|
|
69
|
+
|
|
70
|
+
const part = path_parts[i];
|
|
71
|
+
|
|
72
|
+
const sub_node = find_node(node, part);
|
|
73
|
+
|
|
74
|
+
if (sub_node === undefined) {
|
|
75
|
+
|
|
76
|
+
throw new Error(`Child '${part}' not found, at index ${i} of [${path_parts.join(', ')}]. Valid names at this level: [${node.children.map(get_node_name)}]`);
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
node = sub_node;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return node;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* @param {EntityNode} node
|
|
89
|
+
* @param {string} path
|
|
90
|
+
* @returns {BoundValueWriter}
|
|
91
|
+
*/
|
|
92
|
+
export function bind_property_writer(node, path) {
|
|
93
|
+
const path_parts = path.split('.');
|
|
94
|
+
|
|
95
|
+
const property_name = path_parts[path_parts.length - 1];
|
|
96
|
+
|
|
97
|
+
const parent = entity_node_resolve_path(node, path_parts.slice(0, path_parts.length - 1));
|
|
98
|
+
|
|
99
|
+
let writer;
|
|
100
|
+
|
|
101
|
+
switch (property_name) {
|
|
102
|
+
case "position":
|
|
103
|
+
writer = new BoundVector3Writer(parent.transform.position);
|
|
104
|
+
break;
|
|
105
|
+
case "quaternion":
|
|
106
|
+
writer = new BoundQuaternionWriter(parent.transform.rotation);
|
|
107
|
+
break;
|
|
108
|
+
case "scale":
|
|
109
|
+
writer = new BoundVector3Writer(parent.transform.scale);
|
|
110
|
+
break;
|
|
111
|
+
default:
|
|
112
|
+
console.log(`Unsupported property name: ${property_name}`);
|
|
113
|
+
// NO-OP
|
|
114
|
+
writer = new BoundValueWriter();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return writer;
|
|
118
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {AnimationCurve} curve
|
|
4
|
+
* @param {AnimationInterpolationKind} type
|
|
5
|
+
* @param {number[]|Float32Array} values
|
|
6
|
+
* @param {number[]|Float32Array} times
|
|
7
|
+
* @param {number} component_count
|
|
8
|
+
* @param {number} component_index
|
|
9
|
+
*/
|
|
10
|
+
export function curve_from_track_data(curve: AnimationCurve, type: AnimationInterpolationKind, values: number[] | Float32Array, times: number[] | Float32Array, component_count: number, component_index: number): void;
|
|
11
|
+
import { AnimationInterpolationKind } from "./AnimationInterpolationKind.js";
|
|
12
|
+
//# sourceMappingURL=curve_from_track_data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curve_from_track_data.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/curve_from_track_data.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,mEANW,0BAA0B,UAC1B,MAAM,EAAE,GAAC,YAAY,SACrB,MAAM,EAAE,GAAC,YAAY,mBACrB,MAAM,mBACN,MAAM,QAchB;2CA1B0C,iCAAiC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AnimationInterpolationKind } from "./AnimationInterpolationKind.js";
|
|
2
|
+
import { curve_from_track_data_cubic_tangents } from "./curve_from_track_data_cubic_tangents.js";
|
|
3
|
+
import { curve_from_track_data_discrete } from "./curve_from_track_data_discrete.js";
|
|
4
|
+
import { curve_from_track_data_linear } from "./curve_from_track_data_linear.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {AnimationCurve} curve
|
|
9
|
+
* @param {AnimationInterpolationKind} type
|
|
10
|
+
* @param {number[]|Float32Array} values
|
|
11
|
+
* @param {number[]|Float32Array} times
|
|
12
|
+
* @param {number} component_count
|
|
13
|
+
* @param {number} component_index
|
|
14
|
+
*/
|
|
15
|
+
export function curve_from_track_data(curve, type, values, times, component_count, component_index) {
|
|
16
|
+
switch (type) {
|
|
17
|
+
case AnimationInterpolationKind.Discrete:
|
|
18
|
+
return curve_from_track_data_discrete(curve, values, times, component_count, component_index);
|
|
19
|
+
case AnimationInterpolationKind.Linear:
|
|
20
|
+
return curve_from_track_data_linear(curve, values, times, component_count, component_index);
|
|
21
|
+
case AnimationInterpolationKind.CubicTangents:
|
|
22
|
+
return curve_from_track_data_cubic_tangents(curve, values, times, component_count, component_index);
|
|
23
|
+
default:
|
|
24
|
+
throw new Error(`Unsupported type '${type}'`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {AnimationCurve} curve
|
|
4
|
+
* @param {number[]} values
|
|
5
|
+
* @param {number[]} times
|
|
6
|
+
* @param {number} component_count
|
|
7
|
+
* @param {number} component_index
|
|
8
|
+
*/
|
|
9
|
+
export function curve_from_track_data_cubic_tangents(curve: AnimationCurve, values: number[], times: number[], component_count: number, component_index: number): void;
|
|
10
|
+
//# sourceMappingURL=curve_from_track_data_cubic_tangents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curve_from_track_data_cubic_tangents.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/curve_from_track_data_cubic_tangents.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,oFALW,MAAM,EAAE,SACR,MAAM,EAAE,mBACR,MAAM,mBACN,MAAM,QAwBhB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Keyframe } from "../curve/Keyframe.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {AnimationCurve} curve
|
|
6
|
+
* @param {number[]} values
|
|
7
|
+
* @param {number[]} times
|
|
8
|
+
* @param {number} component_count
|
|
9
|
+
* @param {number} component_index
|
|
10
|
+
*/
|
|
11
|
+
export function curve_from_track_data_cubic_tangents(curve, values, times, component_count, component_index) {
|
|
12
|
+
|
|
13
|
+
const key_count = times.length;
|
|
14
|
+
|
|
15
|
+
for (let k = 0; k < key_count; k++) {
|
|
16
|
+
const component_position = k * component_count;
|
|
17
|
+
|
|
18
|
+
// 3 corresponds to 3 parts of a keyframe: inTangent, value, outTangent
|
|
19
|
+
const base_offset = 3 * component_position;
|
|
20
|
+
|
|
21
|
+
// Layout of keyframe output values for CUBICSPLINE animations:
|
|
22
|
+
// [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ]
|
|
23
|
+
|
|
24
|
+
const inTangent = values[base_offset + component_index];
|
|
25
|
+
const value = values[base_offset + component_count + component_index];
|
|
26
|
+
const outTangent = values[base_offset + component_count * 2 + component_index];
|
|
27
|
+
|
|
28
|
+
const time = times[k];
|
|
29
|
+
|
|
30
|
+
curve.add(Keyframe.from(time, value, inTangent, outTangent));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {AnimationCurve} curve
|
|
4
|
+
* @param {number[]} values
|
|
5
|
+
* @param {number[]} times
|
|
6
|
+
* @param {number} component_count
|
|
7
|
+
* @param {number} component_index
|
|
8
|
+
*/
|
|
9
|
+
export function curve_from_track_data_discrete(curve: AnimationCurve, values: number[], times: number[], component_count: number, component_index: number): void;
|
|
10
|
+
//# sourceMappingURL=curve_from_track_data_discrete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curve_from_track_data_discrete.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/curve_from_track_data_discrete.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,8EALW,MAAM,EAAE,SACR,MAAM,EAAE,mBACR,MAAM,mBACN,MAAM,QAqBhB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Keyframe } from "../curve/Keyframe.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {AnimationCurve} curve
|
|
6
|
+
* @param {number[]} values
|
|
7
|
+
* @param {number[]} times
|
|
8
|
+
* @param {number} component_count
|
|
9
|
+
* @param {number} component_index
|
|
10
|
+
*/
|
|
11
|
+
export function curve_from_track_data_discrete(curve, values, times, component_count, component_index) {
|
|
12
|
+
|
|
13
|
+
const key_count = times.length;
|
|
14
|
+
|
|
15
|
+
for (let k = 0; k < key_count; k++) {
|
|
16
|
+
const value = values[k * component_count + component_index];
|
|
17
|
+
const time = times[k];
|
|
18
|
+
|
|
19
|
+
curve.add(Keyframe.from(time, value));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const keys = curve.keys;
|
|
23
|
+
|
|
24
|
+
for (let i = key_count - 1; i > 0; i--) {
|
|
25
|
+
const key = keys[i];
|
|
26
|
+
const prev = keys[i - 1];
|
|
27
|
+
|
|
28
|
+
keys.splice(i, 0, Keyframe.from(key.time, prev.value));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {AnimationCurve} curve
|
|
4
|
+
* @param {number[]} values
|
|
5
|
+
* @param {number[]} times
|
|
6
|
+
* @param {number} component_count
|
|
7
|
+
* @param {number} component_index
|
|
8
|
+
*/
|
|
9
|
+
export function curve_from_track_data_linear(curve: AnimationCurve, values: number[], times: number[], component_count: number, component_index: number): void;
|
|
10
|
+
//# sourceMappingURL=curve_from_track_data_linear.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curve_from_track_data_linear.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/curve_from_track_data_linear.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,4EALW,MAAM,EAAE,SACR,MAAM,EAAE,mBACR,MAAM,mBACN,MAAM,QAgBhB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Keyframe } from "../curve/Keyframe.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {AnimationCurve} curve
|
|
6
|
+
* @param {number[]} values
|
|
7
|
+
* @param {number[]} times
|
|
8
|
+
* @param {number} component_count
|
|
9
|
+
* @param {number} component_index
|
|
10
|
+
*/
|
|
11
|
+
export function curve_from_track_data_linear(curve, values, times, component_count, component_index) {
|
|
12
|
+
|
|
13
|
+
const key_count = times.length;
|
|
14
|
+
|
|
15
|
+
for (let k = 0; k < key_count; k++) {
|
|
16
|
+
const value = values[k * component_count + component_index];
|
|
17
|
+
const time = times[k];
|
|
18
|
+
|
|
19
|
+
curve.add(Keyframe.from(time, value));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
for (let k = 0; k < key_count; k++) {
|
|
23
|
+
curve.alignTangents(k);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecd_bind_animation_curve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/ecd_bind_animation_curve.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ecd_bind_animation_curve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/ecd_bind_animation_curve.js"],"names":[],"mappings":"AAsGA;;;;GAIG;AACH,2DAFW,mBAAmB,wBA6B7B;8BApI6B,oBAAoB;qCACb,2BAA2B"}
|