@woosh/meep-engine 2.144.0 → 2.146.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 (60) hide show
  1. package/package.json +1 -1
  2. package/src/core/bvh2/bvh3/BVH.d.ts.map +1 -1
  3. package/src/core/bvh2/bvh3/BVH.js +158 -4
  4. package/src/core/geom/3d/shape/CylinderShape3D.d.ts +56 -0
  5. package/src/core/geom/3d/shape/CylinderShape3D.d.ts.map +1 -0
  6. package/src/core/geom/3d/shape/CylinderShape3D.js +223 -0
  7. package/src/core/geom/3d/shape/HeightMapShape3D.d.ts +33 -3
  8. package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -1
  9. package/src/core/geom/3d/shape/HeightMapShape3D.js +486 -451
  10. package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
  11. package/src/core/geom/3d/shape/json/shape_to_type.js +3 -0
  12. package/src/core/geom/3d/shape/json/type_adapters.d.ts +15 -0
  13. package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
  14. package/src/core/geom/3d/shape/json/type_adapters.js +16 -0
  15. package/src/engine/control/first-person/DESIGN_COLLISION.md +365 -302
  16. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +1 -3
  17. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  18. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +12 -2
  19. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  20. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +7 -2
  21. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +13 -0
  22. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  23. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +16 -2
  24. package/src/engine/control/first-person/TODO.md +13 -11
  25. package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -1
  26. package/src/engine/control/first-person/abilities/WallJump.js +11 -3
  27. package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -1
  28. package/src/engine/control/first-person/abilities/WallRun.js +30 -35
  29. package/src/engine/control/first-person/collision/KinematicMover.d.ts +35 -5
  30. package/src/engine/control/first-person/collision/KinematicMover.d.ts.map +1 -1
  31. package/src/engine/control/first-person/collision/KinematicMover.js +634 -424
  32. package/src/engine/control/first-person/prototype_first_person_controller.js +1003 -901
  33. package/src/engine/physics/PLAN.md +943 -767
  34. package/src/engine/physics/body/BodyStorage.d.ts +9 -0
  35. package/src/engine/physics/body/BodyStorage.d.ts.map +1 -1
  36. package/src/engine/physics/body/BodyStorage.js +23 -0
  37. package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -1
  38. package/src/engine/physics/broadphase/generate_pairs.js +7 -0
  39. package/src/engine/physics/ccd/linear_sweep.d.ts +97 -0
  40. package/src/engine/physics/ccd/linear_sweep.d.ts.map +1 -0
  41. package/src/engine/physics/ccd/linear_sweep.js +238 -0
  42. package/src/engine/physics/ecs/PhysicsSystem.d.ts +18 -3
  43. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  44. package/src/engine/physics/ecs/PhysicsSystem.js +59 -8
  45. package/src/engine/physics/ecs/RigidBodyFlags.d.ts +6 -0
  46. package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -1
  47. package/src/engine/physics/ecs/RigidBodyFlags.js +6 -0
  48. package/src/engine/physics/narrowphase/box_triangle_contact.js +811 -811
  49. package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -1
  50. package/src/engine/physics/narrowphase/compute_penetration.js +325 -323
  51. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +27 -8
  52. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -1
  53. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +235 -204
  54. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  55. package/src/engine/physics/narrowphase/narrowphase_step.js +70 -13
  56. package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -1
  57. package/src/engine/physics/queries/overlap_shape.js +185 -183
  58. package/src/engine/simulation/Ticker.d.ts +14 -0
  59. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  60. package/src/engine/simulation/Ticker.js +136 -1
@@ -115,9 +115,7 @@ export class FirstPersonPlayerController {
115
115
  };
