@woosh/meep-engine 2.91.8 → 2.92.3

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.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/src/core/binary/data_view/DataType2DataViewReaders.d.ts +14 -0
  3. package/src/core/binary/data_view/DataType2DataViewReaders.d.ts.map +1 -0
  4. package/src/core/binary/data_view/DataType2DataViewReaders.js +21 -0
  5. package/src/core/binary/data_view/DataType2DataViewWriters.d.ts +14 -0
  6. package/src/core/binary/data_view/DataType2DataViewWriters.d.ts.map +1 -0
  7. package/src/core/binary/data_view/DataType2DataViewWriters.js +21 -0
  8. package/src/core/binary/data_view/DataViewStructAccessor.d.ts +17 -0
  9. package/src/core/binary/data_view/DataViewStructAccessor.d.ts.map +1 -0
  10. package/src/core/binary/data_view/DataViewStructAccessor.js +82 -0
  11. package/src/core/binary/data_view/DataViewStructAccessor.spec.d.ts +2 -0
  12. package/src/core/binary/data_view/DataViewStructAccessor.spec.d.ts.map +1 -0
  13. package/src/core/binary/data_view/DataViewStructAccessor.spec.js +20 -0
  14. package/src/core/collection/table/RowFirstTableSpec.d.ts +0 -36
  15. package/src/core/collection/table/RowFirstTableSpec.d.ts.map +1 -1
  16. package/src/core/collection/table/RowFirstTableSpec.js +6 -44
  17. package/src/engine/animation/curve/EntityNodeAnimationClip.d.ts +4 -0
  18. package/src/engine/animation/curve/EntityNodeAnimationClip.d.ts.map +1 -0
  19. package/src/engine/animation/curve/EntityNodeAnimationClip.js +17 -0
  20. package/src/engine/animation/curve/ecd_bind_animation_curve.d.ts +1 -11
  21. package/src/engine/animation/curve/ecd_bind_animation_curve.d.ts.map +1 -1
  22. package/src/engine/animation/curve/ecd_bind_animation_curve.js +1 -18
  23. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGAnimationPlayback.d.ts +5 -0
  24. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGAnimationPlayback.d.ts.map +1 -0
  25. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGAnimationPlayback.js +5 -0
  26. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.d.ts +12 -44
  27. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.d.ts.map +1 -1
  28. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.js +6 -10
  29. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts +8 -24
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.91.8",
8
+ "version": "2.92.3",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -0,0 +1,14 @@
1
+ export type DataType2DataViewReaders = string;
2
+ export namespace DataType2DataViewReaders {
3
+ let uint8: string;
4
+ let uint16: string;
5
+ let uint32: string;
6
+ let uint64: string;
7
+ let int8: string;
8
+ let int16: string;
9
+ let int32: string;
10
+ let int64: string;
11
+ let float32: string;
12
+ let float64: string;
13
+ }
14
+ //# sourceMappingURL=DataType2DataViewReaders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataType2DataViewReaders.d.ts","sourceRoot":"","sources":["../../../../../src/core/binary/data_view/DataType2DataViewReaders.js"],"names":[],"mappings":"uCAKU,MAAM"}
@@ -0,0 +1,21 @@
1
+ import { BinaryDataType } from "../type/BinaryDataType.js";
2
+
3
+ /**
4
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
5
+ * @readonly
6
+ * @enum {string}
7
+ */
8
+ export const DataType2DataViewReaders = {
9
+ [BinaryDataType.Uint8]: "getUint8",
10
+ [BinaryDataType.Uint16]: "getUint16",
11
+ [BinaryDataType.Uint32]: "getUint32",
12
+ [BinaryDataType.Uint64]: "getUint64",
13
+
14
+ [BinaryDataType.Int8]: "getInt8",
15
+ [BinaryDataType.Int16]: "getInt16",
16
+ [BinaryDataType.Int32]: "getInt32",
17
+ [BinaryDataType.Int64]: "getInt64",
18
+
19
+ [BinaryDataType.Float32]: "getFloat32",
20
+ [BinaryDataType.Float64]: "getFloat64"
21
+ };
@@ -0,0 +1,14 @@
1
+ export type DataType2DataViewWriters = string;
2
+ export namespace DataType2DataViewWriters {
3
+ let uint8: string;
4
+ let uint16: string;
5
+ let uint32: string;
6
+ let uint64: string;
7
+ let int8: string;
8
+ let int16: string;
9
+ let int32: string;
10
+ let int64: string;
11
+ let float32: string;
12
+ let float64: string;
13
+ }
14
+ //# sourceMappingURL=DataType2DataViewWriters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataType2DataViewWriters.d.ts","sourceRoot":"","sources":["../../../../../src/core/binary/data_view/DataType2DataViewWriters.js"],"names":[],"mappings":"uCAKU,MAAM"}
@@ -0,0 +1,21 @@
1
+ import { BinaryDataType } from "../type/BinaryDataType.js";
2
+
3
+ /**
4
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
5
+ * @readonly
6
+ * @enum {string}
7
+ */
8
+ export const DataType2DataViewWriters = {
9
+ [BinaryDataType.Uint8]: "setUint8",
10
+ [BinaryDataType.Uint16]: "setUint16",
11
+ [BinaryDataType.Uint32]: "setUint32",
12
+ [BinaryDataType.Uint64]: "setUint64",
13
+
14
+ [BinaryDataType.Int8]: "setInt8",
15
+ [BinaryDataType.Int16]: "setInt16",
16
+ [BinaryDataType.Int32]: "setInt32",
17
+ [BinaryDataType.Int64]: "setInt64",
18
+
19
+ [BinaryDataType.Float32]: "setFloat32",
20
+ [BinaryDataType.Float64]: "setFloat64"
21
+ };
@@ -0,0 +1,17 @@
1
+ import {BinaryDataType} from "../type/BinaryDataType";
2
+
3
+ interface IBinarySchema {
4
+ [k: string]: BinaryDataType
5
+ }
6
+
7
+
8
+ export class DataViewStructAccessor<T extends IBinarySchema> {
9
+
10
+ constructor(type: T, little_endian?: boolean)
11
+
12
+ this: { [prop in keyof T]: number }
13
+
14
+ bind(view: DataView, offset: number): void
15
+
16
+ bind_by_index(view: DataView, index: number): void
17
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataViewStructAccessor.d.ts","sourceRoot":"","sources":["../../../../../src/core/binary/data_view/DataViewStructAccessor.js"],"names":[],"mappings":"AAOA;IAiBI;;;;OAIG;IACH,yCAFW,OAAO,EAiCjB;IApDD;;OAEG;IACH,OAFU,QAAQ,CAEZ;IAEN;;OAEG;IACH,SAFU,MAAM,CAEJ;IAEZ;;;OAGG;IACH,4BAFU,MAAM,CAEM;IAwCtB;;;;OAIG;IACH,gBAHW,QAAQ,eACR,MAAM,QAKhB;IAED;;;;OAIG;IACH,yBAHW,QAAQ,SACR,MAAM,QAKhB;CACJ"}
@@ -0,0 +1,82 @@
1
+ import { assert } from "../../assert.js";
2
+ import { FunctionCompiler } from "../../function/FunctionCompiler.js";
3
+ import { BinaryDataType } from "../type/BinaryDataType.js";
4
+ import { DataTypeByteSizes } from "../type/DataTypeByteSizes.js";
5
+ import { DataType2DataViewReaders } from "./DataType2DataViewReaders.js";
6
+ import { DataType2DataViewWriters } from "./DataType2DataViewWriters.js";
7
+
8
+ export class DataViewStructAccessor {
9
+ /**
10
+ * @type {DataView}
11
+ */
12
+ $data;
13
+
14
+ /**
15
+ * @type {number}
16
+ */
17
+ $offset = 0;
18
+
19
+ /**
20
+ * @readonly
21
+ * @type {number}
22
+ */
23
+ $record_byte_size = 0;
24
+
25
+ /**
26
+ *
27
+ * @param {Object<BinaryDataType>} schema
28
+ * @param {boolean} [little_endian]
29
+ */
30
+ constructor(schema, little_endian = false) {
31
+ assert.defined(schema, 'schema');
32
+ assert.isBoolean(little_endian, 'little_endian');
33
+
34
+ const props = Object.keys(schema);
35
+ const property_count = props.length;
36
+
37
+ let offset = 0;
38
+ for (let i = 0; i < property_count; i++) {
39
+ const property = props[i];
40
+ const type = schema[property];
41
+
42
+ assert.enum(type, BinaryDataType, "type");
43
+
44
+ assert.arrayHasNo(["bind", "$data", "$offset", "this", "constructor"], property, `Illegal property name ${property}`);
45
+
46
+ //
47
+ Object.defineProperty(this, property, {
48
+ get: FunctionCompiler.INSTANCE.compile({
49
+ code: `return this.$data.${DataType2DataViewReaders[type]}(this.$offset + ${offset}, ${little_endian})`
50
+ }),
51
+ set: FunctionCompiler.INSTANCE.compile({
52
+ args: ["value"],
53
+ code: `this.$data.${DataType2DataViewWriters[type]}(this.$offset + ${offset}, value, ${little_endian})`
54
+ })
55
+ })
56
+
57
+ offset += DataTypeByteSizes[type];
58
+ }
59
+
60
+ this.$record_byte_size = offset;
61
+ }
62
+
63
+ /**
64
+ *
65
+ * @param {DataView} data_view
66
+ * @param {number} byte_offset
67
+ */
68
+ bind(data_view, byte_offset) {
69
+ this.$data = data_view;
70
+ this.$offset = byte_offset;
71
+ }
72
+
73
+ /**
74
+ *
75
+ * @param {DataView} data_view
76
+ * @param {number} index
77
+ */
78
+ bind_by_index(data_view, index) {
79
+ this.$data = data_view;
80
+ this.$offset = index * this.$record_byte_size;
81
+ }
82
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DataViewStructAccessor.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataViewStructAccessor.spec.d.ts","sourceRoot":"","sources":["../../../../../src/core/binary/data_view/DataViewStructAccessor.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { BinaryDataType } from "../type/BinaryDataType.js";
2
+ import { DataViewStructAccessor } from "./DataViewStructAccessor.js";
3
+
4
+ test("2 field schema", () => {
5
+ const accessor = new DataViewStructAccessor({
6
+ alice: BinaryDataType.Float32,
7
+ bob: BinaryDataType.Uint8
8
+ });
9
+
10
+ const buffer = new ArrayBuffer(1024);
11
+ const dataView = new DataView(buffer);
12
+
13
+ accessor.bind(dataView, 1);
14
+
15
+ accessor.alice = -3.7;
16
+ accessor.bob = 7;
17
+
18
+ expect(dataView.getFloat32(1)).toBeCloseTo(-3.7);
19
+ expect(dataView.getUint8(5)).toBe(7);
20
+ });
@@ -1,39 +1,3 @@
1
- export type DataType2DataViewReaders = string;
2
- export namespace DataType2DataViewReaders {
3
- let uint8: string;
4
- let uint16: string;
5
- let uint32: string;
6
- let uint64: string;
7
- let int8: string;
8
- let int16: string;
9
- let int32: string;
10
- let int64: string;
11
- let float32: string;
12
- let float64: string;
13
- }
14
- export type DataType2DataViewWriters = string;
15
- export namespace DataType2DataViewWriters {
16
- let uint8_1: string;
17
- export { uint8_1 as uint8 };
18
- let uint16_1: string;
19
- export { uint16_1 as uint16 };
20
- let uint32_1: string;
21
- export { uint32_1 as uint32 };
22
- let uint64_1: string;
23
- export { uint64_1 as uint64 };
24
- let int8_1: string;
25
- export { int8_1 as int8 };
26
- let int16_1: string;
27
- export { int16_1 as int16 };
28
- let int32_1: string;
29
- export { int32_1 as int32 };
30
- let int64_1: string;
31
- export { int64_1 as int64 };
32
- let float32_1: string;
33
- export { float32_1 as float32 };
34
- let float64_1: string;
35
- export { float64_1 as float64 };
36
- }
37
1
  /**
38
2
  * This is a schema class for binary data tables of class {@link RowFirstTable}
39
3
  * @class
@@ -1 +1 @@
1
- {"version":3,"file":"RowFirstTableSpec.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTableSpec.js"],"names":[],"mappings":"uCAiBU,MAAM;;;;;;;;;;;;;uCAoBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;AAgIhB;;;GAGG;AACH;IA6GI;;;;;OAKG;IACH,kBAJW,cAAc,EAAE,eAChB,UAAU,GACR,iBAAiB,CAgB7B;IAhID;;;;;OAKG;IACH,mBAJW,cAAc,EAAE,eAChB,UAAU,EAsEpB;IA9DG;;;OAGG;IACH,gBAFU,cAAc,EAAE,CAER;IAElB;;;OAGG;IACH,qBAFU,UAAU,CAEQ;IAE5B;;;OAGG;IACH,wBAFU,WAAW,CAEyB;IAc9C;;;OAGG;IACH,yBAFU,MAAM,CAEgB;IAEhC;;;OAGG;IACH,+BAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEA;IAEpD;;;OAGG;IACH,gCAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEC;IAIrD,mBAAsC;IACtC,mBAAsC;IAMtC;;;OAGG;IACH,8BAFU,OAAO,CAEc;IAGnC;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,QAFY,MAAM,CAQjB;IAED;;;;OAIG;IACH,cAHW,iBAAiB,GACf,OAAO,CAQnB;CAuBJ;+BArS8B,qCAAqC;2BADzC,4BAA4B"}
1
+ {"version":3,"file":"RowFirstTableSpec.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTableSpec.js"],"names":[],"mappings":"AA+HA;;;GAGG;AACH;IA6GI;;;;;OAKG;IACH,kBAJW,cAAc,EAAE,eAChB,UAAU,GACR,iBAAiB,CAgB7B;IAhID;;;;;OAKG;IACH,mBAJW,cAAc,EAAE,eAChB,UAAU,EAsEpB;IA9DG;;;OAGG;IACH,gBAFU,cAAc,EAAE,CAER;IAElB;;;OAGG;IACH,qBAFU,UAAU,CAEQ;IAE5B;;;OAGG;IACH,wBAFU,WAAW,CAEyB;IAc9C;;;OAGG;IACH,yBAFU,MAAM,CAEgB;IAEhC;;;OAGG;IACH,+BAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEA;IAEpD;;;OAGG;IACH,gCAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEC;IAIrD,mBAAsC;IACtC,mBAAsC;IAMtC;;;OAGG;IACH,8BAFU,OAAO,CAEc;IAGnC;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,QAFY,MAAM,CAQjB;IAED;;;;OAIG;IACH,cAHW,iBAAiB,GACf,OAAO,CAQnB;CAuBJ;+BA7P8B,qCAAqC;2BADzC,4BAA4B"}
@@ -3,6 +3,8 @@
3
3
  * @enum {string}
4
4
  */
5
5
  import { assert } from "../../assert.js";
6
+ import { DataType2DataViewReaders } from "../../binary/data_view/DataType2DataViewReaders.js";
7
+ import { DataType2DataViewWriters } from "../../binary/data_view/DataType2DataViewWriters.js";
6
8
  import { EndianType } from "../../binary/EndianType.js";
7
9
  import { BinaryDataType } from "../../binary/type/BinaryDataType.js";
8
10
  import { DataTypeByteSizes } from "../../binary/type/DataTypeByteSizes.js";
@@ -12,46 +14,6 @@ import { computeStringHash } from "../../primitives/strings/computeStringHash.js
12
14
  import { computeHashArray } from "../array/computeHashArray.js";
13
15
  import { isArrayEqualStrict } from "../array/isArrayEqualStrict.js";
14
16
 
15
- /**
16
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
17
- * @readonly
18
- * @enum {string}
19
- */
20
- export const DataType2DataViewReaders = {
21
- [BinaryDataType.Uint8]: "getUint8",
22
- [BinaryDataType.Uint16]: "getUint16",
23
- [BinaryDataType.Uint32]: "getUint32",
24
- [BinaryDataType.Uint64]: "getUint64",
25
-
26
- [BinaryDataType.Int8]: "getInt8",
27
- [BinaryDataType.Int16]: "getInt16",
28
- [BinaryDataType.Int32]: "getInt32",
29
- [BinaryDataType.Int64]: "getInt64",
30
-
31
- [BinaryDataType.Float32]: "getFloat32",
32
- [BinaryDataType.Float64]: "getFloat64"
33
- };
34
-
35
- /**
36
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
37
- * @readonly
38
- * @enum {string}
39
- */
40
- export const DataType2DataViewWriters = {
41
- [BinaryDataType.Uint8]: "setUint8",
42
- [BinaryDataType.Uint16]: "setUint16",
43
- [BinaryDataType.Uint32]: "setUint32",
44
- [BinaryDataType.Uint64]: "setUint64",
45
-
46
- [BinaryDataType.Int8]: "setInt8",
47
- [BinaryDataType.Int16]: "setInt16",
48
- [BinaryDataType.Int32]: "setInt32",
49
- [BinaryDataType.Int64]: "setInt64",
50
-
51
- [BinaryDataType.Float32]: "setFloat32",
52
- [BinaryDataType.Float64]: "setFloat64"
53
- };
54
-
55
17
  /**
56
18
  *
57
19
  * @param {BinaryDataType[]} types
@@ -134,7 +96,7 @@ function genRowWriter(types, endianType = EndianType.BigEndian) {
134
96
  * @param {EndianType} [endianType]
135
97
  * @returns {function(data_view:DataView, byte_offset:number, value:number):void}
136
98
  */
137
- function genCellWriter(type, offset, endianType = EndianType.BigEndian) {
99
+ function compileDataViewValueWriter(type, offset, endianType = EndianType.BigEndian) {
138
100
  const writeMethod = DataType2DataViewWriters[type];
139
101
 
140
102
  const littleEndianFlag = endianType === EndianType.BigEndian ? 'false' : 'true';
@@ -152,7 +114,7 @@ function genCellWriter(type, offset, endianType = EndianType.BigEndian) {
152
114
  * @param {EndianType} [endianType]
153
115
  * @returns {function(data_view:DataView, byte_offset:number):number}
154
116
  */
155
- function genCellReader(type, offset, endianType = EndianType.BigEndian) {
117
+ function compileDataViewValueReader(type, offset, endianType = EndianType.BigEndian) {
156
118
  const readMethod = DataType2DataViewReaders[type];
157
119
 
158
120
  const littleEndianFlag = endianType === EndianType.BigEndian ? 'false' : 'true';
@@ -233,8 +195,8 @@ export class RowFirstTableSpec {
233
195
  this.cellReaders = new Array(numTypes);
234
196
 
235
197
  for (let i = 0; i < numTypes; i++) {
236
- this.cellReaders[i] = genCellReader(types[i], this.columnOffsets[i], endianType);
237
- this.cellWriters[i] = genCellWriter(types[i], this.columnOffsets[i], endianType);
198
+ this.cellReaders[i] = compileDataViewValueReader(types[i], this.columnOffsets[i], endianType);
199
+ this.cellWriters[i] = compileDataViewValueWriter(types[i], this.columnOffsets[i], endianType);
238
200
  }
239
201
  /**
240
202
  * @readonly
@@ -0,0 +1,4 @@
1
+ export class EntityNodeAnimationClip {
2
+ name: string
3
+ duration: number
4
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityNodeAnimationClip.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/EntityNodeAnimationClip.js"],"names":[],"mappings":"AAAA;IACI,aAAS;IACT;;;OAGG;IACH,QAFU,sBAAsB,CAErB;IACX,iBAAY;IAEZ,yBAMC;CACJ"}
@@ -0,0 +1,17 @@
1
+ export class EntityNodeAnimationClip {
2
+ name = ""
3
+ /**
4
+ *
5
+ * @type {AnimatedValueBinding[]}
6
+ */
7
+ tracks = []
8
+ duration = 0
9
+
10
+ writeAt(time) {
11
+ for (let i = 0; i < this.tracks.length; i++) {
12
+ const track = this.tracks[i];
13
+
14
+ track.writeAt(time);
15
+ }
16
+ }
17
+ }
@@ -4,15 +4,5 @@
4
4
  * @param {AnimationClip} clip
5
5
  */
6
6
  export function convert_three_clip(node: EntityNode, clip: AnimationClip): EntityNodeAnimationClip;
7
- export class EntityNodeAnimationClip {
8
- name: string;
9
- /**
10
- *
11
- * @type {AnimatedValueBinding[]}
12
- */
13
- tracks: AnimatedValueBinding[];
14
- duration: number;
15
- writeAt(time: any): void;
16
- }
17
- import { AnimatedValueBinding } from "../../graphics/ecs/mesh-v2/aggregate/animation/AnimatedValueBinding.js";
7
+ import { EntityNodeAnimationClip } from "./EntityNodeAnimationClip.js";
18
8
  //# sourceMappingURL=ecd_bind_animation_curve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecd_bind_animation_curve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/ecd_bind_animation_curve.js"],"names":[],"mappings":"AAySA;;;;GAIG;AACH,mGAaC;AApCD;IACI,aAAS;IACT;;;OAGG;IACH,QAFU,oBAAoB,EAAE,CAErB;IACX,iBAAY;IAEZ,yBAMC;CACJ;qCAtSoC,wEAAwE"}
1
+ {"version":3,"file":"ecd_bind_animation_curve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/ecd_bind_animation_curve.js"],"names":[],"mappings":"AAwRA;;;;GAIG;AACH,mGAaC;wCApSuC,8BAA8B"}
@@ -4,6 +4,7 @@ import { BoundQuaternionWriter } from "../../graphics/ecs/mesh-v2/aggregate/anim
4
4
  import { BoundValueWriter } from "../../graphics/ecs/mesh-v2/aggregate/animation/BoundValueWriter.js";
5
5
  import { BoundVector3Writer } from "../../graphics/ecs/mesh-v2/aggregate/animation/BoundVector3Writer.js";
6
6
  import { AnimationCurve } from "./AnimationCurve.js";
7
+ import { EntityNodeAnimationClip } from "./EntityNodeAnimationClip.js";
7
8
  import { Keyframe } from "./Keyframe.js";
8
9
 
9
10
  /**
@@ -277,24 +278,6 @@ function convert_three_track(track, node) {
277
278
  return AnimatedValueBinding.from(writer, curves);
278
279
  }
279
280
 
280
- export class EntityNodeAnimationClip {
281
- name = ""
282
- /**
283
- *
284
- * @type {AnimatedValueBinding[]}
285
- */
286
- tracks = []
287
- duration = 0
288
-
289
- writeAt(time) {
290
- for (let i = 0; i < this.tracks.length; i++) {
291
- const track = this.tracks[i];
292
-
293
- track.writeAt(time);
294
- }
295
- }
296
- }
297
-
298
281
  /**
299
282
  * Three.js clip to internal representation
300
283
  * @param {EntityNode} node
@@ -0,0 +1,5 @@
1
+ export class SGAnimationPlayback {
2
+ clip_name: string
3
+ time: number
4
+ loop: boolean
5
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SGAnimationPlayback.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGAnimationPlayback.js"],"names":[],"mappings":"AAAA;IACI,kBAAc;IACd,aAAQ;IACR,cAAY;CACf"}
@@ -0,0 +1,5 @@
1
+ export class SGAnimationPlayback {
2
+ clip_name = ""
3
+ time = 0
4
+ loop = false
5
+ }
@@ -1,44 +1,12 @@
1
- export class SGMeshAnimationController {
2
- /**
3
- *
4
- * @type {AnimationPlayback[]}
5
- */
6
- active: AnimationPlayback[];
7
- /**
8
- *
9
- * @type {EntityNodeAnimationClip[]}
10
- */
11
- bound: EntityNodeAnimationClip[];
12
- /**
13
- *
14
- * @param {string} name
15
- * @return {EntityNodeAnimationClip|undefined}
16
- */
17
- getBoundByName(name: string): EntityNodeAnimationClip | undefined;
18
- /**
19
- *
20
- * @param {string} name
21
- * @return {AnimationPlayback|undefined}
22
- */
23
- getActiveByName(name: string): AnimationPlayback | undefined;
24
- /**
25
- *
26
- * @param {string} name
27
- * @param {boolean} loop
28
- * @param {number} time_offset
29
- * @returns {AnimationPlayback}
30
- */
31
- start(name: string, loop?: boolean, time_offset?: number): AnimationPlayback;
32
- /**
33
- *
34
- * @param {AnimationPlayback} playback
35
- * @return {boolean}
36
- */
37
- stop(playback: AnimationPlayback): boolean;
38
- }
39
- export class AnimationPlayback {
40
- clip_name: string;
41
- time: number;
42
- loop: boolean;
43
- }
44
- //# sourceMappingURL=SGMeshAnimationController.d.ts.map
1
+ import {EntityNodeAnimationClip} from "../../../../animation/curve/EntityNodeAnimationClip";
2
+ import {SGAnimationPlayback} from "./SGAnimationPlayback";
3
+
4
+ export class SGMeshAnimationController {
5
+ readonly bound: EntityNodeAnimationClip[]
6
+
7
+ start(name: string, loop?: boolean, time_offset?: number): SGAnimationPlayback
8
+
9
+ stop(playback: SGAnimationPlayback): boolean
10
+
11
+ getActiveByName(name: string): SGAnimationPlayback | undefined
12
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SGMeshAnimationController.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.js"],"names":[],"mappings":"AAGA;IACI;;;OAGG;IACH,QAFU,iBAAiB,EAAE,CAElB;IAEX;;;OAGG;IACH,OAFU,yBAAyB,CAEzB;IAEV;;;;OAIG;IACH,qBAHW,MAAM,GACL,0BAAwB,SAAS,CAM5C;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACL,iBAAiB,GAAC,SAAS,CAMtC;IAGD;;;;;;OAMG;IACH,YALW,MAAM,SACN,OAAO,gBACP,MAAM,GACJ,iBAAiB,CAgB7B;IAED;;;;OAIG;IACH,eAHW,iBAAiB,GAChB,OAAO,CAQlB;CACJ;AAED;IACI,kBAAc;IACd,aAAQ;IACR,cAAY;CACf"}
1
+ {"version":3,"file":"SGMeshAnimationController.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.js"],"names":[],"mappings":"AAIA;IACI;;;OAGG;IACH,QAFU,mBAAmB,EAAE,CAEpB;IAEX;;;OAGG;IACH,OAFU,yBAAyB,CAEzB;IAEV;;;;OAIG;IACH,qBAHW,MAAM,GACL,0BAAwB,SAAS,CAM5C;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACL,mBAAmB,GAAC,SAAS,CAMxC;IAGD;;;;;;OAMG;IACH,YALW,MAAM,SACN,OAAO,gBACP,MAAM,GACJ,mBAAmB,CAgB/B;IAED;;;;OAIG;IACH,eAHW,mBAAmB,GAClB,OAAO,CAQlB;CACJ;oCAzEmC,0BAA0B"}
@@ -1,10 +1,11 @@
1
1
  import { assert } from "../../../../../core/assert.js";
2
2
  import { array_remove_first } from "../../../../../core/collection/array/array_remove_first.js";
3
+ import { SGAnimationPlayback } from "./SGAnimationPlayback.js";
3
4
 
4
5
  export class SGMeshAnimationController {
5
6
  /**
6
7
  *
7
- * @type {AnimationPlayback[]}
8
+ * @type {SGAnimationPlayback[]}
8
9
  */
9
10
  active = []
10
11
 
@@ -28,7 +29,7 @@ export class SGMeshAnimationController {
28
29
  /**
29
30
  *
30
31
  * @param {string} name
31
- * @return {AnimationPlayback|undefined}
32
+ * @return {SGAnimationPlayback|undefined}
32
33
  */
33
34
  getActiveByName(name) {
34
35
  assert.isString(name, 'name');
@@ -42,14 +43,14 @@ export class SGMeshAnimationController {
42
43
  * @param {string} name
43
44
  * @param {boolean} loop
44
45
  * @param {number} time_offset
45
- * @returns {AnimationPlayback}
46
+ * @returns {SGAnimationPlayback}
46
47
  */
47
48
  start(name, loop = false, time_offset = 0) {
48
49
  assert.isString(name, 'name');
49
50
  assert.isBoolean(loop, 'loop');
50
51
  assert.isNumber(time_offset, 'time_offset');
51
52
 
52
- const playback = new AnimationPlayback();
53
+ const playback = new SGAnimationPlayback();
53
54
 
54
55
  playback.clip_name = name;
55
56
  playback.loop = loop;
@@ -62,7 +63,7 @@ export class SGMeshAnimationController {
62
63
 
63
64
  /**
64
65
  *
65
- * @param {AnimationPlayback} playback
66
+ * @param {SGAnimationPlayback} playback
66
67
  * @return {boolean}
67
68
  */
68
69
  stop(playback) {
@@ -74,8 +75,3 @@ export class SGMeshAnimationController {
74
75
  }
75
76
  }
76
77
 
77
- export class AnimationPlayback {
78
- clip_name = ""
79
- time = 0
80
- loop = false
81
- }
@@ -1,24 +1,8 @@
1
- export class SGMeshAnimationControllerSystem extends System<any, any, any, any, any> {
2
- /**
3
- *
4
- * @param {Engine} engine
5
- */
6
- constructor(engine: Engine);
7
- engine: Engine;
8
- dependencies: (typeof SGMesh | typeof SGMeshAnimationController)[];
9
- components_used: (ResourceAccessSpecification<typeof SGMesh> | ResourceAccessSpecification<typeof SGMeshAnimationController>)[];
10
- /**
11
- *
12
- * @param {SGMeshAnimationController} anim
13
- * @param {SGMesh} mesh
14
- * @param {number} entity
15
- */
16
- link(anim: SGMeshAnimationController, mesh: SGMesh, entity: number): Promise<void>;
17
- update(td: any): void;
18
- #private;
19
- }
20
- import { System } from "../../../../ecs/System.js";
21
- import { SGMesh } from "./SGMesh.js";
22
- import { SGMeshAnimationController } from "./SGMeshAnimationController.js";
23
- import { ResourceAccessSpecification } from "../../../../../core/model/ResourceAccessSpecification.js";
24
- //# sourceMappingURL=SGMeshAnimationControllerSystem.d.ts.map
1
+ import {System} from "../../../../ecs/System";
2
+ import Engine from "../../../../Engine";
3
+ import {SGMesh} from "./SGMesh";
4
+ import {SGMeshAnimationController} from "./SGMeshAnimationController";
5
+
6
+ export class SGMeshAnimationControllerSystem extends System<SGMeshAnimationController,SGMesh>{
7
+ constructor(engine:Engine)
8
+ }