@woosh/meep-engine 2.146.0 → 2.147.0

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 (68) hide show
  1. package/package.json +1 -1
  2. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +0 -11
  3. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  4. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +8 -6
  5. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  6. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +552 -551
  7. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +8 -3
  8. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -1
  9. package/src/engine/control/first-person/abilities/LedgeGrab.js +213 -199
  10. package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -1
  11. package/src/engine/control/first-person/abilities/Mantle.js +195 -188
  12. package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -1
  13. package/src/engine/control/first-person/abilities/WallRun.js +183 -175
  14. package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts +9 -0
  15. package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -1
  16. package/src/engine/control/first-person/sensors/FirstPersonSensors.js +87 -77
  17. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +8 -0
  18. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
  19. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +229 -196
  20. package/src/engine/ecs/EntityManager.d.ts +34 -11
  21. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  22. package/src/engine/ecs/EntityManager.js +71 -42
  23. package/src/engine/interpolation/BinaryInterpolationAdapter.d.ts.map +1 -0
  24. package/src/engine/interpolation/Interpoland.d.ts +48 -0
  25. package/src/engine/interpolation/Interpoland.d.ts.map +1 -0
  26. package/src/engine/interpolation/Interpoland.js +49 -0
  27. package/src/engine/interpolation/Interpolated.d.ts +101 -0
  28. package/src/engine/interpolation/Interpolated.d.ts.map +1 -0
  29. package/src/engine/interpolation/Interpolated.js +149 -0
  30. package/src/engine/{network/sim → interpolation}/InterpolationLog.d.ts +1 -1
  31. package/src/engine/interpolation/InterpolationLog.d.ts.map +1 -0
  32. package/src/engine/{network/sim → interpolation}/InterpolationLog.js +2 -2
  33. package/src/engine/interpolation/InterpolationSystem.d.ts +116 -0
  34. package/src/engine/interpolation/InterpolationSystem.d.ts.map +1 -0
  35. package/src/engine/interpolation/InterpolationSystem.js +233 -0
  36. package/src/engine/interpolation/PoseInterpolationAdapter.d.ts +17 -0
  37. package/src/engine/interpolation/PoseInterpolationAdapter.d.ts.map +1 -0
  38. package/src/engine/interpolation/PoseInterpolationAdapter.js +61 -0
  39. package/src/engine/interpolation/TransformPoseSerializationAdapter.d.ts +35 -0
  40. package/src/engine/interpolation/TransformPoseSerializationAdapter.d.ts.map +1 -0
  41. package/src/engine/interpolation/TransformPoseSerializationAdapter.js +57 -0
  42. package/src/engine/interpolation/pose_interpoland.d.ts +18 -0
  43. package/src/engine/interpolation/pose_interpoland.d.ts.map +1 -0
  44. package/src/engine/interpolation/pose_interpoland.js +27 -0
  45. package/src/engine/network/NetworkSession.d.ts +2 -2
  46. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  47. package/src/engine/network/NetworkSession.js +2 -2
  48. package/src/engine/network/adapters/QuaternionInterpolationAdapter.d.ts +1 -1
  49. package/src/engine/network/adapters/QuaternionInterpolationAdapter.d.ts.map +1 -1
  50. package/src/engine/network/adapters/QuaternionInterpolationAdapter.js +1 -1
  51. package/src/engine/network/adapters/TransformInterpolationAdapter.d.ts +1 -1
  52. package/src/engine/network/adapters/TransformInterpolationAdapter.d.ts.map +1 -1
  53. package/src/engine/network/adapters/TransformInterpolationAdapter.js +1 -1
  54. package/src/engine/network/adapters/Vector3InterpolationAdapter.d.ts +1 -1
  55. package/src/engine/network/adapters/Vector3InterpolationAdapter.d.ts.map +1 -1
  56. package/src/engine/network/adapters/Vector3InterpolationAdapter.js +1 -1
  57. package/src/engine/physics/INTEPOLATION_SYSTEM_PLAN.md +287 -0
  58. package/src/engine/physics/PLAN.md +10 -9
  59. package/src/engine/physics/ecs/PhysicsSystem.d.ts +64 -0
  60. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  61. package/src/engine/physics/ecs/PhysicsSystem.js +168 -0
  62. package/src/engine/physics/narrowphase/box_triangle_contact.js +15 -12
  63. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  64. package/src/engine/physics/narrowphase/narrowphase_step.js +28 -1
  65. package/src/engine/network/sim/BinaryInterpolationAdapter.d.ts.map +0 -1
  66. package/src/engine/network/sim/InterpolationLog.d.ts.map +0 -1
  67. /package/src/engine/{network/sim → interpolation}/BinaryInterpolationAdapter.d.ts +0 -0
  68. /package/src/engine/{network/sim → interpolation}/BinaryInterpolationAdapter.js +0 -0