116
116
  wallRun: {
117
117
  minSpeed: number;
118
- minAirborneTime: number; /**
119
- * @param {FirstPersonPlayerController} other
120
- */
118
+ minAirborneTime: number;
121
119
  maxDuration: number;
122
120
  gravityFactor: number;
123
121
  cameraRollDeg: number;
@@ -1 +1 @@
1
- {"version":3,"file":"FirstPersonPlayerController.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerController.js"],"names":[],"mappings":"AA8HA;;;;;;;;;;GAUG;AACH;IACI,wBAAgD;IAG5C,0CAAqD;IACrD,0BAAqC;IACrC,wBAAmC;IACnC,sBAAiC;IACjC,4BAAuC;IAEvC;;;;;;OAMG;IACH,SAFU,UAAU,CAEW;IAE/B;;;;;OAKG;IACH,WAFU,UAAU,CAEa;IAEjC;;;;;;OAMG;IACH,WAFU,MAAM,CAEG;IAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAhDJ;;;;;;;;;;mBAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAgDC;;mBAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAVF;IAED,0BAIC;IAED;;OAEG;IACH,YAFW,2BAA2B,QAKrC;IAED,qCAIC;IAED,4BAGC;IAED,eAGC;CACJ;;;;;kDA3MiD,wCAAwC;AAK1F;;;;;;;;GAQG;AACH;IACI,oEAAoE;IACpE,MADyD,OAAO,CACvC;IAEzB;;;;OAIG;I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","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerController.js"],"names":[],"mappings":"AA8HA;;;;;;;;;;GAUG;AACH;IACI,wBAAgD;IAG5C,0CAAqD;IACrD,0BAAqC;IACrC,wBAAmC;IACnC,sBAAiC;IACjC,4BAAuC;IAEvC;;;;;;OAMG;IACH,SAFU,UAAU,CAEW;IAE/B;;;;;OAKG;IACH,WAFU,UAAU,CAEa;IAEjC;;;;;;OAMG;IACH,WAFU,MAAM,CAEG;IAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAhDJ;;;;;;;;;;mBAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwCE;IAED,0BAIC;IAED;;OAEG;IACH,YAFW,2BAA2B,QAKrC;IAED,qCAIC;IAED,4BAGC;IAED,eAGC;CACJ;;;;;kDA3MiD,wCAAwC;AAK1F;;;;;;;;GAQG;AACH;IACI,oEAAoE;IACpE,MADyD,OAAO,CACvC;IAEzB;;;;OAIG;IACH,MAFU,OAAO,CAEQ;IAEzB,mEAAmE;IACnE,MADwD,OAAO,CAClD;IAEb,0EAA0E;IAC1E,QAD+D,OAAO,CACvD;IAEf,qEAAqE;IACrE,QAD0D,OAAO,CAClD;CAClB;AAED;;;GAGG;AACH;IACI,kBAAgB;IAChB,0BAAsB;IAEtB,4EAA4E;IAC5E,sBAAoC;IACpC,gBAAkB;IAElB,cAAU;IACV,4DAA4D;IAC5D,wBAAoB;IACpB,yEAAyE;IACzE,uBAAgD;IAEhD,sBAAkB;IAClB,qBAAiB;IACjB,qBAAiB;IAEjB,4BAAwB;IACxB,4BAA2B;IAC3B,2BAA0B;IAC1B,2EAA2E;IAC3E,qBAAoB;IAEpB,iBAAa;IACb,oBAAgB;IAChB,qBAAiB;IACjB,yBAAqB;IAErB,oBAAgB;IAChB,kBAAc;IACd,kDAAkD;IAClD,iBAAa;IAEb,kBAAiB;IAEjB,+EAA+E;IAC/E,uBAAsB;IACtB,6EAA6E;IAC7E,sBAAqB;IAErB;;;;;;;OAOG;IACH,SAFU,MAAM,CAEmB;IAEnC,oBAAgB;CACnB;gCAzFkF,2BAA2B;AA2F9G;;;GAGG;AACH;IACI,uDAAuD;IACvD,2DAA0B;IAC1B,yEAAyE;IACzE,4DAA2B;IAC3B,kBAAkB;IAClB,2DAA0B;IAC1B,6BAA6B;IAC7B,8DAA6B;IAC7B,iDAAiD;IACjD,uDAAsB;IACtB,8DAA6B;IAC7B,6DAA4B;IAC5B,8DAA6B;IAC7B,6DAA4B;IAC5B,2EAA2E;IAC3E,2DAA0B;IAC1B,2EAA2E;IAC3E,4DAA2B;IAC3B,6DAA6D;IAC7D,4DAA2B;IAC3B,uDAAuD;IACvD,+DAA8B;CACjC;2BAvH0B,yBAAyB;2BAFzB,2BAA2B;uCAG6B,2BAA2B;0CAA3B,2BAA2B;oBAL1F,+BAA+B;oBAC/B,+BAA+B;mBAFhC,uCAAuC"}
@@ -126,7 +126,12 @@ export class FirstPersonPlayerControllerConfig {
126
126
  * registered.
127
127
  */
128
128
  wallRun: {
129
- /** Minimum horizontal speed (m/s) to engage wall-run. */
129
+ /**
130
+ * Minimum horizontal speed (m/s) to engage wall-run. Set ABOVE
131
+ * walkSpeed (4.5) so a wall-run is earned by a committed RUN — a walk
132
+ * into the wall, or falling alongside it with leftover momentum,
133
+ * shouldn't grab on. Below the ~7 m/s a sprint-into-wall carries.
134
+ */
130
135
  minSpeed: number;
131
136
  /** Player must be airborne at least this long before wall-run can
132
137
  * engage — prevents wall-run triggering off a jump's first frames. */
@@ -589,7 +594,12 @@ export class FirstPersonPlayerControllerConfig {
589
594
  forwardOffsetOnLand: number;
590
595
  };
591
596
  wallRun: {
592
- /** Minimum horizontal speed (m/s) to engage wall-run. */
597
+ /**
598
+ * Minimum horizontal speed (m/s) to engage wall-run. Set ABOVE
599
+ * walkSpeed (4.5) so a wall-run is earned by a committed RUN — a walk
600
+ * into the wall, or falling alongside it with leftover momentum,
601
+ * shouldn't grab on. Below the ~7 m/s a sprint-into-wall carries.
602
+ */
593
603
  minSpeed: number;
594
604
  /** Player must be airborne at least this long before wall-run can
595
605
  * engage — prevents wall-run triggering off a jump's first frames. */
@@ -1 +1 @@
1
- {"version":3,"file":"FirstPersonPlayerControllerConfig.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerConfig.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;QACI,qDAAqD;;QAErD,2BAA2B;;QAE3B;;yBAEiB;;QAEjB,8CAA8C;;QAE9C,iFAAiF;;QAEjF,oFAAoF;;QAEpF;;;;;;;;;WASG;;MAEL;IAMF;;;;QAII,iEAAiE;;QAEjE;;;;;;;;;;;;;;;;;;;WAmBG;;QAEH,kEAAkE;;QAElE,oDAAoD;;QAEpD;;;;;WAKG;;QAEH;;;;WAIG;;MAEL;IAEF;QACI,2CAA2C;;QAE3C,sEAAsE;;;;QAItE,kDAAkD;;QAElD,iEAAiE;;;;;;MAMnE;IAEF;QACI,yDAAyD;;QAEzD,yDAAyD;;;YAGrD,oDAAoD;;YAEpD,0BAA0B;;;;gBAItB,mEAAmE;;;;MAI7E;IAEF;QACI,gEAAgE;;QAEhE,yBAAyB;;MAE3B;IAEF;;;;;;OAMG;IACH;QACI,yDAAyD;;QAEzD;+EACuE;;QAEvE,4DAA4D;;QAE5D,0EAA0E;;QAE1E;kEAC0D;;MAE5D;IAEF;;;;OAIG;IACH;QACI,6EAA6E;;QAE7E,oDAAoD;;QAEpD;0DACkD;;MAEpD;IAEF;;;;;;OAMG;IACH;QACI;;qBAEa;;QAEb;;sBAEc;;QAEd;0EACkE;;QAElE;iEACyD;;QAEzD;;;gCAGwB;;MAE1B;IAEF;;;;;;OAMG;IACH;QACI;oDAC4C;;QAE5C;;qEAE6D;;QAE7D;8DACsD;;QAEtD;;2B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Root":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerConfig.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;QACI,qDAAqD;;QAErD,2BAA2B;;QAE3B;;yBAEiB;;QAEjB,8CAA8C;;QAE9C,iFAAiF;;QAEjF,oFAAoF;;QAEpF;;;;;;;;;WASG;;MAEL;IAMF;;;;QAII,iEAAiE;;QAEjE;;;;;;;;;;;;;;;;;;;WAmBG;;QAEH,kEAAkE;;QAElE,oDAAoD;;QAEpD;;;;;WAKG;;QAEH;;;;WAIG;;MAEL;IAEF;QACI,2CAA2C;;QAE3C,sEAAsE;;;;QAItE,kDAAkD;;QAElD,iEAAiE;;;;;;MAMnE;IAEF;QACI,yDAAyD;;QAEzD,yDAAyD;;;YAGrD,oDAAoD;;YAEpD,0BAA0B;;;;gBAItB,mEAAmE;;;;MAI7E;IAEF;QACI,gEAAgE;;QAEhE,yBAAyB;;MAE3B;IAEF;;;;;;OAMG;IACH;QACI;;;;;WAKG;;QAEH;+EACuE;;QAEvE,4DAA4D;;QAE5D,0EAA0E;;QAE1E;kEAC0D;;MAE5D;IAEF;;;;OAIG;IACH;QACI,6EAA6E;;QAE7E,oDAAoD;;QAEpD;0DACkD;;MAEpD;IAEF;;;;;;OAMG;IACH;QACI;;qBAEa;;QAEb;;sBAEc;;QAEd;0EACkE;;QAElE;iEACyD;;QAEzD;;;gCAGwB;;MAE1B;IAEF;;;;;;OAMG;IACH;QACI;oDAC4C;;QAE5C;;qEAE6D;;QAE7D;8DACsD;;QAEtD;;2BAEmB;;MAErB;IAEF;;;;OAIG;IACH;QACI;;;;;;;;;;;;;;WAcG;;QAEH,oEAAoE;;QAEpE;qEAC6D;;QAE7D;;0EAEkE;;QAElE;;6CAEqC;;QAErC;4DACoD;;MAEtD;IAEF;;;;;QAKI,0DAA0D;;;QAG1D,sDAAsD;;QAEtD;;;;;;;WAOG;;QAEH;;;;;;;WAOG;;QAEH,qEAAqE;;QAErE;;;;;;WA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;mFACuE;;YAEvE,4DAA4D;;YAE5D,0EAA0E;;YAE1E;sEAC0D;;;;YAU1D,6EAA6E;;YAE7E,oDAAoD;;YAEpD;8DACkD;;;;YA+DlD;;;;;;;;;;;;;;eAcG;;YAEH,oEAAoE;;YAEpE;yEAC6D;;YAE7D;;8EAEkE;;YAElE;;iDAEqC;;YAErC;gEACoD;;;;;;;;YASpD,0DAA0D;;;YAG1D,sDAAsD;;YAEtD;;;;;;;eAOG;;YAEH;;;;;;;eAOG;;YAEH,qEAAqE;;YAErE;;;;;;eAMG;;YAEH;;;;;;;;;;;eAWG;;;;YAIH;;;;;;;;;eASG;;;;;;;;;;YAWH,8CAA8C;;YAE9C;;;;;;;;;;;;;;;;;;eAkBG;;YAEH;;iEAEqD;;;;YAMrD,wEAAwE;;YAExE,+DAA+D;;YAI/D,+DAA+D;;YAE/D;6EACiE;;YAEjE;;;;;eAKG;;YAEH,yDAAyD;;YAIzD,sEAAsE;;YAEtE,2EAA2E;;YAI3E;6EACiE;;YAEjE;yEAC6D;;YAE7D,sDAAsD;;;;;;;;;YAMtD,kDAAkD;;YAGlD;;;eAGG;;YAEH;;;;eAIG;;YAEH;oEACwD;;YAExD;;;;;;;eAOG;;;;;;;;;;;;;;;YA0BH,mFAAmF;;YAEnF,wDAAwD;;YAExD,iFAAiF;;;;YAKjF;;uEAE2D;;;MA+B9D;IAED,0BAmCC;IAED;;OAEG;IACH,YAFW,iCAAiC,QAI3C;IAED,2CAIC;CACJ"}
@@ -135,8 +135,13 @@ export class FirstPersonPlayerControllerConfig {
135
135
  * registered.
136
136
  */
137
137
  wallRun = {
138
- /** Minimum horizontal speed (m/s) to engage wall-run. */
139
- minSpeed: 4.0,
138
+ /**
139
+ * Minimum horizontal speed (m/s) to engage wall-run. Set ABOVE
140
+ * walkSpeed (4.5) so a wall-run is earned by a committed RUN — a walk
141
+ * into the wall, or falling alongside it with leftover momentum,
142
+ * shouldn't grab on. Below the ~7 m/s a sprint-into-wall carries.
143
+ */
144
+ minSpeed: 5.5,
140
145
  /** Player must be airborne at least this long before wall-run can
141
146
  * engage — prevents wall-run triggering off a jump's first frames. */
142
147
  minAirborneTime: 0.1,
@@ -182,6 +182,19 @@ export class FirstPersonPlayerControllerSystem extends System<any, any, any, any
182
182
  * @param {number} dt
183
183
  */
184
184
  private _integrateVerticalAndResolveGround;
185
+ /**
186
+ * Resolve the current `runtime.velocity*` against the world — the
187
+ * physics-backed {@link KinematicMover} (recover + sweep-and-slide +
188
+ * ground-categorize) when a PhysicsSystem is present, else the no-physics
189
+ * flat-ground fallback. Gravity is NOT applied here: the standard path
190
+ * applies it in {@link _applyGravity} just before, and abilities with a
191
+ * non-standard vertical model (WallRun's reduced gravity) apply their own
192
+ * and then call this directly — so motion routes through one motor for
193
+ * everyone (sweep-and-slide, anti-tunnel, land/leave events) rather than
194
+ * a bespoke `position._add` + hand-rolled ground-catch.
195
+ * @private
196
+ */
197
+ private _resolveMotion;
185
198
  /**
186
199
  * Motor: integrate gravity into `velocityY` with the fall / variable-
187
200
  * cut multipliers. The mover never invents motion, so gravity lives
@@ -1 +1 @@
1
- {"version":3,"file":"FirstPersonPlayerControllerSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerSystem.js"],"names":[],"mappings":"AAgTA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACI,cAkFC;IAzEG,wEAA4D;IAE5D,gKAIC;IAED;;;OAGG;IACH,SAFU,IAAI,MAAM,EAAE,gBAAgB,CAAC,CAEf;IAExB;;;;OAIG;IACH,sBAFU,OAAO,CAEe;IAEhC;;;;OAIG;IACH,SAFU,MAAM,CAEA;IAEhB;;;;;;;;;;;;;;;;OAgBG;IACH,oBAFc,MAAM,KAAI,MAAM,KAAI,MAAM,KAAK,MAAM,GAAC,IAAI,CAE9B;IAE1B;;;;;;;OAOG;IACH,eAFU,aAAa,GAAC,IAAI,CAEH;IAEzB;;;;;;;;OAQG;IACH,eAAkB;IAClB,+DAA+D;IAC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kBAAkB;+BAdV,8BAA8B;mCAkB1B,iCAAiC"}
1
+ {"version":3,"file":"FirstPersonPlayerControllerSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerSystem.js"],"names":[],"mappings":"AAgTA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACI,cAkFC;IAzEG,wEAA4D;IAE5D,gKAIC;IAED;;;OAGG;IACH,SAFU,IAAI,MAAM,EAAE,gBAAgB,CAAC,CAEf;IAExB;;;;OAIG;IACH,sBAFU,OAAO,CAEe;IAEhC;;;;OAIG;IACH,SAFU,MAAM,CAEA;IAEhB;;;;;;;;;;;;;;;;OAgBG;IACH,oBAFc,MAAM,KAAI,MAAM,KAAI,MAAM,KAAK,MAAM,GAAC,IAAI,CAE9B;IAE1B;;;;;;;OAOG;IACH,eAFU,aAAa,GAAC,IAAI,CAEH;IAEzB;;;;;;;;OAQG;IACH,eAAkB;IAClB,+DAA+D;IAC/D,uBAAmC;IACnC,yDAAyD;IACzD,oBAA6B;IAC7B,2CAA2C;IAC3C,oBAA4C;IAGhD,2CAMC;IAED;;;;OAIG;IACH,iBAJW,2BAA2B,iBAC3B,SAAS,UACT,MAAM,QAkHhB;IAED;;;;OAIG;IACH,mBAJW,2BAA2B,iBAC3B,SAAS,UACT,MAAM,QAWhB;IAED;;;;;;;;OAQG;IACH,mBAHW,MAAM,GACJ,gBAAgB,GAAC,SAAS,CAItC;IAUG,mBAAoB;IAYpB,yBAA0B;IAI9B;;;;OAIG;IACH,oBA0UC;IAED;;;;;OAKG;IACH;;;;;;;;;;;;;;OAcG;IACH,2BAaC;IAED,2EAkCC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,2BASC;IAED;;;;;;;;;;;OAWG;IACH,wBA0EC;IAED;;;;;;;;;;;;;OAaG;IACH,2CAIC;IAED;;;;;;;;;;;OAWG;IACH,uBAMC;IAED;;;;;OAKG;IACH,sBAWC;IAED;;;;;OAKG;IACH,sBAgDC;IAED;;;;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0EAA0E;IAC1E,qBAAqB;IACrB,+DAA+D;IAC/D,iBAAoB;IACpB,oDAAoD;IACpD,mBAAsB;IAEtB,2EAA2E;IAC3E,wBAAwB;IACxB,gFAAgF;IAChF,wBAAwB;IACxB,+DAA+D;IAC/D,qBAAuB;IACvB;;;;;;;;;;OAUG;IACH,qBAAuB;IAEvB;;;;;;OAMG;IACH,qBAAqB;IAErB;;;;OAIG;IACH,2BAAsC;IAEtC;;;;OAIG;IACH,6BAAwC;IAExC;;;;;OAKG;IACH,4BAAuC;IAEvC;;;;OAIG;IACH,wBAAmC;IAEnC;;;;OAIG;IACH,mBAAmB;IAEnB;;;;;OAKG;IACH,eAAe;IACf,eAAe;IAEf,8EAA8E;IAC9E,mBAAmB;IAEnB,4FAA4F;IAC5F,qBAAqB;IAErB;;;;;OAKG;IACH,+BAA0C;IAE1C;;;;;OAKG;IACH,4BAAuC;IAEvC,sDAAsD;IACtD,kBAAmB;CAE1B;8BA3R6B,oCAAoC;yBADzC,+BAA+B;uBASjC,kBAAkB;+BAdV,8BAA8B;mCAkB1B,iCAAiC"}
@@ -1128,14 +1128,28 @@ export class FirstPersonPlayerControllerSystem extends System {
1128
1128
  */
1129
1129
  _integrateVerticalAndResolveGround(controller, runtime, bodyTransform, dt) {
1130
1130
  this._applyGravity(controller, runtime, dt);
1131
+ this._resolveMotion(controller, runtime, bodyTransform, dt);
1132
+ this._detectJumpApex(controller, runtime, bodyTransform);
1133
+ }
1131
1134
 
1135
+ /**
1136
+ * Resolve the current `runtime.velocity*` against the world — the
1137
+ * physics-backed {@link KinematicMover} (recover + sweep-and-slide +
1138
+ * ground-categorize) when a PhysicsSystem is present, else the no-physics
1139
+ * flat-ground fallback. Gravity is NOT applied here: the standard path
1140
+ * applies it in {@link _applyGravity} just before, and abilities with a
1141
+ * non-standard vertical model (WallRun's reduced gravity) apply their own
1142
+ * and then call this directly — so motion routes through one motor for
1143
+ * everyone (sweep-and-slide, anti-tunnel, land/leave events) rather than
1144
+ * a bespoke `position._add` + hand-rolled ground-catch.
1145
+ * @private
1146
+ */
1147
+ _resolveMotion(controller, runtime, bodyTransform, dt) {
1132
1148
  if (this.physicsSystem !== null) {
1133
1149
  this._moveViaMover(controller, runtime, bodyTransform, dt);
1134
1150
  } else {
1135
1151
  this._moveFlatGround(controller, runtime, bodyTransform, dt);
1136
1152
  }
1137
-
1138
- this._detectJumpApex(controller, runtime, bodyTransform);
1139
1153
  }
1140
1154
 
1141
1155
  /**
@@ -94,17 +94,19 @@ The legacy `_moveAndSlide` + scalar-resolver regime was replaced by the
94
94
  `collision/KinematicMover` rebuild (Phases 1–4; see DESIGN_COLLISION.md).
95
95
  Slide-along-walls (axis + oblique), vertical anti-tunnel (floors and
96
96
  ceilings), depenetration, slopes, stick-to-ground, and stairs all landed
97
- there. Remaining:
98
-
99
- ### Route WallRun through the mover
100
- Slide already routes its motion through the mover (it calls
101
- `_integrateVerticalAndResolveGround` `_moveViaMover`). **WallRun still
102
- self-integrates** its reduced-gravity model and so doesn't get
103
- sweep-and-slide a wall-runner can still drift into / off geometry the
104
- mover would have resolved. Thread WallRun's per-tick motion through
105
- `mover.move()` (keeping its reduced-gravity as the vertical input). The
106
- gating issue (a usable surface normal) is solved now — `result.groundNormal`
107
- and the narrowphase contact normals are available.
97
+ there.
98
+
99
+ ### Route WallRun through the mover ✅ done
100
+ WallRun used to self-integrate its reduced-gravity model (`position._add`
101
+ + a hand-rolled groundResolver catch), so it got no sweep-and-slide and
102
+ could drift into / off geometry. It now applies its reduced gravity and
103
+ routes the move through the shared `_resolveMotion` (the mover when
104
+ physics is present, else the flat-ground fallback) — same motor as base
105
+ locomotion and Slide. So **every** motion path goes through one collision
106
+ seam now: it can't drift into a wall (the sweep clips it) nor sail off a
107
+ ledge / through a floor the mover would catch. Guard: `WallRun.spec.js`
108
+ "physics: a wall-runner slides along a real wall and is caught by the
109
+ mover's real floor". No remaining collision follow-ups.
108
110
 
109
111
  ## Other open notes
110
112
 
@@ -1 +1 @@
1
- {"version":3,"file":"WallJump.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/abilities/WallJump.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IAOI,kEAoBC;IAED,gDAgDC;IAED;;;;;OAKG;IACH,wBAEC;IAED,4FAKC;CACJ;wBAhIuB,cAAc"}
1
+ {"version":3,"file":"WallJump.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/abilities/WallJump.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IAOI,kEA4BC;IAED,gDAgDC;IAED;;;;;OAKG;IACH,wBAEC;IAED,4FAKC;CACJ;wBAxIuB,cAAc"}
@@ -52,11 +52,19 @@ export class WallJump extends Ability {
52
52
  // Must be airborne — wall-jump from the ground is just a jump.
53
53
  if (controller.state.grounded) return false;
54
54
 
55
- // At least one side wall within the near-wall distance.
55
+ // At least one side wall within reach. From an ACTIVE wall-run the
56
+ // wall is right there by definition — allow the kick regardless of
57
+ // distance (the wall-run pins the player at the sensor's edge, which
58
+ // is beyond nearWallMaxDistance, so gating the canonical wall-run →
59
+ // wall-jump chain on the near distance would make it misfire).
60
+ // Otherwise (near-wall airborne, not committed) require the closer
61
+ // distance so a stray nearby wall doesn't grant a free jump.
62
+ const onWallRun = controller.abilities.active !== null
63
+ && controller.abilities.active.name === "WallRun";
56
64
  const left = sensors.wallLeft;
57
65
  const right = sensors.wallRight;
58
- const leftClose = left.hit && left.distance <= cfg.nearWallMaxDistance;
59
- const rightClose = right.hit && right.distance <= cfg.nearWallMaxDistance;
66
+ const leftClose = left.hit && (onWallRun || left.distance <= cfg.nearWallMaxDistance);
67
+ const rightClose = right.hit && (onWallRun || right.distance <= cfg.nearWallMaxDistance);
60
68
  if (!leftClose && !rightClose) return false;
61
69
 
62
70
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"WallRun.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/abilities/WallRun.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAMQ,qDAAqD;IACrD,iBAAiB;IACjB,yDAAyD;IACzD,cAAgB;IAGpB,kEAiBC;IAED,gDAqBC;IAED;;;;OAIG;IACH,wBAEC;IAED,uFAiFC;CAKJ;wBAlLuB,cAAc"}
1
+ {"version":3,"file":"WallRun.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/abilities/WallRun.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAMQ,qDAAqD;IACrD,iBAAiB;IACjB,yDAAyD;IACzD,cAAgB;IAGpB,kEA6BC;IAED,gDAqBC;IAED;;;;OAIG;IACH,wBAEC;IAED,uFAgEC;CAKJ;wBA7KuB,cAAc"}
@@ -56,6 +56,18 @@ export class WallRun extends Ability {
56
56
  // Forward intent required — wall-run is a committed action.
57
57
  if (controller.intent.move.y < 0.1) return false;
58
58
 
59
+ // Don't (re)grab a wall you're moving AWAY from. The wall normal
60
+ // points off the wall toward the player, so velocity·normal > 0 means
61
+ // leaving it — most importantly right after a wall-JUMP pushed you off
62
+ // (else the run would re-attach next tick and the tangent projection
63
+ // would cancel the kick). Approaching (dot < 0) or running along it
64
+ // (dot ≈ 0) is fine.
65
+ const hit = sensors.wallLeft.hit
66
+ && (!sensors.wallRight.hit || sensors.wallLeft.distance <= sensors.wallRight.distance)
67
+ ? sensors.wallLeft : sensors.wallRight;
68
+ const awaySpeed = runtime.velocityX * hit.normal.x + runtime.velocityZ * hit.normal.z;
69
+ if (awaySpeed > cfg.minSpeed * 0.5) return false;
70
+
59
71
  return true;
60
72
  }
61
73
 
@@ -131,43 +143,26 @@ export class WallRun extends Ability {
131
143
  const rollSign = this._side === "L" ? -1 : 1;
132
144
  runtime.leanTargetRad = rollSign * cfg.cameraRollDeg * DEG_TO_RAD;
133
145
 
134
- // -- Reduced gravity.
146
+ // -- Reduced gravity. This is wall-run's OWN vertical model (a
147
+ // fraction of base gravity, no fall multiplier), applied here rather
148
+ // than via the system's standard gravity step.
135
149
  runtime.velocityY -= runtime.gravity * cfg.gravityFactor * dt;
136
150
 
137
- // -- Integrate position (manual don't call the system's vertical
138
- // phase because that would re-apply gravity with the fall multiplier).
139
- bodyTransform.position._add(
140
- runtime.velocityX * dt,
141
- runtime.velocityY * dt,
142
- runtime.velocityZ * dt,
143
- );
144
-
145
- // -- Ground catch. Reduced gravity is still gravity; over the
146
- // wall-run's lifetime the player drifts down. Without a ground
147
- // check here, the player can integrate PAST the floor — at
148
- // which point the wall sensor eventually drops out, base
149
- // resumes, and base's downward groundResolver raycast (from
150
- // below the floor) doesn't find anything above. Player free-
151
- // falls forever.
152
- //
153
- // Consult the same effective ground the base integrator uses:
154
- // max(useBuiltInFlatGround baseline, groundResolver). If we've
155
- // sunk to or past it, snap, zero vy, and release — base will
156
- // mark grounded on the next tick.
157
- let groundY = system.useBuiltInFlatGround ? system.groundY : null;
158
- if (system.groundResolver !== null) {
159
- const resolved = system.groundResolver(
160
- bodyTransform.position.x,
161
- bodyTransform.position.y,
162
- bodyTransform.position.z,
163
- );
164
- if (resolved !== null && (groundY === null || resolved > groundY)) {
165
- groundY = resolved;
166
- }
167
- }
168
- if (groundY !== null && bodyTransform.position.y <= groundY) {
169
- bodyTransform.position.setY(groundY);
170
- runtime.velocityY = 0;
151
+ // -- Resolve the move through the shared motor. With the reduced-
152
+ // gravity velocity set above, route it through the same sweep-and-
153
+ // slide + ground-categorize the base locomotion uses (the mover when
154
+ // physics is present, else the flat-ground fallback). _resolveMotion
155
+ // does NOT re-apply gravity. This replaces a raw `position._add` plus
156
+ // a hand-rolled groundResolver catch: the wall-runner now (a) can't
157
+ // drift INTO geometry (the sweep clips it) nor sail OFF a ledge the
158
+ // mover would have caught, and (b) gets the motor's anti-tunnel
159
+ // ground catch for free the same reason base no longer free-falls
160
+ // past a floor. The motor sets `state.grounded` and fires land/leave.
161
+ system._resolveMotion(controller, runtime, bodyTransform, dt);
162
+
163
+ // -- Exit: the motor caught a floor at the wall's foot (we ran out
164
+ // onto the ground). Release; base resumes next tick.
165
+ if (controller.state.grounded) {
171
166
  return false;
172
167
  }
173
168
 
@@ -45,11 +45,12 @@ export class KinematicMover {
45
45
  * `MIN_WALK_NORMAL` / Source `normal.z ≥ 0.7`.
46
46
  * @param {number} [options.stepHeight=0.3] maximum step the player
47
47
  * traverses, both up and down:
48
- * - UP: ground-categorize mounts the player onto a surface up to
49
- * `stepHeight` above the feet (a step the capsule's leading edge
50
- * reaches); a taller riser isn't mounted and the slide blocks it.
51
- * The capsule's round bottom does the actual climbing motion;
52
- * `stepHeight` is the gate on how high categorize will stick.
48
+ * - UP: a riser no taller than this is climbed — by the explicit
49
+ * step-up ({@link _tryStepUp}, up-forward-down, which works
50
+ * regardless of forward momentum) and by `_categorizeGround`
51
+ * mounting the player onto a surface within `stepHeight` of the
52
+ * feet. A taller riser blocks (the slide stops the player; the
53
+ * step-up's forward clearance cast detects the wall and aborts).
53
54
  * - DOWN: the ground-stick reach — walking off a drop no larger
54
55
  * than this snaps the player onto the lower surface (stays
55
56
  * grounded); a larger drop goes airborne (a real ledge).
@@ -76,6 +77,7 @@ export class KinematicMover {
76
77
  _penDir: Float64Array;
77
78
  _planes: Float64Array;
78
79
  _cand: Float64Array;
80
+ _support: Float64Array;
79
81
  /**
80
82
  * Reused result. `grounded` / `groundNormal` are Phase 2 outputs;
81
83
  * in Phase 1 they're left at their defaults (the mover doesn't
@@ -110,6 +112,34 @@ export class KinematicMover {
110
112
  grounded: boolean;
111
113
  groundNormal: Vector3;
112
114
  };
115
+ /**
116
+ * Stair step-up. Called after a slide that hit something while the
117
+ * player was trying to move horizontally on the ground. Re-runs the
118
+ * horizontal move from the pre-slide position lifted by `stepHeight`,
119
+ * guarded by a forward CLEARANCE cast: if the path is still blocked at
120
+ * the lifted height the obstacle is taller than a step (a wall) and we
121
+ * abandon the attempt; if clear it's a step, so advance over it and
122
+ * drop. Commits only when it advances farther horizontally than the
123
+ * plain slide and the rise is within `stepHeight`. On success the
124
+ * horizontal velocity is restored (the riser wasn't a wall) so the
125
+ * controller doesn't read back a stalled speed; the vertical is left
126
+ * for `_categorizeGround` to settle on the step.
127
+ *
128
+ * @private
129
+ */
130
+ private _tryStepUp;
131
+ /**
132
+ * Distance the shape can sweep along a unit axis before contact (less
133
+ * `skin`), or the full `maxDist` if clear. For the step-up lift/drop.
134
+ * @private
135
+ */
136
+ private _castDistance;
137
+ /**
138
+ * True when a centre raycast at (x,y,z) finds a walkable surface
139
+ * within stick range — gates step-up on "actually standing".
140
+ * @private
141
+ */
142
+ private _groundedAt;
113
143
  /**
114
144
  * Push the capsule out of any geometry it currently overlaps. Each
115
145
  * pass queries overlaps, finds the single deepest penetration via
@@ -1 +1 @@
1
- {"version":3,"file":"KinematicMover.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/collision/KinematicMover.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,2BA7BW,OAAO,uCAAuC,EAAE,aAAa,OAC7D,OAAO,wCAAwC,EAAE,sBAAsB;QAKtD,IAAI,GAArB,MAAM;QAEW,kBAAkB,GAAnC,MAAM;QAEW,oBAAoB,GAArC,MAAM;QAEW,aAAa,GAA9B,MAAM;QAIW,UAAU,GAA3B,MAAM;OAqChB;IAvBG,6EAAkC;IAClC,6EAAc;IACd,aAA6D;IAC7D,2BAAmG;IACnG,6BAAyG;IACzG,sBAAsF;IACtF,mBAA6E;IAG7E,WAAsB;IACtB,0BAAqC;IACrC,yBAAsC;IACtC,sBAAkC;IAClC,sBAAoD;IACpD,oBAAgC;IAEhC;;;;;OAKG;IACH,SAFU;QAAC,GAAG,EAAC,OAAO,CAAC;QAAC,QAAQ,EAAC,OAAO,CAAC;QAAC,YAAY,EAAC,OAAO,CAAA;KAAC,CAEmB;IAGtF;;;;;;;;;;;;OAYG;IACH,eATW,OAAO,YACP;QAAC,CAAC,EAAC,MAAM,CAAC;QAAA,CAAC,EAAC,MAAM,CAAC;QAAA,CAAC,EAAC,MAAM,CAAC;QAAA,CAAC,EAAC,MAAM,CAAA;KAAC,SACrC,OAAO,mDAAmD,EAAE,eAAe,YAC3E,OAAO,MACP,MAAM,mBACE,MAAM,YAAW,QAAQ,KAAG,OAAO,GAEzC;QAAC,GAAG,EAAC,OAAO,CAAC;QAAC,QAAQ,EAAC,OAAO,CAAC;QAAC,YAAY,EAAC,OAAO,CAAA;KAAC,CA+BjE;IAED;;;;;;;;;OASG;IACH,iBAwCC;IAED;;;;;;;;OAQG;IACH,eA0HC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,0BAgDC;IAED;;;;;OAKG;IACH,cAKC;CACJ;qBAtaoB,sCAAsC;oCAIvB,iDAAiD;oBALjE,kCAAkC;yBAG7B,kCAAkC"}
1
+ {"version":3,"file":"KinematicMover.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/collision/KinematicMover.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,2BA9BW,OAAO,uCAAuC,EAAE,aAAa,OAC7D,OAAO,wCAAwC,EAAE,sBAAsB;QAKtD,IAAI,GAArB,MAAM;QAEW,kBAAkB,GAAnC,MAAM;QAEW,oBAAoB,GAArC,MAAM;QAEW,aAAa,GAA9B,MAAM;QAIW,UAAU,GAA3B,MAAM;OAuChB;IAxBG,6EAAkC;IAClC,6EAAc;IACd,aAA6D;IAC7D,2BAAmG;IACnG,6BAAyG;IACzG,sBAAsF;IACtF,mBAA6E;IAG7E,WAAsB;IACtB,0BAAqC;IACrC,yBAAsC;IACtC,sBAAkC;IAClC,sBAAoD;IACpD,oBAAgC;IAChC,uBAAmC;IAEnC;;;;;OAKG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