@thi.ng/timestep 0.5.48 → 0.5.50
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 +1 -1
- package/README.md +2 -2
- package/package.json +10 -10
- package/timestep.js +4 -8
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 193 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
|
@@ -168,7 +168,7 @@ For Node.js REPL:
|
|
|
168
168
|
const ts = await import("@thi.ng/timestep");
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 1.
|
|
171
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 1.02 KB
|
|
172
172
|
|
|
173
173
|
## Dependencies
|
|
174
174
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/timestep",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.50",
|
|
4
4
|
"description": "Deterministic fixed timestep simulation updates with state interpolation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://thi.ng/timestep",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/math": "^5.
|
|
41
|
-
"@thi.ng/vectors": "^7.
|
|
39
|
+
"@thi.ng/api": "^8.11.3",
|
|
40
|
+
"@thi.ng/math": "^5.11.0",
|
|
41
|
+
"@thi.ng/vectors": "^7.11.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@microsoft/api-extractor": "^7.
|
|
45
|
-
"esbuild": "^0.
|
|
46
|
-
"typedoc": "^0.25.
|
|
47
|
-
"typescript": "^5.
|
|
44
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
45
|
+
"esbuild": "^0.21.5",
|
|
46
|
+
"typedoc": "^0.25.13",
|
|
47
|
+
"typescript": "^5.5.2"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"deterministic",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"status": "alpha",
|
|
93
93
|
"year": 2023
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
|
|
96
96
|
}
|
package/timestep.js
CHANGED
|
@@ -5,8 +5,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
5
5
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
6
|
if (decorator = decorators[i])
|
|
7
7
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
9
|
return result;
|
|
11
10
|
};
|
|
12
11
|
import {
|
|
@@ -82,8 +81,7 @@ let TimeStep = class {
|
|
|
82
81
|
const n = items.length;
|
|
83
82
|
const dt = this.dt;
|
|
84
83
|
while (this.accumulator >= dt) {
|
|
85
|
-
for (let i = 0; i < n; i++)
|
|
86
|
-
items[i].integrate(dt, this);
|
|
84
|
+
for (let i = 0; i < n; i++) items[i].integrate(dt, this);
|
|
87
85
|
this.t += dt;
|
|
88
86
|
this.accumulator -= dt;
|
|
89
87
|
this.updates++;
|
|
@@ -91,8 +89,7 @@ let TimeStep = class {
|
|
|
91
89
|
}
|
|
92
90
|
if (interpolate) {
|
|
93
91
|
const alpha = this.accumulator / dt;
|
|
94
|
-
for (let i = 0; i < n; i++)
|
|
95
|
-
items[i].interpolate(alpha, this);
|
|
92
|
+
for (let i = 0; i < n; i++) items[i].interpolate(alpha, this);
|
|
96
93
|
}
|
|
97
94
|
this.frame++;
|
|
98
95
|
this.notify(this.__eventFrame);
|
|
@@ -103,8 +100,7 @@ TimeStep = __decorateClass([
|
|
|
103
100
|
], TimeStep);
|
|
104
101
|
const defTimeStep = (opts) => new TimeStep(opts);
|
|
105
102
|
const integrateAll = (dt, ctx, ...items) => {
|
|
106
|
-
for (let i = 0, n = items.length; i < n; i++)
|
|
107
|
-
items[i].integrate(dt, ctx);
|
|
103
|
+
for (let i = 0, n = items.length; i < n; i++) items[i].integrate(dt, ctx);
|
|
108
104
|
};
|
|
109
105
|
const interpolateAll = (alpha, ctx, ...items) => {
|
|
110
106
|
for (let i = 0, n = items.length; i < n; i++)
|