@codexo/exojs-physics 0.15.3 → 0.16.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 (201) hide show
  1. package/README.md +51 -23
  2. package/dist/esm/Aabb.d.ts +6 -10
  3. package/dist/esm/Aabb.d.ts.map +1 -0
  4. package/dist/esm/Aabb.js +9 -5
  5. package/dist/esm/Aabb.js.map +1 -1
  6. package/dist/esm/Collider.d.ts +62 -10
  7. package/dist/esm/Collider.d.ts.map +1 -0
  8. package/dist/esm/Collider.js +263 -157
  9. package/dist/esm/Collider.js.map +1 -1
  10. package/dist/esm/ContactGraph.d.ts +51 -5
  11. package/dist/esm/ContactGraph.d.ts.map +1 -0
  12. package/dist/esm/ContactGraph.js +282 -223
  13. package/dist/esm/ContactGraph.js.map +1 -1
  14. package/dist/esm/ContactModifier.d.ts +85 -0
  15. package/dist/esm/ContactModifier.d.ts.map +1 -0
  16. package/dist/esm/ContactModifier.js +49 -0
  17. package/dist/esm/ContactModifier.js.map +1 -0
  18. package/dist/esm/PhysicsBody.d.ts +56 -22
  19. package/dist/esm/PhysicsBody.d.ts.map +1 -0
  20. package/dist/esm/PhysicsBody.js +461 -443
  21. package/dist/esm/PhysicsBody.js.map +1 -1
  22. package/dist/esm/PhysicsWorld.d.ts +276 -43
  23. package/dist/esm/PhysicsWorld.d.ts.map +1 -0
  24. package/dist/esm/PhysicsWorld.js +890 -626
  25. package/dist/esm/PhysicsWorld.js.map +1 -1
  26. package/dist/esm/TimeStepper.d.ts +3 -2
  27. package/dist/esm/TimeStepper.d.ts.map +1 -0
  28. package/dist/esm/TimeStepper.js +56 -67
  29. package/dist/esm/TimeStepper.js.map +1 -1
  30. package/dist/esm/backend/NativePhysicsBackend.d.ts +8 -4
  31. package/dist/esm/backend/NativePhysicsBackend.d.ts.map +1 -0
  32. package/dist/esm/backend/NativePhysicsBackend.js +48 -41
  33. package/dist/esm/backend/NativePhysicsBackend.js.map +1 -1
  34. package/dist/esm/backend/PhysicsBackend.d.ts +9 -2
  35. package/dist/esm/backend/PhysicsBackend.d.ts.map +1 -0
  36. package/dist/esm/binding/BindingRegistry.d.ts +25 -4
  37. package/dist/esm/binding/BindingRegistry.d.ts.map +1 -0
  38. package/dist/esm/binding/BindingRegistry.js +70 -36
  39. package/dist/esm/binding/BindingRegistry.js.map +1 -1
  40. package/dist/esm/binding/PhysicsBinding.d.ts +22 -5
  41. package/dist/esm/binding/PhysicsBinding.d.ts.map +1 -0
  42. package/dist/esm/binding/PhysicsBinding.js +46 -21
  43. package/dist/esm/binding/PhysicsBinding.js.map +1 -1
  44. package/dist/esm/broadphase/AabbTreeBroadPhase.d.ts +68 -0
  45. package/dist/esm/broadphase/AabbTreeBroadPhase.d.ts.map +1 -0
  46. package/dist/esm/broadphase/AabbTreeBroadPhase.js +149 -0
  47. package/dist/esm/broadphase/AabbTreeBroadPhase.js.map +1 -0
  48. package/dist/esm/broadphase/BroadPhase.d.ts +7 -4
  49. package/dist/esm/broadphase/BroadPhase.d.ts.map +1 -0
  50. package/dist/esm/broadphase/index.d.ts +2 -1
  51. package/dist/esm/broadphase/index.d.ts.map +1 -0
  52. package/dist/esm/collision/CollisionProxy.d.ts +3 -2
  53. package/dist/esm/collision/CollisionProxy.d.ts.map +1 -0
  54. package/dist/esm/collision/Manifold.d.ts +5 -4
  55. package/dist/esm/collision/Manifold.d.ts.map +1 -0
  56. package/dist/esm/collision/Manifold.js +34 -25
  57. package/dist/esm/collision/Manifold.js.map +1 -1
  58. package/dist/esm/collision/chainAdjacency.d.ts +29 -0
  59. package/dist/esm/collision/chainAdjacency.d.ts.map +1 -0
  60. package/dist/esm/collision/chainAdjacency.js +44 -0
  61. package/dist/esm/collision/chainAdjacency.js.map +1 -0
  62. package/dist/esm/collision/dispatch.d.ts +35 -0
  63. package/dist/esm/collision/dispatch.d.ts.map +1 -0
  64. package/dist/esm/collision/dispatch.js +58 -0
  65. package/dist/esm/collision/dispatch.js.map +1 -0
  66. package/dist/esm/collision/index.d.ts +2 -0
  67. package/dist/esm/collision/index.d.ts.map +1 -0
  68. package/dist/esm/collision/narrowphase.d.ts +5 -2
  69. package/dist/esm/collision/narrowphase.d.ts.map +1 -0
  70. package/dist/esm/collision/narrowphase.js +524 -399
  71. package/dist/esm/collision/narrowphase.js.map +1 -1
  72. package/dist/esm/collision/segments.d.ts +19 -0
  73. package/dist/esm/collision/segments.d.ts.map +1 -0
  74. package/dist/esm/collision/segments.js +36 -0
  75. package/dist/esm/collision/segments.js.map +1 -0
  76. package/dist/esm/collision/sweep.d.ts +35 -0
  77. package/dist/esm/collision/sweep.d.ts.map +1 -0
  78. package/dist/esm/collision/sweep.js +437 -0
  79. package/dist/esm/collision/sweep.js.map +1 -0
  80. package/dist/esm/debug/PhysicsDebugDraw.d.ts +23 -4
  81. package/dist/esm/debug/PhysicsDebugDraw.d.ts.map +1 -0
  82. package/dist/esm/debug/PhysicsDebugDraw.js +230 -188
  83. package/dist/esm/debug/PhysicsDebugDraw.js.map +1 -1
  84. package/dist/esm/debug/index.d.ts +1 -0
  85. package/dist/esm/debug/index.d.ts.map +1 -0
  86. package/dist/esm/debug/index.js +3 -2
  87. package/dist/esm/events.d.ts +1 -0
  88. package/dist/esm/events.d.ts.map +1 -0
  89. package/dist/esm/index.d.ts +1 -0
  90. package/dist/esm/index.d.ts.map +1 -0
  91. package/dist/esm/index.js +24 -19
  92. package/dist/esm/joints/DistanceJoint.d.ts +4 -3
  93. package/dist/esm/joints/DistanceJoint.d.ts.map +1 -0
  94. package/dist/esm/joints/DistanceJoint.js +160 -172
  95. package/dist/esm/joints/DistanceJoint.js.map +1 -1
  96. package/dist/esm/joints/Joint.d.ts +5 -4
  97. package/dist/esm/joints/Joint.d.ts.map +1 -0
  98. package/dist/esm/joints/Joint.js +23 -21
  99. package/dist/esm/joints/Joint.js.map +1 -1
  100. package/dist/esm/joints/MouseJoint.d.ts +8 -7
  101. package/dist/esm/joints/MouseJoint.d.ts.map +1 -0
  102. package/dist/esm/joints/MouseJoint.js +132 -133
  103. package/dist/esm/joints/MouseJoint.js.map +1 -1
  104. package/dist/esm/joints/PrismaticJoint.d.ts +5 -4
  105. package/dist/esm/joints/PrismaticJoint.d.ts.map +1 -0
  106. package/dist/esm/joints/PrismaticJoint.js +211 -240
  107. package/dist/esm/joints/PrismaticJoint.js.map +1 -1
  108. package/dist/esm/joints/RevoluteJoint.d.ts +4 -3
  109. package/dist/esm/joints/RevoluteJoint.d.ts.map +1 -0
  110. package/dist/esm/joints/RevoluteJoint.js +191 -213
  111. package/dist/esm/joints/RevoluteJoint.js.map +1 -1
  112. package/dist/esm/joints/WeldJoint.d.ts +3 -2
  113. package/dist/esm/joints/WeldJoint.d.ts.map +1 -0
  114. package/dist/esm/joints/WeldJoint.js +156 -152
  115. package/dist/esm/joints/WeldJoint.js.map +1 -1
  116. package/dist/esm/joints/WheelJoint.d.ts +4 -3
  117. package/dist/esm/joints/WheelJoint.d.ts.map +1 -0
  118. package/dist/esm/joints/WheelJoint.js +228 -255
  119. package/dist/esm/joints/WheelJoint.js.map +1 -1
  120. package/dist/esm/math.d.ts +6 -9
  121. package/dist/esm/math.d.ts.map +1 -0
  122. package/dist/esm/math.js +37 -39
  123. package/dist/esm/math.js.map +1 -1
  124. package/dist/esm/physicsBuildInfo.d.ts +1 -0
  125. package/dist/esm/physicsBuildInfo.d.ts.map +1 -0
  126. package/dist/esm/physicsBuildInfo.js +6 -4
  127. package/dist/esm/physicsBuildInfo.js.map +1 -1
  128. package/dist/esm/public.d.ts +8 -3
  129. package/dist/esm/public.d.ts.map +1 -0
  130. package/dist/esm/query/QueryEngine.d.ts +56 -12
  131. package/dist/esm/query/QueryEngine.d.ts.map +1 -0
  132. package/dist/esm/query/QueryEngine.js +494 -237
  133. package/dist/esm/query/QueryEngine.js.map +1 -1
  134. package/dist/esm/query/SpatialIndex.d.ts +34 -0
  135. package/dist/esm/query/SpatialIndex.d.ts.map +1 -0
  136. package/dist/esm/shapes/AnyShape.d.ts +9 -4
  137. package/dist/esm/shapes/AnyShape.d.ts.map +1 -0
  138. package/dist/esm/shapes/BoxShape.d.ts +2 -1
  139. package/dist/esm/shapes/BoxShape.d.ts.map +1 -0
  140. package/dist/esm/shapes/BoxShape.js +37 -25
  141. package/dist/esm/shapes/BoxShape.js.map +1 -1
  142. package/dist/esm/shapes/CapsuleShape.d.ts +30 -0
  143. package/dist/esm/shapes/CapsuleShape.d.ts.map +1 -0
  144. package/dist/esm/shapes/CapsuleShape.js +88 -0
  145. package/dist/esm/shapes/CapsuleShape.js.map +1 -0
  146. package/dist/esm/shapes/ChainEdgeShape.d.ts +30 -0
  147. package/dist/esm/shapes/ChainEdgeShape.d.ts.map +1 -0
  148. package/dist/esm/shapes/ChainEdgeShape.js +66 -0
  149. package/dist/esm/shapes/ChainEdgeShape.js.map +1 -0
  150. package/dist/esm/shapes/ChainShape.d.ts +52 -0
  151. package/dist/esm/shapes/ChainShape.d.ts.map +1 -0
  152. package/dist/esm/shapes/ChainShape.js +85 -0
  153. package/dist/esm/shapes/ChainShape.js.map +1 -0
  154. package/dist/esm/shapes/CircleShape.d.ts +3 -4
  155. package/dist/esm/shapes/CircleShape.d.ts.map +1 -0
  156. package/dist/esm/shapes/CircleShape.js +27 -26
  157. package/dist/esm/shapes/CircleShape.js.map +1 -1
  158. package/dist/esm/shapes/PolygonShape.d.ts +7 -8
  159. package/dist/esm/shapes/PolygonShape.d.ts.map +1 -0
  160. package/dist/esm/shapes/PolygonShape.js +131 -162
  161. package/dist/esm/shapes/PolygonShape.js.map +1 -1
  162. package/dist/esm/shapes/SegmentShape.d.ts +31 -0
  163. package/dist/esm/shapes/SegmentShape.d.ts.map +1 -0
  164. package/dist/esm/shapes/SegmentShape.js +62 -0
  165. package/dist/esm/shapes/SegmentShape.js.map +1 -0
  166. package/dist/esm/shapes/Shape.d.ts +28 -17
  167. package/dist/esm/shapes/Shape.d.ts.map +1 -0
  168. package/dist/esm/shapes/Shape.js +12 -13
  169. package/dist/esm/shapes/Shape.js.map +1 -1
  170. package/dist/esm/shapes/convexParts.d.ts +21 -0
  171. package/dist/esm/shapes/convexParts.d.ts.map +1 -0
  172. package/dist/esm/shapes/convexParts.js +26 -0
  173. package/dist/esm/shapes/convexParts.js.map +1 -0
  174. package/dist/esm/shapes/decompose.d.ts +24 -0
  175. package/dist/esm/shapes/decompose.d.ts.map +1 -0
  176. package/dist/esm/shapes/decompose.js +272 -0
  177. package/dist/esm/shapes/decompose.js.map +1 -0
  178. package/dist/esm/shapes/index.d.ts +4 -0
  179. package/dist/esm/shapes/index.d.ts.map +1 -0
  180. package/dist/esm/solver/ContactSolver.d.ts +12 -5
  181. package/dist/esm/solver/ContactSolver.d.ts.map +1 -0
  182. package/dist/esm/solver/ContactSolver.js +425 -471
  183. package/dist/esm/solver/ContactSolver.js.map +1 -1
  184. package/dist/esm/solver/tolerances.d.ts +34 -0
  185. package/dist/esm/solver/tolerances.d.ts.map +1 -0
  186. package/dist/esm/solver/tolerances.js +38 -0
  187. package/dist/esm/solver/tolerances.js.map +1 -0
  188. package/dist/esm/sort.d.ts +5 -4
  189. package/dist/esm/sort.d.ts.map +1 -0
  190. package/dist/esm/sort.js +41 -51
  191. package/dist/esm/sort.js.map +1 -1
  192. package/dist/esm/types.d.ts +4 -8
  193. package/dist/esm/types.d.ts.map +1 -0
  194. package/dist/esm/types.js +15 -17
  195. package/dist/esm/types.js.map +1 -1
  196. package/package.json +6 -6
  197. package/dist/esm/broadphase/SweepAndPrune.d.ts +0 -15
  198. package/dist/esm/broadphase/SweepAndPrune.js +0 -77
  199. package/dist/esm/broadphase/SweepAndPrune.js.map +0 -1
  200. package/dist/esm/debug/index.js.map +0 -1
  201. package/dist/esm/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ContactSolver.js","sources":["../../../../src/solver/ContactSolver.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGA;AAEA;;;;;;AAMG;AACH,MAAM,IAAI,GAAG,IAAI;AACjB;;;;AAIG;AAC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G,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC;AAExG;;;;;AAKG;AACH,MAAM,CAAC,GAAG,CAAC,GAAsB,EAAE,CAAS,KAAa,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;;;;"}
