@series-inc/rundot-syncplay 6.0.0-rc.33 → 6.0.0-rc.34

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.
@@ -0,0 +1,105 @@
1
+ # Migrating from Syncplay 6.0.0-rc.33 to rc.34
2
+
3
+ This release closes the rc.33 gaps that Wreck Yard reported and adds query,
4
+ vehicle, and portal work from the full request list. Each section names what
5
+ changes for a game and what does not.
6
+
7
+ ## Behavior changes
8
+
9
+ ### Portal host walls keep their own collision layers (A4)
10
+
11
+ Before rc.34, a portal host wall took one of the reserved layers 24 to 30, and
12
+ every body mask and every query layer mask silently included those layers. A
13
+ world could have at most 7 host walls.
14
+
15
+ From rc.34:
16
+
17
+ - A host wall keeps the layer and mask you gave it. `readBody(host).layer`
18
+ reports that layer.
19
+ - Body masks and query layer masks are exactly what you set. Layers 24 to 30
20
+ follow the normal rules. A body on layer 30 touches only bodies whose mask
21
+ includes layer 30.
22
+ - A query layer mask now applies to host walls like any other body. To hit a
23
+ host wall with a filtered query, include the host's layer.
24
+ - The number of host walls is limited only by body capacity.
25
+ - The step excludes contacts between a host wall and the bodies inside one of
26
+ its openings. Bodies outside an opening still touch the wall.
27
+
28
+ What to check: if a game relied on bodies on layers 24 to 30 touching
29
+ everything, give the other bodies masks that include those layers.
30
+
31
+ ### Portal checkpoints from rc.28 to rc.33
32
+
33
+ Serialized checkpoints that carry portal state now use portal trailer
34
+ version 2. A version 1 trailer (rc.28 through rc.33) stored the reserved host
35
+ layers and fails to restore with `physics.checkpoint-invalid`. Checkpoints with
36
+ no portal state have no trailer and restore as before. Rollback and late join
37
+ between peers on the same version are not affected.
38
+
39
+ ## Additions
40
+
41
+ ### Unit vectors from the physics entrypoint (D3)
42
+
43
+ Import `vec3` and `meters3` from `@series-inc/rundot-syncplay/physics/3d`.
44
+ The unit-typed form takes an optional scale:
45
+
46
+ ```ts
47
+ import { meters, vec3 } from '@series-inc/rundot-syncplay/physics/3d';
48
+
49
+ const offset = vec3(meters, [1, 2, 3], 0.5); // { x: 0.5, y: 1, z: 1.5 }
50
+ ```
51
+
52
+ The root exports stay as deprecated aliases of the same functions.
53
+
54
+ ### Body keys (D2)
55
+
56
+ - `PhysicsContactEvent3D` declares `bodyKeyA` and `bodyKeyB`.
57
+ - `PhysicsFluidInteraction3D` carries `bodyKey`.
58
+ - `world.resolveKeyId(key)` returns the live body id without reading the body.
59
+
60
+ ### Static checker (D1 follow-up)
61
+
62
+ `Math.sqrt` is allowed: IEEE 754 rounds it correctly in every engine. `pow`,
63
+ `hypot`, and `**` stay flagged.
64
+
65
+ ### Query index (B1)
66
+
67
+ Raycast, overlap, and shape cast use a spatial index. A query tests only the
68
+ bodies whose bounds overlap its own bounds, so its cost no longer grows with
69
+ far bodies. Hits, order, points, and normals are bit-identical to the linear
70
+ scan. `world.queryStats().testedBodies` reports the bodies the last query
71
+ tested. `queryIndex: false` in a world definition selects the linear scan.
72
+
73
+ ### Ray batches and the wheel layer mask (B3)
74
+
75
+ - `world.raycastBatch(queries)` runs 1 to 64 rays and returns each ray's hits.
76
+ The results equal separate `raycast` calls.
77
+ - `DeterministicVehicleDefinition3D.wheelCastLayerMask` lets the wheel rays
78
+ skip layers. A mask of `0xffffffff` gives the same results as no mask.
79
+
80
+ ### Vehicle step cost (C2)
81
+
82
+ The revision 2 vehicle step casts all wheels in one native call and reads its
83
+ support bodies in one batch. The tire solve is unchanged, and results are
84
+ bit-identical to separate reads.
85
+
86
+ ### Queries through portals (A3)
87
+
88
+ `shapeCast` and `overlap` now pass through open portals, like `raycast`. Hits
89
+ found through a portal carry `portalHops` and `portalPath`. A query that must
90
+ ignore portals sets `maxPortalDepth: 0`. The character controller already
91
+ handles portals itself and sets it.
92
+
93
+ ### Portal placement (A5)
94
+
95
+ `fitPortalEnd(world, { hostBodyId, point, normal, up, opening })` returns a
96
+ pose that fits fully on a static box host face, or null. Bodies take
97
+ `portalable: false`, and edits take `setPortalable(body, portalable)`.
98
+
99
+ ### Portal render helpers (A6)
100
+
101
+ Render-only helpers in `/physics/3d`: `portalTransformMatrix3D`,
102
+ `portalVirtualCameraMatrix3D`, `portalExitClipPlane3D`,
103
+ `portalPlaneInCameraSpace3D`, `portalObliqueProjection3D`, `planPortalViews3D`,
104
+ `portalPoseJumpBodyIds3D`, `interpolatePortalBodyPose3D`, and
105
+ `multiplyPortalMatrices`. They do not change the simulation.