@@ -524,18 +524,21 @@ function emit_triangle_face_manifold(
524
524
  tnx, tny, tnz,
525
525
  nx, ny, nz
526
526
  ) {
527
- // Triangle's outward face normal points box triangle = -n.
528
- // (Triangle is the reference, so its outward normal is the direction
529
- // the box should be pushed to separate opposite of triangle → box.)
530
- const ref_out_x = -nx;
531
- const ref_out_y = -ny;
532
- const ref_out_z = -nz;
533
- // But we also need to ensure ref_out aligns with the triangle's CCW
534
- // face normal (tn). If tn opposes ref_out, the triangle is "facing
535
- // away" from the box would happen on a thin-shell mesh; in that
536
- // case our SAT axis came from the FRONT face direction and ref_out
537
- // is still correct geometrically. Either way, we use the
538
- // sign-canonicalised contact normal as the source of truth.
527
+ // Reference = triangle. Its outward face normal points from the triangle
528
+ // surface toward the box i.e. the contact normal `n` (triangle → box),
529
+ // which the SAT already sign-canonicalised. The incident box face is then
530
+ // the one whose outward normal is most antiparallel to this (the box face
531
+ // actually facing the triangle), and the per-point depth below measures the
532
+ // penetration of THAT face — not the box's far face.
533
+ //
534
+ // (The earlier `-n` here pointed the reference normal into the terrain, so
535
+ // the incident picker selected the box's FAR face and the plane-to-plane
536
+ // depth ballooned to ~the box's thickness for any tilted box catapulting
537
+ // rocking boxes off heightmaps. See box_triangle_contact.spec.js
538
+ // "tilted box, shallow corner".)
539
+ const ref_out_x = nx;
540
+ const ref_out_y = ny;
541
+ const ref_out_z = nz;
539
542
 
540
543
  // Pick the incident box face: the one whose outward axis is most
541
544
  // antiparallel to ref_out.
@@ -1 +1 @@
1
- {"version":3,"file":"narrowphase_step.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/narrowphase/narrowphase_step.js"],"names":[],"mappings":"AA2zCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qDAVW,YAAY,GAAC,MAAM,EAAE,iCAGrB;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,QAC5B;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,iCAErC;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,QAC5B;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,GACnC,MAAM,CAyClB;AAED;;;;;;;;;;;GAWG;AACH,uFALW,MAAM,MAAM;IAAC,QAAQ,WAAW;IAAC,SAAS,YAAW;CAAC,CAAC,CAAC,QA0JlE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,uEAJW,MAAM,UACN,MAAM;IAAC,QAAQ,WAAW;IAAC,SAAS,YAAW;CAAC,CAAC,UACjD,MAAM;IAAC,QAAQ,WAAW;IAAC,SAAS,YAAW;CAAC,CAAC,QAuF3D"}
1
+ {"version":3,"file":"narrowphase_step.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/narrowphase/narrowphase_step.js"],"names":[],"mappings":"AA2zCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qDAVW,YAAY,GAAC,MAAM,EAAE,iCAGrB;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,QAC5B;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,iCAErC;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,QAC5B;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,GACnC,MAAM,CAyClB;AAED;;;;;;;;;;;GAWG;AACH,uFALW,MAAM,MAAM;IAAC,QAAQ,WAAW;IAAC,SAAS,YAAW;CAAC,CAAC,CAAC,QA0JlE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,uEAJW,MAAM,UACN,MAAM;IAAC,QAAQ,WAAW;IAAC,SAAS,YAAW;CAAC,CAAC,UACjD,MAAM;IAAC,QAAQ,WAAW;IAAC,SAAS,YAAW;CAAC,CAAC,QAkH3D"}
@@ -1667,7 +1667,34 @@ export function redetect_pair_geometry(manifolds, slot, list_a, list_b) {
1667
1667
  }
