@thi.ng/timestep 0.5.2 → 0.5.4

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-10-30T14:31:56Z
3
+ - **Last updated**: 2023-11-09T10:28:19Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [0.5.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/timestep@0.5.3) (2023-11-09)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update all tests (packages T-Z) ([020ef6c](https://github.com/thi-ng/umbrella/commit/020ef6c))
17
+
12
18
  ## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/timestep@0.5.0) (2023-10-27)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -158,7 +158,7 @@ For Node.js REPL:
158
158
  const timestep = await import("@thi.ng/timestep");
159
159
  ```
160
160
 
161
- Package sizes (brotli'd, pre-treeshake): ESM: 821 bytes
161
+ Package sizes (brotli'd, pre-treeshake): ESM: 973 bytes
162
162
 
163
163
  ## Dependencies
164
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/timestep",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Deterministic fixed timestep simulation updates with state interpolation",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -28,22 +28,21 @@
28
28
  "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
29
29
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
30
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && tools:readme",
32
- "doc:stats": "tools:module-stats",
31
+ "doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
33
32
  "pub": "yarn npm publish --access public",
34
- "test": "testament test"
33
+ "test": "bun test"
35
34
  },
36
35
  "dependencies": {
37
- "@thi.ng/api": "^8.9.6",
38
- "@thi.ng/math": "^5.7.1",
39
- "@thi.ng/vectors": "^7.8.2"
36
+ "@thi.ng/api": "^8.9.8",
37
+ "@thi.ng/math": "^5.7.3",
38
+ "@thi.ng/vectors": "^7.8.4"
40
39
  },
41
40
  "devDependencies": {
42
- "@microsoft/api-extractor": "^7.38.0",
43
- "@thi.ng/testament": "^0.3.24",
41
+ "@microsoft/api-extractor": "^7.38.2",
42
+ "@thi.ng/testament": "^0.4.1",
44
43
  "rimraf": "^5.0.5",
45
44
  "tools": "^0.0.1",
46
- "typedoc": "^0.25.2",
45
+ "typedoc": "^0.25.3",
47
46
  "typescript": "^5.2.2"
48
47
  },
49
48
  "keywords": [
@@ -91,5 +90,5 @@
91
90
  "status": "alpha",
92
91
  "year": 2023
93
92
  },
94
- "gitHead": "336bd1bf95825b3c318a3ab49c54451c94aaa883\n"
93
+ "gitHead": "669a3151e4302480244fe3e60eff5e732ea5b7a7\n"
95
94
  }
package/state.js CHANGED
@@ -2,6 +2,10 @@ import { mix } from "@thi.ng/math/mix";
2
2
  import { mixN2, mixN3, mixN4 } from "@thi.ng/vectors/mixn";
3
3
  import { set2, set3, set4 } from "@thi.ng/vectors/set";
4
4
  export class NumericState {
5
+ value;
6
+ update;
7
+ curr;
8
+ prev;
5
9
  constructor(value, update) {
6
10
  this.value = value;
7
11
  this.update = update;
@@ -28,6 +32,12 @@ export class NumericState {
28
32
  }
29
33
  }
30
34
  export class VectorState {
35
+ value;
36
+ update;
37
+ prev;
38
+ curr;
39
+ setFn;
40
+ mixFn;
31
41
  constructor(api, value, update) {
32
42
  this.value = value;
33
43
  this.update = update;
package/timestep.js CHANGED
@@ -2,12 +2,18 @@ import { __decorate } from "tslib";
2
2
  import { INotifyMixin, } from "@thi.ng/api";
3
3
  import { EVENT_FRAME, EVENT_SUBFRAME, } from "./api.js";
4
4
  let TimeStep = class TimeStep {
5
+ start;
6
+ dt;
7
+ maxFrameTime;
8
+ scale;
9
+ t = 0;
10
+ current = 0;
11
+ accumulator = 0;
12
+ frame = 0;
13
+ updates = 0;
14
+ __eventFrame;
15
+ __eventSubFrame;
5
16
  constructor(opts) {
6
- this.t = 0;
7
- this.current = 0;
8
- this.accumulator = 0;
9
- this.frame = 0;
10
- this.updates = 0;
11
17
  const $opts = {
12
18
  dt: 1 / 60,
13
19
  maxFrameTime: 1 / 4,