@msb235/blits-rapier 0.7.1 → 0.7.2

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
@@ -4,6 +4,13 @@ This package follows [semver](https://semver.org). Below 1.0.0, a breaking chang
4
4
  version and everything else the patch. The release workflow refuses a `rapier-v*` tag with no
5
5
  section here.
6
6
 
7
+ ## 0.7.2
8
+
9
+ ### Fixed
10
+
11
+ - A seek past memory through a store that returns everything replays from the world's latest copy
12
+ before the time sought, not its first, so the log of frames it brings back stays bounded.
13
+
7
14
  ## 0.7.1
8
15
 
9
16
  ### Changed
package/dist/physics.js CHANGED
@@ -20,10 +20,16 @@ export function physicsStore(store) {
20
20
  const all = await store.load(t);
21
21
  for (const w of worlds) {
22
22
  // A replay to t starts from the world's latest copy at or before it, which needs the frames from there.
23
- let from = t;
23
+ let from = Number.NEGATIVE_INFINITY;
24
24
  for (const r of all)
25
- if (r.mix === w.name && r.stream === 'snap' && r.subject === 'world' && r.at < from)
25
+ if (r.mix === w.name &&
26
+ r.stream === 'snap' &&
27
+ r.subject === 'world' &&
28
+ r.at <= t &&
29
+ r.at > from)
26
30
  from = r.at;
31
+ if (from === Number.NEGATIVE_INFINITY)
32
+ from = t;
27
33
  w.restore(from < t ? await store.load(from) : all, from);
28
34
  }
29
35
  return all.filter((r) => !(r.stream === 'host' && r.subject === FRAMES));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msb235/blits-rapier",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Pairs Rapier rigid-body physics with a blits mix: voices push bodies, and each body's simulated pose blends with authored motion",
5
5
  "keywords": [
6
6
  "physics",
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@dimforge/rapier2d-compat": "0.21.0",
47
47
  "@dimforge/rapier3d-compat": "0.21.0",
48
- "@msb235/blits": "1.1.1"
48
+ "@msb235/blits": "1.2.0"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "@dimforge/rapier2d-compat": {