1668
1668
  }
1669
1669
 
1670
- if (best_k === -1) continue; // no unclaimed same-fid candidate this substep — keep frozen geometry
1670
+ // Position fallback (mirrors narrowphase_step's match-and-merge). A
1671
+ // single triangle's clipped contact count is NOT stable across sub-mm
1672
+ // pose changes — a box straddling a cell seam can have one triangle
1673
+ // yield 4 points one substep and 3 the next — so an existing contact can
1674
+ // outnumber this substep's same-fid candidates. Freezing its stale
1675
+ // witness then duplicates a sibling contact's point, leaving a
1676
+ // degenerate (sub-dimensional) manifold. Instead, claim the nearest
1677
+ // unclaimed candidate of ANY fid: every contact keeps a DISTINCT live
1678
+ // witness. The fid label is left intact and re-resolved by the next
1679
+ // once-per-step narrowphase. (At a fixed pose the same-fid match always
1680
+ // succeeds, so this never fires for the depth-equality guards or the
1681
+ // one-contact-per-triangle sphere/mesh paths.)
1682
+ if (best_k === -1) {
1683
+ for (let k = 0; k < cc; k++) {
1684
+ if (redetect_claimed[k] === 1) continue;
1685
+ const co = k * CANDIDATE_STRIDE;
1686
+ const dx = candidates[co] - pax;
1687
+ const dy = candidates[co + 1] - pay;
1688
+ const dz = candidates[co + 2] - paz;
1689
+ const d2 = dx * dx + dy * dy + dz * dz;
1690
+ if (d2 < best_d2) {
1691
+ best_d2 = d2;
1692
+ best_k = k;
1693
+ }
1694
+ }
1695
+ }
1696
+
1697
+ if (best_k === -1) continue; // no unclaimed candidate at all this substep — keep frozen geometry
1671
1698
 
1672
1699
  redetect_claimed[best_k] = 1;
1673
1700
  const co = best_k * CANDIDATE_STRIDE;
@@ -1 +0,0 @@
1
- {"version":3,"file":"BinaryInterpolationAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/sim/BinaryInterpolationAdapter.js"],"names":[],"mappings":";;;;;gCAMU,MAAM;AANhB;;;;;;;GAOG;AACH;IACI,gEAAgE;;IAEhE,qEAAqE;;IAErE,+DAA+D;;GAEhE;AAEH;;;;;;;;;;;;;;;GAeG;AACH;IAEI,sDAAsD;IACtD,MADW,MAAM,CACe;IAEhC;;;;;;;;;;;;;OAaG;IACH,0EAJW,MAAM,iBACN,MAAM,KACN,MAAM,QAIhB;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"InterpolationLog.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/sim/InterpolationLog.js"],"names":[],"mappings":"AA6EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;IAkBI;;;;;OAKG;IACH,0DALW;QAAE,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,EAkGvE;IA9EG,+BAA+B;IAC/B,0BADqB,MAAM,CACiB;IAe5C,+BAA+B;IAC/B,2BADqB,MAAM,CACa;IA+D5C;;;;;;;;OAQG;IACH,iBAFW,MAAM,QAkEhB;IAED;;;;;;;;;;;;;OAaG;IACH,yBAJW,MAAM,WACN,MAAM,GACJ,YAAY,CAmCxB;IAED;;;;;OAKG;IACH,mBAsDC;IAED;;;;;;;OAOG;IACH,iBAeC;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;;;;;;;;OAcG;IACH,YAPW,MAAM,EAAE,GAAC,WAAW,cACpB,MAAM,QACN,MAAM,cACN,MAAM,WACN,MAAM,GACJ,OAAO,CA+BnB;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBATW,YAAY,cACZ,MAAM,WACN,MAAM,UACN,MAAM,UACN,MAAM,KACN,MAAM,wCAEJ,OAAO,CAuBnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,eAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,cASC;;CACJ;6BArkB4B,sCAAsC"}