1
+ {"version":3,"file":"ContactSolver.js","names":[],"sources":["../../../src/solver/ContactSolver.ts"],"sourcesContent":["import type { ContactRecord } from '../ContactGraph';\nimport type { PhysicsBody } from '../PhysicsBody';\nimport { contactSlop } from './tolerances';\n\n/** Relative normal speed (px/s) below which a contact is treated as resting (no restitution). */\nconst restitutionThreshold = 1;\n/**\n * Cap on the soft-constraint push-out velocity (px/s). Bounds how fast the bias\n * resolves deep penetration so a large overlap cannot fling bodies apart; the\n * Box2D-v3 analogue is `contactSpeed = 3·lengthUnit`, retuned for ExoJS pixels.\n */\nconst maxBiasVelocity = 4;\n/** Reject the 2-point block solve when the contact matrix is worse-conditioned than this (fall back to sequential). */\nconst maxConditionNumber = 1000;\n\n/**\n * Per-contact velocity constraint (1-2 points), computed once per **frame** in\n * {@link ContactSolver.prepare} and reused across all sub-steps and passes.\n * Pooled and reused across frames, so a steady-state step constructs no\n * constraint of its own. It is not allocation-free in the wider sense: a double\n * handed to a function the optimiser declines to inline is boxed on the heap for\n * the duration of that call, which is why the hot paths below apply their\n * results in place instead of through helpers.\n */\nclass ContactConstraint {\n public record!: ContactRecord;\n public bodyA!: PhysicsBody;\n public bodyB!: PhysicsBody;\n public nx = 0;\n public ny = 0;\n public tx = 0;\n public ty = 0;\n public friction = 0;\n public restitution = 0;\n public pointCount = 0;\n\n // Soft-constraint factors (Box2D-v3 \"soft step\"), derived once per frame from\n // contactHertz/dampingRatio and the sub-step `h`. Shared by both points.\n public biasRate = 0;\n public massScale = 1;\n public impulseScale = 0;\n\n // Per-point contact arms at frame start (relative to each body's centre of mass).\n public readonly rAx = [0, 0];\n public readonly rAy = [0, 0];\n public readonly rBx = [0, 0];\n public readonly rBy = [0, 0];\n // Per-point arms rotated by the live sub-step rotation (refreshed each pass by\n // {@link ContactSolver._updateArms}); the solve reads these so a rotating body's\n // contact torque tracks its current orientation.\n public readonly rotAx = [0, 0];\n public readonly rotAy = [0, 0];\n public readonly rotBx = [0, 0];\n public readonly rotBy = [0, 0];\n public readonly normalMass = [0, 0];\n public readonly tangentMass = [0, 0];\n /** Contact separation at frame start (= −penetration; negative when overlapping). */\n public readonly baseSeparation = [0, 0];\n /** Relative normal velocity at frame start (the impact speed the restitution pass keys off). */\n public readonly relativeVelocity = [0, 0];\n /** Push-out target normal velocity for the current pass (set per pass from the live separation). */\n public readonly velocityBias = [0, 0];\n /**\n * Whether the point's push-out target was clamped to `maxBiasVelocity` this\n * pass. A clamped target is no longer the spring response the soft scaling\n * models, so the single-point solve drops that scaling while it holds.\n */\n public readonly biasClamped = [false, false];\n\n // 2-point block: the contact matrix `K` and its inverse (set only when the\n // manifold has two points and `K` is well-conditioned; else sequential).\n public block = false;\n public k11 = 0;\n public k12 = 0;\n public k22 = 0;\n public invK11 = 0;\n public invK12 = 0;\n public invK22 = 0;\n}\n\n/**\n * Native warm-started **TGS-Soft** contact solver (Box2D-v3 \"soft step\"). Driven\n * by {@link PhysicsWorld} as a sub-stepping loop: detection runs once per frame,\n * then {@link prepare} builds the per-contact constraints (effective masses,\n * frame-start separation + impact velocity, soft factors, and a 2×2 block matrix\n * for two-point manifolds) **once**, and each sub-step runs\n * {@link warmStart} → {@link solveVelocities}(useBias=true) → integrate positions\n * → {@link solveVelocities}(useBias=false) relax. A final {@link applyRestitution}\n * pass adds bounce above the threshold.\n *\n * The position constraint is folded into the velocity solve as a **soft bias**\n * (a damped-spring push-out whose stiffness is decoupled from the iteration\n * count), recomputed each pass from the live per-body delta position/rotation -\n * so there is no separate NGS geometric pass. The contact anchors are rotated by\n * the live sub-step rotation each pass, so a tilting stack's restoring torque is\n * computed against its current orientation (without this the tilt grows instead\n * of being corrected). Two-point manifolds still solve the normal impulses **as a\n * 2×2 block LCP** (Box2D-style), which propagates stack loads far better than\n * solving the points sequentially; the block path carries the soft push-out as\n * its velocity target (hard mass scale), while single-point contacts use the full\n * soft mass/impulse scaling for as long as their push-out target stays inside\n * the cap, and the hard scale once it is clamped. Accumulated impulses are\n * written back to each {@link ContactRecord} for warm-starting the next frame.\n *\n * Internal to {@link NativePhysicsBackend}; not part of the public surface.\n */\nexport class ContactSolver {\n private readonly _constraints: ContactConstraint[] = [];\n private _count = 0;\n\n /**\n * Build the per-contact constraints for this frame from the touching solid\n * contacts. `h` is the sub-step duration (`fixedDelta / subStepCount`); the\n * soft factors are derived from it together with `contactHertz`/`dampingRatio`.\n * Runs once per frame (detection is not repeated per sub-step).\n */\n public prepare(contacts: readonly ContactRecord[], h: number, contactHertz: number, dampingRatio: number): void {\n this._count = 0;\n\n // Box2D-v3 soft-constraint factors from a damped spring (hertz, zeta) at the\n // sub-step `h`: omega = 2πf; a1 = 2ζ + hω; a2 = hω·a1; a3 = 1/(1+a2).\n const omega = 2 * Math.PI * contactHertz;\n const a1 = 2 * dampingRatio + h * omega;\n const a2 = h * omega * a1;\n const a3 = 1 / (1 + a2);\n const biasRate = contactHertz > 0 ? omega / a1 : 0;\n const massScale = contactHertz > 0 ? a2 * a3 : 1;\n const impulseScale = contactHertz > 0 ? a3 : 0;\n\n for (const contact of contacts) {\n const manifold = contact.manifold;\n const pointCount = manifold.pointCount;\n\n // A contact the world's `ContactModifier` disabled for this step stays\n // touching geometrically but applies no impulse.\n if (pointCount === 0 || !contact.enabled) {\n continue;\n }\n\n const bodyA = contact.a.body;\n const bodyB = contact.b.body;\n\n // Skip contacts where either body is asleep: a sleeping island's solid\n // contacts are all sleeping↔sleeping or sleeping↔static (both at rest), so\n // there is nothing to solve. A sleeping body touched by an awake one is\n // woken (island merge) before this runs, so it is never skipped wrongly.\n if (bodyA.isSleeping || bodyB.isSleeping) {\n continue;\n }\n\n const constraint = this._acquire();\n const nx = manifold.normalX;\n const ny = manifold.normalY;\n const tx = -ny;\n const ty = nx;\n\n constraint.record = contact;\n constraint.bodyA = bodyA;\n constraint.bodyB = bodyB;\n constraint.nx = nx;\n constraint.ny = ny;\n constraint.tx = tx;\n constraint.ty = ty;\n // Per-step values: derived from the two colliders each pass, then possibly\n // overridden by the world's `ContactModifier`.\n constraint.friction = contact.friction;\n constraint.restitution = contact.restitution;\n constraint.pointCount = pointCount;\n constraint.block = false;\n constraint.biasRate = biasRate;\n constraint.massScale = massScale;\n constraint.impulseScale = impulseScale;\n\n const mA = bodyA.invMass;\n const mB = bodyB.invMass;\n const iA = bodyA.invInertia;\n const iB = bodyB.invInertia;\n const comAx = bodyA.worldCenterOfMassX;\n const comAy = bodyA.worldCenterOfMassY;\n const comBx = bodyB.worldCenterOfMassX;\n const comBy = bodyB.worldCenterOfMassY;\n\n for (let i = 0; i < pointCount; i++) {\n // i in 0..pointCount-1 and pointCount ≤ 2, so the manifold point exists.\n const point = i === 0 ? manifold.points[0] : manifold.points[1];\n const rAx = point.x - comAx;\n const rAy = point.y - comAy;\n const rBx = point.x - comBx;\n const rBy = point.y - comBy;\n\n constraint.rAx[i] = rAx;\n constraint.rAy[i] = rAy;\n constraint.rBx[i] = rBx;\n constraint.rBy[i] = rBy;\n // Frame start: no accumulated rotation yet, so the live arms equal the base arms.\n constraint.rotAx[i] = rAx;\n constraint.rotAy[i] = rAy;\n constraint.rotBx[i] = rBx;\n constraint.rotBy[i] = rBy;\n\n const rnA = rAx * ny - rAy * nx;\n const rnB = rBx * ny - rBy * nx;\n const kn = mA + mB + iA * rnA * rnA + iB * rnB * rnB;\n const rtA = rAx * ty - rAy * tx;\n const rtB = rBx * ty - rBy * tx;\n const kt = mA + mB + iA * rtA * rtA + iB * rtB * rtB;\n\n constraint.normalMass[i] = kn > 0 ? 1 / kn : 0;\n constraint.tangentMass[i] = kt > 0 ? 1 / kt : 0;\n constraint.baseSeparation[i] = -point.penetration;\n constraint.velocityBias[i] = 0;\n\n // Frame-start relative normal velocity (the true impact speed, captured\n // before this frame's gravity since prepare runs ahead of the sub-step\n // loop) - keys the restitution pass so a resting contact does not\n // perpetually micro-bounce off the per-step gravity increment.\n constraint.relativeVelocity[i] = normalVelocity(bodyA, bodyB, rAx, rAy, rBx, rBy, nx, ny);\n }\n\n if (pointCount === 2) {\n const rn1A = n(constraint.rAx, 0) * ny - n(constraint.rAy, 0) * nx;\n const rn1B = n(constraint.rBx, 0) * ny - n(constraint.rBy, 0) * nx;\n const rn2A = n(constraint.rAx, 1) * ny - n(constraint.rAy, 1) * nx;\n const rn2B = n(constraint.rBx, 1) * ny - n(constraint.rBy, 1) * nx;\n const k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B;\n const k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B;\n const k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B;\n const det = k11 * k22 - k12 * k12;\n\n // Only block-solve when `K` is well-conditioned (parallel-ish contacts\n // produce a near-singular matrix → fall back to sequential).\n if (det > 0 && k11 * k11 < maxConditionNumber * det) {\n const invDet = 1 / det;\n\n constraint.k11 = k11;\n constraint.k12 = k12;\n constraint.k22 = k22;\n constraint.invK11 = invDet * k22;\n constraint.invK12 = -invDet * k12;\n constraint.invK22 = invDet * k11;\n constraint.block = true;\n }\n }\n }\n }\n\n /** Re-apply the cached impulses from the previous frame (warm-starting); runs each sub-step. */\n public warmStart(): void {\n for (let ci = 0; ci < this._count; ci++) {\n const constraint = this._at(ci);\n const bodyA = constraint.bodyA;\n const bodyB = constraint.bodyB;\n\n this._updateArms(constraint);\n\n for (let i = 0; i < constraint.pointCount; i++) {\n const normalImpulse = n(constraint.record.normalImpulse, i);\n const tangentImpulse = n(constraint.record.tangentImpulse, i);\n const jx = normalImpulse * constraint.nx + tangentImpulse * constraint.tx;\n const jy = normalImpulse * constraint.ny + tangentImpulse * constraint.ty;\n\n applyImpulse(bodyA, bodyB, n(constraint.rotAx, i), n(constraint.rotAy, i), n(constraint.rotBx, i), n(constraint.rotBy, i), jx, jy);\n }\n }\n }\n\n /**\n * One velocity pass over every contact: the normal constraint (block when\n * possible) then friction (Coulomb cone). With `useBias` the normal solve\n * carries the soft push-out bias (the main pass, recomputed from the live\n * separation); without it the relax pass drives the normal velocity to zero so\n * the bias velocity does not remain in the bodies as injected energy.\n */\n public solveVelocities(useBias: boolean): void {\n for (let ci = 0; ci < this._count; ci++) {\n this._solveVelocityContact(this._at(ci), useBias);\n }\n }\n\n /**\n * Restitution pass, run once after the sub-step loop. For each loaded point\n * whose frame-start impact speed exceeded the threshold, add the impulse that\n * brings the post-solve normal velocity to `−restitution·impactSpeed`. Kept\n * separate from the main solve so resting contacts (impact below threshold) do\n * not micro-bounce.\n */\n public applyRestitution(): void {\n for (let ci = 0; ci < this._count; ci++) {\n const constraint = this._at(ci);\n\n if (constraint.restitution === 0) {\n continue;\n }\n\n const bodyA = constraint.bodyA;\n const bodyB = constraint.bodyB;\n const nx = constraint.nx;\n const ny = constraint.ny;\n\n this._updateArms(constraint);\n\n for (let i = 0; i < constraint.pointCount; i++) {\n const relativeVelocity = n(constraint.relativeVelocity, i);\n\n // Only points that carried load (normalImpulse > 0) and were struck\n // above the resting threshold bounce.\n if (relativeVelocity > -restitutionThreshold || n(constraint.record.normalImpulse, i) <= 0) {\n continue;\n }\n\n const rAx = n(constraint.rotAx, i);\n const rAy = n(constraint.rotAy, i);\n const rBx = n(constraint.rotBx, i);\n const rBy = n(constraint.rotBy, i);\n const vn = normalVelocity(bodyA, bodyB, rAx, rAy, rBx, rBy, nx, ny);\n const oldNormal = n(constraint.record.normalImpulse, i);\n const newNormal = Math.max(0, oldNormal - n(constraint.normalMass, i) * (vn + constraint.restitution * relativeVelocity));\n const deltaNormal = newNormal - oldNormal;\n\n constraint.record.normalImpulse[i] = newNormal;\n applyImpulse(bodyA, bodyB, rAx, rAy, rBx, rBy, deltaNormal * nx, deltaNormal * ny);\n }\n }\n }\n\n /** Refresh the live (rotated) contact arms from each body's accumulated sub-step rotation. */\n private _updateArms(constraint: ContactConstraint): void {\n const cosA = constraint.bodyA._deltaCos;\n const sinA = constraint.bodyA._deltaSin;\n const cosB = constraint.bodyB._deltaCos;\n const sinB = constraint.bodyB._deltaSin;\n\n for (let i = 0; i < constraint.pointCount; i++) {\n const rAx = n(constraint.rAx, i);\n const rAy = n(constraint.rAy, i);\n const rBx = n(constraint.rBx, i);\n const rBy = n(constraint.rBy, i);\n\n constraint.rotAx[i] = rAx * cosA - rAy * sinA;\n constraint.rotAy[i] = rAx * sinA + rAy * cosA;\n constraint.rotBx[i] = rBx * cosB - rBy * sinB;\n constraint.rotBy[i] = rBx * sinB + rBy * cosB;\n }\n }\n\n private _solveVelocityContact(constraint: ContactConstraint, useBias: boolean): void {\n this._updateArms(constraint);\n\n // Recompute the per-point push-out target from the live separation (folds the\n // position constraint into the velocity solve as a soft bias). With useBias\n // off (relax pass) the target is zero - the plain hard normal solve.\n for (let i = 0; i < constraint.pointCount; i++) {\n // Push out only the penetration beyond the slop, capped - leaving the slop\n // keeps the contact overlapping so the narrow phase does not drop it.\n const excess = -currentSeparation(constraint, i) - contactSlop;\n const target = useBias && excess > 0 ? constraint.biasRate * excess : 0;\n\n constraint.velocityBias[i] = Math.min(target, maxBiasVelocity);\n constraint.biasClamped[i] = target > maxBiasVelocity;\n }\n\n // Normal before friction (Box2D-v3 order): friction's Coulomb cone clamps to\n // `μ·normalImpulse`, so it must see this pass's freshly-solved normal impulse -\n // solving friction first uses last pass's cone and lets stacks creep laterally.\n if (constraint.block) {\n this._solveNormalBlock(constraint);\n } else {\n this._solveNormalSequential(constraint, useBias);\n }\n\n this._solveFriction(constraint);\n }\n\n /** Per-point friction: clamp the accumulated tangent impulse to the Coulomb cone `±μ·normalImpulse`. */\n private _solveFriction(constraint: ContactConstraint): void {\n const bodyA = constraint.bodyA;\n const bodyB = constraint.bodyB;\n\n for (let i = 0; i < constraint.pointCount; i++) {\n const rAx = n(constraint.rotAx, i);\n const rAy = n(constraint.rotAy, i);\n const rBx = n(constraint.rotBx, i);\n const rBy = n(constraint.rotBy, i);\n const vtX = bodyB.linearVelocityX - bodyB.angularVelocity * rBy - (bodyA.linearVelocityX - bodyA.angularVelocity * rAy);\n const vtY = bodyB.linearVelocityY + bodyB.angularVelocity * rBx - (bodyA.linearVelocityY + bodyA.angularVelocity * rAx);\n const vt = vtX * constraint.tx + vtY * constraint.ty;\n const maxFriction = constraint.friction * n(constraint.record.normalImpulse, i);\n const oldTangent = n(constraint.record.tangentImpulse, i);\n const newTangent = clamp(oldTangent - n(constraint.tangentMass, i) * vt, -maxFriction, maxFriction);\n const deltaTangent = newTangent - oldTangent;\n\n constraint.record.tangentImpulse[i] = newTangent;\n applyImpulse(bodyA, bodyB, rAx, rAy, rBx, rBy, deltaTangent * constraint.tx, deltaTangent * constraint.ty);\n }\n }\n\n /**\n * Single-point (or ill-conditioned) soft normal solve, accumulated and clamped\n * ≥ 0. The Box2D-v3 incremental form: with the soft bias active the impulse is\n * `−normalMass·massScale·(vn − bias) − impulseScale·accumulated`, which both\n * pushes out the penetration and bleeds a little stored impulse (the damped\n * spring). The relax pass passes `useBias=false`, collapsing it to the hard\n * `−normalMass·vn` (no bias, full mass, no impulse decay).\n *\n * A point whose push-out target was clamped to `maxBiasVelocity` is solved\n * with the hard scale as well: the soft scaling models a spring, and once the\n * target is capped the point would otherwise reach only a fraction of an\n * already limited push-out. That deficit grows with the load, so past the\n * acceleration at which the cap binds the contact would sink without bound\n * instead of settling into a slightly deeper limit cycle.\n */\n private _solveNormalSequential(constraint: ContactConstraint, useBias: boolean): void {\n const bodyA = constraint.bodyA;\n const bodyB = constraint.bodyB;\n const nx = constraint.nx;\n const ny = constraint.ny;\n\n for (let i = 0; i < constraint.pointCount; i++) {\n const rAx = n(constraint.rotAx, i);\n const rAy = n(constraint.rotAy, i);\n const rBx = n(constraint.rotBx, i);\n const rBy = n(constraint.rotBy, i);\n const vn = normalVelocity(bodyA, bodyB, rAx, rAy, rBx, rBy, nx, ny);\n const oldNormal = n(constraint.record.normalImpulse, i);\n // A clamped push-out target is a fixed velocity goal, not a spring\n // response: scaling it down by `massScale` would leave the point short of\n // a target that is already capped, and the deficit is what removes the\n // fixpoint once the cap binds. Solve those points hard, as the two-point\n // block path always does.\n const clamped = constraint.biasClamped[i] ?? false;\n const massScale = useBias && !clamped ? constraint.massScale : 1;\n const impulseScale = useBias && !clamped ? constraint.impulseScale : 0;\n const impulse = -n(constraint.normalMass, i) * massScale * (vn - n(constraint.velocityBias, i)) - impulseScale * oldNormal;\n const newNormal = Math.max(0, oldNormal + impulse);\n const deltaNormal = newNormal - oldNormal;\n\n constraint.record.normalImpulse[i] = newNormal;\n applyImpulse(bodyA, bodyB, rAx, rAy, rBx, rBy, deltaNormal * nx, deltaNormal * ny);\n }\n }\n\n /**\n * Two-point block normal solve (Box2D LCP): find both new normal impulses\n * `x ≥ 0` so the post-solve normal velocities equal the push-out targets\n * (`velocityBias`, zero in the relax pass) and are complementary, trying the\n * four corners (both active, one active, none). The block path carries the\n * soft push-out as its target but solves with a hard mass scale.\n */\n private _solveNormalBlock(constraint: ContactConstraint): void {\n const bodyA = constraint.bodyA;\n const bodyB = constraint.bodyB;\n const nx = constraint.nx;\n const ny = constraint.ny;\n const a1 = n(constraint.record.normalImpulse, 0);\n const a2 = n(constraint.record.normalImpulse, 1);\n const vn1 = normalVelocity(bodyA, bodyB, n(constraint.rotAx, 0), n(constraint.rotAy, 0), n(constraint.rotBx, 0), n(constraint.rotBy, 0), nx, ny);\n const vn2 = normalVelocity(bodyA, bodyB, n(constraint.rotAx, 1), n(constraint.rotAy, 1), n(constraint.rotBx, 1), n(constraint.rotBy, 1), nx, ny);\n\n // Residual at the current impulse: b = (vn − bias) − K·a.\n const bx = vn1 - n(constraint.velocityBias, 0) - (constraint.k11 * a1 + constraint.k12 * a2);\n const by = vn2 - n(constraint.velocityBias, 1) - (constraint.k12 * a1 + constraint.k22 * a2);\n\n // Case 1 - both points active: x = −K⁻¹·b.\n let x1 = -(constraint.invK11 * bx + constraint.invK12 * by);\n let x2 = -(constraint.invK12 * bx + constraint.invK22 * by);\n let solved = x1 >= 0 && x2 >= 0;\n\n if (!solved) {\n // Case 2 - only point 1 active (x2 = 0).\n x1 = -n(constraint.normalMass, 0) * bx;\n x2 = 0;\n solved = x1 >= 0 && constraint.k12 * x1 + by >= 0;\n }\n\n if (!solved) {\n // Case 3 - only point 2 active (x1 = 0).\n x1 = 0;\n x2 = -n(constraint.normalMass, 1) * by;\n solved = x2 >= 0 && constraint.k12 * x2 + bx >= 0;\n }\n\n if (!solved) {\n // Case 4 - neither active (separating). Only valid when both residuals are\n // non-negative; otherwise no corner applies and the impulses stay put.\n if (bx < 0 || by < 0) {\n return;\n }\n\n x1 = 0;\n x2 = 0;\n }\n\n // Applied here rather than through a helper: the deltas are freshly computed\n // doubles, and passing them across a call the optimiser declines to inline\n // boxes each one on the heap for the duration of the call.\n const d1 = x1 - a1;\n const d2 = x2 - a2;\n const jx = (d1 + d2) * nx;\n const jy = (d1 + d2) * ny;\n const torqueA = (n(constraint.rotAx, 0) * ny - n(constraint.rotAy, 0) * nx) * d1 + (n(constraint.rotAx, 1) * ny - n(constraint.rotAy, 1) * nx) * d2;\n const torqueB = (n(constraint.rotBx, 0) * ny - n(constraint.rotBy, 0) * nx) * d1 + (n(constraint.rotBx, 1) * ny - n(constraint.rotBy, 1) * nx) * d2;\n\n bodyA.linearVelocityX -= jx * bodyA.invMass;\n bodyA.linearVelocityY -= jy * bodyA.invMass;\n bodyA.angularVelocity -= torqueA * bodyA.invInertia;\n bodyB.linearVelocityX += jx * bodyB.invMass;\n bodyB.linearVelocityY += jy * bodyB.invMass;\n bodyB.angularVelocity += torqueB * bodyB.invInertia;\n\n constraint.record.normalImpulse[0] = x1;\n constraint.record.normalImpulse[1] = x2;\n }\n\n private _acquire(): ContactConstraint {\n if (this._count === this._constraints.length) {\n this._constraints.push(new ContactConstraint());\n }\n\n return this._at(this._count++);\n }\n\n /**\n * Pooled constraint at `ci`. Every caller indexes within `0..this._count-1`\n * and `_count` never exceeds the pool length, so the entry always exists; the\n * throw is unreachable and only discharges `noUncheckedIndexedAccess` without a\n * cast or non-null assertion.\n */\n private _at(ci: number): ContactConstraint {\n const constraint = this._constraints[ci];\n\n if (constraint === undefined) {\n throw new RangeError(`ContactSolver: constraint pool index ${ci} out of range.`);\n }\n\n return constraint;\n }\n}\n\n/**\n * Live contact separation at point `i`, recomputed from each body's accumulated\n * delta position plus the rotation-induced shift of the (rotated) anchor since\n * frame start, projected onto the normal. Negative when overlapping. This is what\n * folds the position constraint into the velocity solve without a separate\n * geometric pass or re-running detection per sub-step.\n */\nconst currentSeparation = (constraint: ContactConstraint, i: number): number => {\n const bodyA = constraint.bodyA;\n const bodyB = constraint.bodyB;\n // Anchor displacement since frame start = linear delta + (rotated arm − base arm).\n const dispAx = bodyA._deltaPosX + n(constraint.rotAx, i) - n(constraint.rAx, i);\n const dispAy = bodyA._deltaPosY + n(constraint.rotAy, i) - n(constraint.rAy, i);\n const dispBx = bodyB._deltaPosX + n(constraint.rotBx, i) - n(constraint.rBx, i);\n const dispBy = bodyB._deltaPosY + n(constraint.rotBy, i) - n(constraint.rBy, i);\n\n return n(constraint.baseSeparation, i) + (dispBx - dispAx) * constraint.nx + (dispBy - dispAy) * constraint.ny;\n};\n\n/** Relative normal velocity at a contact point: `dot(vB + ωB×rB − vA − ωA×rA, n)`. */\nconst normalVelocity = (bodyA: PhysicsBody, bodyB: PhysicsBody, rAx: number, rAy: number, rBx: number, rBy: number, nx: number, ny: number): number => {\n const dvx = bodyB.linearVelocityX - bodyB.angularVelocity * rBy - (bodyA.linearVelocityX - bodyA.angularVelocity * rAy);\n const dvy = bodyB.linearVelocityY + bodyB.angularVelocity * rBx - (bodyA.linearVelocityY + bodyA.angularVelocity * rAx);\n\n return dvx * nx + dvy * ny;\n};\n\n/** Apply impulse `(jx, jy)` to B and its negation to A about their contact arms. */\nconst applyImpulse = (bodyA: PhysicsBody, bodyB: PhysicsBody, rAx: number, rAy: number, rBx: number, rBy: number, jx: number, jy: number): void => {\n bodyA.linearVelocityX -= jx * bodyA.invMass;\n bodyA.linearVelocityY -= jy * bodyA.invMass;\n bodyA.angularVelocity -= (rAx * jy - rAy * jx) * bodyA.invInertia;\n\n bodyB.linearVelocityX += jx * bodyB.invMass;\n bodyB.linearVelocityY += jy * bodyB.invMass;\n bodyB.angularVelocity += (rBx * jy - rBy * jx) * bodyB.invInertia;\n};\n\nconst clamp = (value: number, low: number, high: number): number => Math.min(Math.max(value, low), high);\n\n/**\n * In-bounds read of a fixed-size (length-2) per-point scratch array. Every\n * caller indexes within `0..pointCount-1` (pointCount ≤ 2), so the element\n * always exists; the `0` fallback only discharges `noUncheckedIndexedAccess`\n * for the unreachable case and keeps the `??` out of caller complexity.\n */\nconst n = (arr: readonly number[], i: number): number => arr[i] ?? 0;\n"],"mappings":";;;;;;;;AAWA,MAAM,kBAAkB;;AAExB,MAAM,qBAAqB;;;;;;;;;;AAW3B,IAAM,oBAAN,MAAwB;CACtB,AAAO;CACP,AAAO;CACP,AAAO;CACP,AAAO,KAAK;CACZ,AAAO,KAAK;CACZ,AAAO,KAAK;CACZ,AAAO,KAAK;CACZ,AAAO,WAAW;CAClB,AAAO,cAAc;CACrB,AAAO,aAAa;CAIpB,AAAO,WAAW;CAClB,AAAO,YAAY;CACnB,AAAO,eAAe;CAGtB,AAAgB,MAAM,CAAC,GAAG,CAAC;CAC3B,AAAgB,MAAM,CAAC,GAAG,CAAC;CAC3B,AAAgB,MAAM,CAAC,GAAG,CAAC;CAC3B,AAAgB,MAAM,CAAC,GAAG,CAAC;CAI3B,AAAgB,QAAQ,CAAC,GAAG,CAAC;CAC7B,AAAgB,QAAQ,CAAC,GAAG,CAAC;CAC7B,AAAgB,QAAQ,CAAC,GAAG,CAAC;CAC7B,AAAgB,QAAQ,CAAC,GAAG,CAAC;CAC7B,AAAgB,aAAa,CAAC,GAAG,CAAC;CAClC,AAAgB,cAAc,CAAC,GAAG,CAAC;;CAEnC,AAAg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AAM,MAAM,MAAM;CAEvD,MAAM,mBAAmB,KAAK,MAAM;CACpC,MAAM,mBAAmB,KAAK,MAAM;CACpC,MAAM,oBAAoB,MAAM,KAAK,MAAM,MAAM,MAAM;AACzD;AAEA,MAAM,SAAS,OAAe,KAAa,SAAyB,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,IAAI;;;;;;;AAQvG,MAAM,KAAK,KAAwB,MAAsB,IAAI,MAAM"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Penetration allowance (px) the soft bias leaves uncorrected. The narrow phase
3
+ * only produces a manifold while the colliders overlap, so pushing penetration
4
+ * fully to zero lets a resting contact wink out for a frame (free-fall, then
5
+ * re-detect) - a periodic energy spike. Leaving a small slop keeps the contact
6
+ * persistently overlapping and the warm-start cache alive.
7
+ * @internal
8
+ */
9
+ export declare const contactSlop = 0.25;
10
+ /**
11
+ * Penetration (px) above which a contact still counts as unresolved for the
12
+ * sleep decision, so neither of its bodies may bank sleep time.
13
+ *
14
+ * The solver drives every resting contact down to {@link contactSlop}, but only
15
+ * at a capped push-out speed that is below the sleep velocity threshold: a body
16
+ * that landed hard therefore looks motionless long before its overlap is worked
17
+ * off, and sleeping it would freeze it visibly embedded. Both sides must read
18
+ * the same tolerance, or the sleep gate and the constraint it is gating drift
19
+ * apart.
20
+ *
21
+ * The value is empirical, not derived: a face contact converges to exactly one
22
+ * slop at any gravity, but a single-point contact rests one static spring
23
+ * deflection deeper, and that offset grows with gravity (0.28 px at
24
+ * 1 000 px/s², 0.53 px at 10 000, 0.67 px at 15 000). Three slops clears that
25
+ * envelope for the gravity range the engine is tuned for while staying far
26
+ * below the failure it gates, which starts at several px. Beyond roughly
27
+ * 15 000 px/s² the push-out cap binds and the resting depth stops following
28
+ * the deflection law, settling into a narrow limit cycle just below this
29
+ * tolerance instead - so sleep is delayed there rather than granted to an
30
+ * embedded body.
31
+ * @internal
32
+ */
33
+ export declare const sleepPenetrationTolerance: number;
34
+ //# sourceMappingURL=tolerances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tolerances.d.ts","sourceRoot":"","sources":["../../../src/solver/tolerances.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,yBAAyB,QAAkB,CAAC"}
@@ -0,0 +1,38 @@
1
+ //#region src/solver/tolerances.ts
2
+ /**
3
+ * Penetration allowance (px) the soft bias leaves uncorrected. The narrow phase
4
+ * only produces a manifold while the colliders overlap, so pushing penetration
5
+ * fully to zero lets a resting contact wink out for a frame (free-fall, then
6
+ * re-detect) - a periodic energy spike. Leaving a small slop keeps the contact
7
+ * persistently overlapping and the warm-start cache alive.
8
+ * @internal
9
+ */
10
+ const contactSlop = .25;
11
+ /**
12
+ * Penetration (px) above which a contact still counts as unresolved for the
13
+ * sleep decision, so neither of its bodies may bank sleep time.
14
+ *
15
+ * The solver drives every resting contact down to {@link contactSlop}, but only
16
+ * at a capped push-out speed that is below the sleep velocity threshold: a body
17
+ * that landed hard therefore looks motionless long before its overlap is worked
18
+ * off, and sleeping it would freeze it visibly embedded. Both sides must read
19
+ * the same tolerance, or the sleep gate and the constraint it is gating drift
20
+ * apart.
21
+ *
22
+ * The value is empirical, not derived: a face contact converges to exactly one
23
+ * slop at any gravity, but a single-point contact rests one static spring
24
+ * deflection deeper, and that offset grows with gravity (0.28 px at
25
+ * 1 000 px/s², 0.53 px at 10 000, 0.67 px at 15 000). Three slops clears that
26
+ * envelope for the gravity range the engine is tuned for while staying far
27
+ * below the failure it gates, which starts at several px. Beyond roughly
28
+ * 15 000 px/s² the push-out cap binds and the resting depth stops following
29
+ * the deflection law, settling into a narrow limit cycle just below this
30
+ * tolerance instead - so sleep is delayed there rather than granted to an
31
+ * embedded body.
32
+ * @internal
33
+ */
34
+ const sleepPenetrationTolerance = 3 * contactSlop;
35
+
36
+ //#endregion
37
+ export { contactSlop, sleepPenetrationTolerance };
38
+ //# sourceMappingURL=tolerances.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tolerances.js","names":[],"sources":["../../../src/solver/tolerances.ts"],"sourcesContent":["/**\n * Penetration allowance (px) the soft bias leaves uncorrected. The narrow phase\n * only produces a manifold while the colliders overlap, so pushing penetration\n * fully to zero lets a resting contact wink out for a frame (free-fall, then\n * re-detect) - a periodic energy spike. Leaving a small slop keeps the contact\n * persistently overlapping and the warm-start cache alive.\n * @internal\n */\nexport const contactSlop = 0.25;\n\n/**\n * Penetration (px) above which a contact still counts as unresolved for the\n * sleep decision, so neither of its bodies may bank sleep time.\n *\n * The solver drives every resting contact down to {@link contactSlop}, but only\n * at a capped push-out speed that is below the sleep velocity threshold: a body\n * that landed hard therefore looks motionless long before its overlap is worked\n * off, and sleeping it would freeze it visibly embedded. Both sides must read\n * the same tolerance, or the sleep gate and the constraint it is gating drift\n * apart.\n *\n * The value is empirical, not derived: a face contact converges to exactly one\n * slop at any gravity, but a single-point contact rests one static spring\n * deflection deeper, and that offset grows with gravity (0.28 px at\n * 1 000 px/s², 0.53 px at 10 000, 0.67 px at 15 000). Three slops clears that\n * envelope for the gravity range the engine is tuned for while staying far\n * below the failure it gates, which starts at several px. Beyond roughly\n * 15 000 px/s² the push-out cap binds and the resting depth stops following\n * the deflection law, settling into a narrow limit cycle just below this\n * tolerance instead - so sleep is delayed there rather than granted to an\n * embedded body.\n * @internal\n */\nexport const sleepPenetrationTolerance = 3 * contactSlop;\n"],"mappings":";;;;;;;;;AAQA,MAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;AAyB3B,MAAa,4BAA4B,IAAI"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * In-place heap sort deterministic, O(n log n) regardless of input order, and
2
+ * In-place heap sort - deterministic, O(n log n) regardless of input order, and
3
3
  * allocation-free. `Array.prototype.sort` allocates an internal temp buffer in
4
4
  * V8's TimSort for arrays larger than ~10 elements; the broad-phase and contact
5
5
  * sorts run over ~1,000 elements every step, so that temp buffer is per-step
@@ -7,11 +7,12 @@
7
7
  *
8
8
  * Heap sort is not stable, but every physics comparator (`byMinX`, `byPairId`,
9
9
  * `byRecordPair`, `byColliderPair`, `bySensorPair`) breaks ties on collider id,
10
- * so no two elements ever compare equal the ordering is total and therefore
11
- * bit-identical to the `Array.prototype.sort` it replaces (gate SG-D1, replay
10
+ * so no two elements ever compare equal - the ordering is total and therefore
11
+ * bit-identical to the `Array.prototype.sort` it replaces (replay
12
12
  * determinism). Do not use this with a comparator that can return 0 for distinct
13
13
  * elements; the result order would then differ from a stable sort.
14
14
  *
15
15
  * @internal
16
16
  */
17
- export declare function sortInPlace<T>(array: T[], compare: (a: T, b: T) => number): void;
17
+ export declare const sortInPlace: <T>(array: T[], compare: (a: T, b: T) => number) => void;
18
+ //# sourceMappingURL=sort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/sort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,KAAG,IAe5E,CAAC"}
package/dist/esm/sort.js CHANGED
@@ -1,54 +1,44 @@
1
+ //#region src/sort.ts
1
2
  /**
2
- * In-place heap sort deterministic, O(n log n) regardless of input order, and
3
- * allocation-free. `Array.prototype.sort` allocates an internal temp buffer in
4
- * V8's TimSort for arrays larger than ~10 elements; the broad-phase and contact
5
- * sorts run over ~1,000 elements every step, so that temp buffer is per-step
6
- * garbage. Heap sort sorts in place with only a constant number of locals.
7
- *
8
- * Heap sort is not stable, but every physics comparator (`byMinX`, `byPairId`,
9
- * `byRecordPair`, `byColliderPair`, `bySensorPair`) breaks ties on collider id,
10
- * so no two elements ever compare equal the ordering is total and therefore
11
- * bit-identical to the `Array.prototype.sort` it replaces (gate SG-D1, replay
12
- * determinism). Do not use this with a comparator that can return 0 for distinct
13
- * elements; the result order would then differ from a stable sort.
14
- *
15
- * @internal
16
- */
17
- function sortInPlace(array, compare) {
18
- const n = array.length;
19
- // Heapify: turn the array into a max-heap bottom-up.
20
- for (let i = (n >> 1) - 1; i >= 0; i--) {
21
- siftDown(array, i, n, compare);
22
- }
23
- // Repeatedly move the max (root) to the sorted tail, then restore the heap.
24
- for (let end = n - 1; end > 0; end--) {
25
- const root = array[0];
26
- array[0] = array[end];
27
- array[end] = root;
28
- siftDown(array, 0, end, compare);
29
- }
30
- }
31
- function siftDown(array, start, end, compare) {
32
- let parent = start;
33
- for (;;) {
34
- let child = parent * 2 + 1;
35
- if (child >= end) {
36
- break;
37
- }
38
- // Pick the larger of the two children.
39
- if (child + 1 < end && compare(array[child], array[child + 1]) < 0) {
40
- child++;
41
- }
42
- // Parent already dominates the larger child — heap property restored.
43
- if (compare(array[parent], array[child]) >= 0) {
44
- break;
45
- }
46
- const tmp = array[parent];
47
- array[parent] = array[child];
48
- array[child] = tmp;
49
- parent = child;
50
- }
51
- }
3
+ * In-place heap sort - deterministic, O(n log n) regardless of input order, and
4
+ * allocation-free. `Array.prototype.sort` allocates an internal temp buffer in
5
+ * V8's TimSort for arrays larger than ~10 elements; the broad-phase and contact
6
+ * sorts run over ~1,000 elements every step, so that temp buffer is per-step
7
+ * garbage. Heap sort sorts in place with only a constant number of locals.
8
+ *
9
+ * Heap sort is not stable, but every physics comparator (`byMinX`, `byPairId`,
10
+ * `byRecordPair`, `byColliderPair`, `bySensorPair`) breaks ties on collider id,
11
+ * so no two elements ever compare equal - the ordering is total and therefore
12
+ * bit-identical to the `Array.prototype.sort` it replaces (replay
13
+ * determinism). Do not use this with a comparator that can return 0 for distinct
14
+ * elements; the result order would then differ from a stable sort.
15
+ *
16
+ * @internal
17
+ */
18
+ const sortInPlace = (array, compare) => {
19
+ const n = array.length;
20
+ for (let i = (n >> 1) - 1; i >= 0; i--) siftDown(array, i, n, compare);
21
+ for (let end = n - 1; end > 0; end--) {
22
+ const root = array[0];
23
+ array[0] = array[end];
24
+ array[end] = root;
25
+ siftDown(array, 0, end, compare);
26
+ }
27
+ };
28
+ const siftDown = (array, start, end, compare) => {
29
+ let parent = start;
30
+ for (;;) {
31
+ let child = parent * 2 + 1;
32
+ if (child >= end) break;
33
+ if (child + 1 < end && compare(array[child], array[child + 1]) < 0) child++;
34
+ if (compare(array[parent], array[child]) >= 0) break;
35
+ const tmp = array[parent];
36
+ array[parent] = array[child];
37
+ array[child] = tmp;
38
+ parent = child;
39
+ }
40
+ };
52
41
 
42
+ //#endregion
53
43
  export { sortInPlace };
54
- //# sourceMappingURL=sort.js.map
44
+ //# sourceMappingURL=sort.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort.js","sources":["../../../src/sort.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;AAeG;AACG,SAAU,WAAW,CAAI,KAAU,EAAE,OAA+B,EAAA;AACxE,IAAA,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM;;AAGtB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QACtC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC;IAChC;;AAGA,IAAA,KAAK,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE;AACpC,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAE;QACtB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAE;AACtB,QAAA,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI;QACjB,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC;IAClC;AACF;AAEA,SAAS,QAAQ,CAAI,KAAU,EAAE,KAAa,EAAE,GAAW,EAAE,OAA+B,EAAA;IAC1F,IAAI,MAAM,GAAG,KAAK;AAElB,IAAA,SAAS;AACP,QAAA,IAAI,KAAK,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC;AAE1B,QAAA,IAAI,KAAK,IAAI,GAAG,EAAE;YAChB;QACF;;QAGA,IAAI,KAAK,GAAG,CAAC,GAAG,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAE,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC,GAAG,CAAC,EAAE;AACpE,YAAA,KAAK,EAAE;QACT;;AAGA,QAAA,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAE,EAAE,KAAK,CAAC,KAAK,CAAE,CAAC,IAAI,CAAC,EAAE;YAC/C;QACF;AAEA,QAAA,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAE;QAC1B,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAE;AAC7B,QAAA,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG;QAClB,MAAM,GAAG,KAAK;IAChB;AACF;;;;"}
1
+ {"version":3,"file":"sort.js","names":[],"sources":["../../src/sort.ts"],"sourcesContent":["/**\n * In-place heap sort - deterministic, O(n log n) regardless of input order, and\n * allocation-free. `Array.prototype.sort` allocates an internal temp buffer in\n * V8's TimSort for arrays larger than ~10 elements; the broad-phase and contact\n * sorts run over ~1,000 elements every step, so that temp buffer is per-step\n * garbage. Heap sort sorts in place with only a constant number of locals.\n *\n * Heap sort is not stable, but every physics comparator (`byMinX`, `byPairId`,\n * `byRecordPair`, `byColliderPair`, `bySensorPair`) breaks ties on collider id,\n * so no two elements ever compare equal - the ordering is total and therefore\n * bit-identical to the `Array.prototype.sort` it replaces (replay\n * determinism). Do not use this with a comparator that can return 0 for distinct\n * elements; the result order would then differ from a stable sort.\n *\n * @internal\n */\nexport const sortInPlace = <T>(array: T[], compare: (a: T, b: T) => number): void => {\n const n = array.length;\n\n // Heapify: turn the array into a max-heap bottom-up.\n for (let i = (n >> 1) - 1; i >= 0; i--) {\n siftDown(array, i, n, compare);\n }\n\n // Repeatedly move the max (root) to the sorted tail, then restore the heap.\n for (let end = n - 1; end > 0; end--) {\n const root = array[0]!;\n array[0] = array[end]!;\n array[end] = root;\n siftDown(array, 0, end, compare);\n }\n};\n\nconst siftDown = <T>(array: T[], start: number, end: number, compare: (a: T, b: T) => number): void => {\n let parent = start;\n\n for (;;) {\n let child = parent * 2 + 1;\n\n if (child >= end) {\n break;\n }\n\n // Pick the larger of the two children.\n if (child + 1 < end && compare(array[child]!, array[child + 1]!) < 0) {\n child++;\n }\n\n // Parent already dominates the larger child - heap property restored.\n if (compare(array[parent]!, array[child]!) >= 0) {\n break;\n }\n\n const tmp = array[parent]!;\n array[parent] = array[child]!;\n array[child] = tmp;\n parent = child;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAa,eAAkB,OAAY,YAA0C;CACnF,MAAM,IAAI,MAAM;CAGhB,KAAK,IAAI,KAAK,KAAK,KAAK,GAAG,KAAK,GAAG,KACjC,SAAS,OAAO,GAAG,GAAG,OAAO;CAI/B,KAAK,IAAI,MAAM,IAAI,GAAG,MAAM,GAAG,OAAO;EACpC,MAAM,OAAO,MAAM;EACnB,MAAM,KAAK,MAAM;EACjB,MAAM,OAAO;EACb,SAAS,OAAO,GAAG,KAAK,OAAO;CACjC;AACF;AAEA,MAAM,YAAe,OAAY,OAAe,KAAa,YAA0C;CACrG,IAAI,SAAS;CAEb,SAAS;EACP,IAAI,QAAQ,SAAS,IAAI;EAEzB,IAAI,SAAS,KACX;EAIF,IAAI,QAAQ,IAAI,OAAO,QAAQ,MAAM,QAAS,MAAM,QAAQ,EAAG,IAAI,GACjE;EAIF,IAAI,QAAQ,MAAM,SAAU,MAAM,MAAO,KAAK,GAC5C;EAGF,MAAM,MAAM,MAAM;EAClB,MAAM,UAAU,MAAM;EACtB,MAAM,SAAS;EACf,SAAS;CACX;AACF"}
@@ -1,15 +1,10 @@
1
- /** A read-only two-component point/vector. `Vector` from core satisfies this. */
2
- export interface VectorLike {
3
- readonly x: number;
4
- readonly y: number;
5
- }
6
1
  /**
7
2
  * Simulation role of a {@link PhysicsBody}.
8
3
  *
9
- * - `dynamic` fully simulated (finite mass); moved by the solver once
4
+ * - `dynamic` - fully simulated (finite mass); moved by the solver once
10
5
  * dynamics ship, and by `setTransform` meanwhile.
11
- * - `static` never moves; infinite mass. Ground, walls, level geometry.
12
- * - `kinematic` moved only by `setTransform` (game-driven); infinite mass,
6
+ * - `static` - never moves; infinite mass. Ground, walls, level geometry.
7
+ * - `kinematic` - moved only by `setTransform` (game-driven); infinite mass,
13
8
  * unaffected by contacts. Platforms, doors.
14
9
  */
15
10
  export type BodyType = 'dynamic' | 'static' | 'kinematic';
@@ -37,3 +32,4 @@ export declare const resolveFilter: (filter?: Partial<CollisionFilter>) => Colli
37
32
  * semantics).
38
33
  */
39
34
  export declare const shouldCollide: (a: CollisionFilter, b: CollisionFilter) => boolean;
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,mFAAmF;AACnF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,eAAe,CAIlD,CAAC;AAEH,gEAAgE;AAChE,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,CAAC,eAAe,CAAC,KAAG,eAIhE,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,eAAe,EAAE,GAAG,eAAe,KAAG,OAMtE,CAAC"}
package/dist/esm/types.js CHANGED
@@ -1,28 +1,26 @@
1
- // Shared value types for the physics package. Kept dependency-light so the
2
- // shapes, colliders and world modules can all reference them without cycles.
1
+ //#region src/types.ts
3
2
  /** The default collider filter: category 1, collides with everything, no group. */
4
3
  const defaultFilter = Object.freeze({
5
- category: 0x0001,
6
- mask: 0xffff,
7
- group: 0,
4
+ category: 1,
5
+ mask: 65535,
6
+ group: 0
8
7
  });
9
8
  /** Normalise a partial filter against {@link defaultFilter}. */
10
9
  const resolveFilter = (filter) => ({
11
- category: filter?.category ?? defaultFilter.category,
12
- mask: filter?.mask ?? defaultFilter.mask,
13
- group: filter?.group ?? defaultFilter.group,
10
+ category: filter?.category ?? defaultFilter.category,
11
+ mask: filter?.mask ?? defaultFilter.mask,
12
+ group: filter?.group ?? defaultFilter.group
14
13
  });
15
14
  /**
16
- * Decide whether two filters permit a collision/overlap. Implements the
17
- * standard category/mask rule with the signed-group override (Box2D/Matter
18
- * semantics).
19
- */
15
+ * Decide whether two filters permit a collision/overlap. Implements the
16
+ * standard category/mask rule with the signed-group override (Box2D/Matter
17
+ * semantics).
18
+ */
20
19
  const shouldCollide = (a, b) => {
21
- if (a.group !== 0 && a.group === b.group) {
22
- return a.group > 0;
23
- }
24
- return (a.mask & b.category) !== 0 && (b.mask & a.category) !== 0;
20
+ if (a.group !== 0 && a.group === b.group) return a.group > 0;
21
+ return (a.mask & b.category) !== 0 && (b.mask & a.category) !== 0;
25
22
  };
26
23
 
24
+ //#endregion
27
25
  export { defaultFilter, resolveFilter, shouldCollide };
28
- //# sourceMappingURL=types.js.map
26
+ //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AAkCA;AACO,MAAM,aAAa,GAA8B,MAAM,CAAC,MAAM,CAAC;AACpE,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,CAAC;AACT,CAAA;AAED;MACa,aAAa,GAAG,CAAC,MAAiC,MAAuB;AACpF,IAAA,QAAQ,EAAE,MAAM,EAAE,QAAQ,IAAI,aAAa,CAAC,QAAQ;AACpD,IAAA,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,aAAa,CAAC,IAAI;AACxC,IAAA,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,CAAC,KAAK;AAC5C,CAAA;AAED;;;;AAIG;MACU,aAAa,GAAG,CAAC,CAAkB,EAAE,CAAkB,KAAa;AAC/E,IAAA,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE;AACxC,QAAA,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC;IACpB;IAEA,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,MAAM,CAAC;AACnE;;;;"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["// Shared value types for the physics package. Kept dependency-light so the\n// shapes, colliders and world modules can all reference them without cycles.\n\n/**\n * Simulation role of a {@link PhysicsBody}.\n *\n * - `dynamic` - fully simulated (finite mass); moved by the solver once\n * dynamics ship, and by `setTransform` meanwhile.\n * - `static` - never moves; infinite mass. Ground, walls, level geometry.\n * - `kinematic` - moved only by `setTransform` (game-driven); infinite mass,\n * unaffected by contacts. Platforms, doors.\n */\nexport type BodyType = 'dynamic' | 'static' | 'kinematic';\n\n/**\n * Per-collider collision filter. A pair is considered for collision only when\n * each collider's {@link mask} includes the other's {@link category}. A\n * non-zero {@link group} overrides category/mask: identical positive groups\n * always collide, identical negative groups never do.\n */\nexport interface CollisionFilter {\n /** Category bits this collider belongs to. Default `0x0001`. */\n category: number;\n /** Categories this collider collides with. Default `0xffff`. */\n mask: number;\n /** Signed override group; `0` defers to category/mask. Default `0`. */\n group: number;\n}\n\n/** The default collider filter: category 1, collides with everything, no group. */\nexport const defaultFilter: Readonly<CollisionFilter> = Object.freeze({\n category: 0x0001,\n mask: 0xffff,\n group: 0,\n});\n\n/** Normalise a partial filter against {@link defaultFilter}. */\nexport const resolveFilter = (filter?: Partial<CollisionFilter>): CollisionFilter => ({\n category: filter?.category ?? defaultFilter.category,\n mask: filter?.mask ?? defaultFilter.mask,\n group: filter?.group ?? defaultFilter.group,\n});\n\n/**\n * Decide whether two filters permit a collision/overlap. Implements the\n * standard category/mask rule with the signed-group override (Box2D/Matter\n * semantics).\n */\nexport const shouldCollide = (a: CollisionFilter, b: CollisionFilter): boolean => {\n if (a.group !== 0 && a.group === b.group) {\n return a.group > 0;\n }\n\n return (a.mask & b.category) !== 0 && (b.mask & a.category) !== 0;\n};\n"],"mappings":";;AA8BA,MAAa,gBAA2C,OAAO,OAAO;CACpE,UAAU;CACV,MAAM;CACN,OAAO;AACT,CAAC;;AAGD,MAAa,iBAAiB,YAAwD;CACpF,UAAU,QAAQ,YAAY,cAAc;CAC5C,MAAM,QAAQ,QAAQ,cAAc;CACpC,OAAO,QAAQ,SAAS,cAAc;AACxC;;;;;;AAOA,MAAa,iBAAiB,GAAoB,MAAgC;CAChF,IAAI,EAAE,UAAU,KAAK,EAAE,UAAU,EAAE,OACjC,OAAO,EAAE,QAAQ;CAGnB,QAAQ,EAAE,OAAO,EAAE,cAAc,MAAM,EAAE,OAAO,EAAE,cAAc;AAClE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexo/exojs-physics",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "description": "Native 2D collision, query and sensor runtime for ExoJS.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,10 +31,10 @@
31
31
  "LICENSE"
32
32
  ],
33
33
  "peerDependencies": {
34
- "@codexo/exojs": "0.15.x"
34
+ "@codexo/exojs": "0.16.x"
35
35
  },
36
36
  "devDependencies": {
37
- "@codexo/exojs": "0.15.3",
37
+ "@codexo/exojs": "0.16.0",
38
38
  "@codexo/exojs-config": "0.0.0"
39
39
  },
40
40
  "license": "MIT",
@@ -42,9 +42,9 @@
42
42
  "access": "public"
43
43
  },
44
44
  "scripts": {
45
- "build": "tsx ../../node_modules/rollup/dist/bin/rollup -c --environment EXOJS_ENV:production",
46
- "build:dev": "tsx ../../node_modules/rollup/dist/bin/rollup -c --environment EXOJS_ENV:development",
47
- "typecheck": "tsc --noEmit",
45
+ "build": "tsx ../../scripts/build-extension.ts",
46
+ "build:dev": "tsx ../../scripts/build-extension.ts --dev",
47
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
48
48
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
49
49
  "test": "vitest run --root ../.. --project=exojs-physics"
50
50
  }
@@ -1,15 +0,0 @@
1
- import type { Collider } from '../Collider';
2
- import type { BroadPhase, CandidatePair } from './BroadPhase';
3
- /**
4
- * Sort-and-sweep broad phase on the X axis. Each query sorts the live colliders
5
- * by their AABB `minX`, then sweeps once, comparing each collider only against
6
- * those whose X intervals still overlap and confirming the Y interval. This is
7
- * an exact AABB-overlap broad phase (zero false negatives) with a deterministic,
8
- * id-sorted output. The recompute-each-step design keeps it stateless between
9
- * frames — two worlds never share sweep state (gate I-1).
10
- */
11
- export declare class SweepAndPrune implements BroadPhase {
12
- private readonly _sorted;
13
- private readonly _pairPool;
14
- computePairs(colliders: readonly Collider[], out: CandidatePair[]): CandidatePair[];
15
- }
@@ -1,77 +0,0 @@
1
- import { sortInPlace } from '../sort.js';
2
-
3
- /**
4
- * Sort-and-sweep broad phase on the X axis. Each query sorts the live colliders
5
- * by their AABB `minX`, then sweeps once, comparing each collider only against
6
- * those whose X intervals still overlap and confirming the Y interval. This is
7
- * an exact AABB-overlap broad phase (zero false negatives) with a deterministic,
8
- * id-sorted output. The recompute-each-step design keeps it stateless between
9
- * frames — two worlds never share sweep state (gate I-1).
10
- */
11
- class SweepAndPrune {
12
- _sorted = [];
13
- // Pooled CandidatePair objects, reused across steps instead of allocating one
14
- // per overlapping pair. `out` holds references into the pool and is consumed
15
- // within the same step (ContactGraph reads pair.a/pair.b before the next
16
- // computePairs overwrites the pool), so the reuse is safe.
17
- _pairPool = [];
18
- computePairs(colliders, out) {
19
- out.length = 0;
20
- const sorted = this._sorted;
21
- sorted.length = 0;
22
- const pool = this._pairPool;
23
- let poolCount = 0;
24
- for (const collider of colliders) {
25
- sorted.push(collider);
26
- }
27
- sortInPlace(sorted, byMinX);
28
- const count = sorted.length;
29
- for (let i = 0; i < count; i++) {
30
- // i/j stay within 0..count-1, so the entries always exist; the guards only
31
- // discharge `noUncheckedIndexedAccess` and never actually skip a collider.
32
- const a = sorted[i];
33
- if (a === undefined) {
34
- continue;
35
- }
36
- const aBox = a.aabb;
37
- const aMaxX = aBox.maxX;
38
- const aMinY = aBox.minY;
39
- const aMaxY = aBox.maxY;
40
- for (let j = i + 1; j < count; j++) {
41
- const b = sorted[j];
42
- if (b === undefined) {
43
- continue;
44
- }
45
- const bBox = b.aabb;
46
- // X intervals are sorted: once b starts past a's right edge, so do all
47
- // later colliders — stop scanning this i.
48
- if (bBox.minX > aMaxX) {
49
- break;
50
- }
51
- if (bBox.minY > aMaxY || bBox.maxY < aMinY) {
52
- continue;
53
- }
54
- const lo = a.id < b.id ? a : b;
55
- const hi = a.id < b.id ? b : a;
56
- let pair = pool[poolCount];
57
- if (pair === undefined) {
58
- pair = { a: lo, b: hi };
59
- pool.push(pair);
60
- }
61
- else {
62
- pair.a = lo;
63
- pair.b = hi;
64
- }
65
- poolCount++;
66
- out.push(pair);
67
- }
68
- }
69
- sortInPlace(out, byPairId);
70
- return out;
71
- }
72
- }
73
- const byMinX = (a, b) => a.aabb.minX - b.aabb.minX || a.id - b.id;
74
- const byPairId = (p, q) => p.a.id - q.a.id || p.b.id - q.b.id;
75
-
76
- export { SweepAndPrune };
77
- //# sourceMappingURL=SweepAndPrune.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SweepAndPrune.js","sources":["../../../../src/broadphase/SweepAndPrune.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;;;;AAOG;MACU,aAAa,CAAA;IACP,OAAO,GAAe,EAAE;;;;;IAKxB,SAAS,GAAoB,EAAE;IAEzC,YAAY,CAAC,SAA8B,EAAE,GAAoB,EAAA;AACtE,QAAA,GAAG,CAAC,MAAM,GAAG,CAAC;AAEd,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO;AAC3B,QAAA,MAAM,CAAC,MAAM,GAAG,CAAC;AACjB,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS;QAC3B,IAAI,SAAS,GAAG,CAAC;AAEjB,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACvB;AAEA,QAAA,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;AAE3B,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM;AAE3B,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;;;AAG9B,YAAA,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAEnB,YAAA,IAAI,CAAC,KAAK,SAAS,EAAE;gBACnB;YACF;AAEA,YAAA,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI;AACnB,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI;AACvB,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI;AACvB,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI;AAEvB,YAAA,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAA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AG,CAAC,CAAgB,EAAE,CAAgB,KAAa,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}