@zylem/behaviors 0.4.0 → 0.5.1

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 (146) hide show
  1. package/README.md +13 -1
  2. package/dist/behavior-system-CeJXzNvr.d.ts +868 -0
  3. package/dist/{chunk-GFARAJV2.js → chunk-2PAHQZZD.js} +44 -73
  4. package/dist/chunk-2PAHQZZD.js.map +1 -0
  5. package/dist/chunk-52FJIDGL.js +30 -0
  6. package/dist/chunk-52FJIDGL.js.map +1 -0
  7. package/dist/{chunk-UYFOLI2X.js → chunk-5A5AYP2C.js} +1 -1
  8. package/dist/{chunk-UYFOLI2X.js.map → chunk-5A5AYP2C.js.map} +1 -1
  9. package/dist/{chunk-64HKCSXD.js → chunk-5EBIIYZD.js} +25 -45
  10. package/dist/chunk-5EBIIYZD.js.map +1 -0
  11. package/dist/{chunk-WXXXJ22R.js → chunk-5NJGASUJ.js} +87 -129
  12. package/dist/chunk-5NJGASUJ.js.map +1 -0
  13. package/dist/{chunk-XLUJDKCT.js → chunk-5UMCWV5A.js} +24 -15
  14. package/dist/chunk-5UMCWV5A.js.map +1 -0
  15. package/dist/chunk-5WRI5ZAA.js +31 -0
  16. package/dist/chunk-5WRI5ZAA.js.map +1 -0
  17. package/dist/{chunk-5SM5SH5O.js → chunk-7JLWZXPA.js} +2 -2
  18. package/dist/{chunk-HNESASBB.js → chunk-AEBDZWCP.js} +19 -28
  19. package/dist/chunk-AEBDZWCP.js.map +1 -0
  20. package/dist/chunk-AS3HR7AS.js +188 -0
  21. package/dist/chunk-AS3HR7AS.js.map +1 -0
  22. package/dist/chunk-E4X4YJZB.js +841 -0
  23. package/dist/chunk-E4X4YJZB.js.map +1 -0
  24. package/dist/{chunk-PWF757B6.js → chunk-F6ESSHQK.js} +19 -25
  25. package/dist/chunk-F6ESSHQK.js.map +1 -0
  26. package/dist/chunk-GQAPBNGT.js +210 -0
  27. package/dist/chunk-GQAPBNGT.js.map +1 -0
  28. package/dist/chunk-JGXRQUTC.js +191 -0
  29. package/dist/chunk-JGXRQUTC.js.map +1 -0
  30. package/dist/{chunk-BXP4K7RF.js → chunk-JVADRLWX.js} +57 -186
  31. package/dist/chunk-JVADRLWX.js.map +1 -0
  32. package/dist/{chunk-ZA43LPRM.js → chunk-KIYUUSPK.js} +2 -2
  33. package/dist/{chunk-V74N7D6Q.js → chunk-KOWGILCN.js} +24 -15
  34. package/dist/chunk-KOWGILCN.js.map +1 -0
  35. package/dist/{chunk-WWVD5DR5.js → chunk-M3QDKKDF.js} +2 -8
  36. package/dist/chunk-M3QDKKDF.js.map +1 -0
  37. package/dist/{chunk-FTDZAKZW.js → chunk-NQPYMUDF.js} +7 -5
  38. package/dist/{chunk-FTDZAKZW.js.map → chunk-NQPYMUDF.js.map} +1 -1
  39. package/dist/{chunk-XP3ASVGJ.js → chunk-NW4SE5XW.js} +2 -2
  40. package/dist/{chunk-KDY5N6J4.js → chunk-OPZ2LVS2.js} +1 -22
  41. package/dist/{chunk-KDY5N6J4.js.map → chunk-OPZ2LVS2.js.map} +1 -1
  42. package/dist/{chunk-5XZWTFGF.js → chunk-PLIXVF7B.js} +3 -3
  43. package/dist/chunk-PLIXVF7B.js.map +1 -0
  44. package/dist/{chunk-Y7YIAWPW.js → chunk-SGHIGTVZ.js} +1 -11
  45. package/dist/{chunk-Y7YIAWPW.js.map → chunk-SGHIGTVZ.js.map} +1 -1
  46. package/dist/{chunk-UL6Q5HDP.js → chunk-TBUKJKY6.js} +3 -25
  47. package/dist/chunk-TBUKJKY6.js.map +1 -0
  48. package/dist/chunk-VFDUKGRZ.js +155 -0
  49. package/dist/chunk-VFDUKGRZ.js.map +1 -0
  50. package/dist/chunk-VT3H43QA.js +288 -0
  51. package/dist/chunk-VT3H43QA.js.map +1 -0
  52. package/dist/chunk-W26PHBME.js +309 -0
  53. package/dist/chunk-W26PHBME.js.map +1 -0
  54. package/dist/components-BANNjAZP.d.ts +30 -0
  55. package/dist/cooldown.d.ts +2 -2
  56. package/dist/cooldown.js +1 -0
  57. package/dist/coordinators/boundary-ricochet-3d.d.ts +4 -4
  58. package/dist/coordinators/boundary-ricochet-3d.js +1 -0
  59. package/dist/coordinators/boundary-ricochet.d.ts +4 -4
  60. package/dist/coordinators/boundary-ricochet.js +3 -2
  61. package/dist/coordinators/first-person-shooter.js +1 -0
  62. package/dist/coordinators/multidirectional-space-shooter.d.ts +3 -3
  63. package/dist/coordinators/multidirectional-space-shooter.js +5 -3
  64. package/dist/coordinators/top-down-shooter.d.ts +3 -3
  65. package/dist/coordinators/top-down-shooter.js +5 -3
  66. package/dist/core.d.ts +288 -8
  67. package/dist/core.js +492 -19
  68. package/dist/core.js.map +1 -1
  69. package/dist/destructible-3d.d.ts +32 -4
  70. package/dist/destructible-3d.js +2 -1
  71. package/dist/destructible-prebake.js +1 -0
  72. package/dist/{entity-types-CmtQ-IBp.d.ts → entity-types-DhfsZbSK.d.ts} +5 -3
  73. package/dist/first-person.d.ts +27 -38
  74. package/dist/first-person.js +8 -7
  75. package/dist/index.d.ts +14 -15
  76. package/dist/index.js +37 -52
  77. package/dist/jumper-2d.d.ts +3 -17
  78. package/dist/jumper-2d.js +4 -8
  79. package/dist/jumper-3d.d.ts +5 -39
  80. package/dist/jumper-3d.js +5 -9
  81. package/dist/{moveable-BLTHO7Jq.d.ts → moveable-XhzWPAw5.d.ts} +21 -4
  82. package/dist/particle-emitter/presets.js +1 -0
  83. package/dist/particle-emitter.d.ts +3 -3
  84. package/dist/particle-emitter.js +3 -2
  85. package/dist/platformer-2d.d.ts +13 -82
  86. package/dist/platformer-2d.js +4 -4
  87. package/dist/platformer-3d.d.ts +13 -78
  88. package/dist/platformer-3d.js +4 -4
  89. package/dist/ricochet-2d.d.ts +3 -3
  90. package/dist/ricochet-2d.js +4 -3
  91. package/dist/ricochet-3d.d.ts +3 -3
  92. package/dist/ricochet-3d.js +4 -3
  93. package/dist/runtime-2d.d.ts +2 -2
  94. package/dist/runtime-2d.js +1 -0
  95. package/dist/runtime-2d.js.map +1 -1
  96. package/dist/screen-visibility.d.ts +2 -2
  97. package/dist/screen-visibility.js +1 -0
  98. package/dist/screen-wrap.d.ts +2 -2
  99. package/dist/screen-wrap.js +4 -3
  100. package/dist/shooter-2d.d.ts +3 -3
  101. package/dist/shooter-2d.js +4 -3
  102. package/dist/thruster.d.ts +5 -34
  103. package/dist/thruster.js +4 -6
  104. package/dist/top-down-movement.d.ts +9 -27
  105. package/dist/top-down-movement.js +6 -6
  106. package/dist/{vector-Bm65-FOG.d.ts → vector-DjhLUrak.d.ts} +2 -4
  107. package/dist/world-boundary-2d.d.ts +2 -2
  108. package/dist/world-boundary-2d.js +5 -4
  109. package/dist/world-boundary-3d.d.ts +2 -2
  110. package/dist/world-boundary-3d.js +4 -3
  111. package/package.json +4 -3
  112. package/dist/behavior-system-DSNek0W9.d.ts +0 -483
  113. package/dist/chunk-4URF65BR.js +0 -44
  114. package/dist/chunk-4URF65BR.js.map +0 -1
  115. package/dist/chunk-4V7TIRO2.js +0 -44
  116. package/dist/chunk-4V7TIRO2.js.map +0 -1
  117. package/dist/chunk-5XZWTFGF.js.map +0 -1
  118. package/dist/chunk-64HKCSXD.js.map +0 -1
  119. package/dist/chunk-BXP4K7RF.js.map +0 -1
  120. package/dist/chunk-FRJDQM23.js +0 -506
  121. package/dist/chunk-FRJDQM23.js.map +0 -1
  122. package/dist/chunk-GFARAJV2.js.map +0 -1
  123. package/dist/chunk-GTLA6LOJ.js +0 -400
  124. package/dist/chunk-GTLA6LOJ.js.map +0 -1
  125. package/dist/chunk-HNESASBB.js.map +0 -1
  126. package/dist/chunk-JXMF4NUI.js +0 -309
  127. package/dist/chunk-JXMF4NUI.js.map +0 -1
  128. package/dist/chunk-MJFMNRMZ.js +0 -240
  129. package/dist/chunk-MJFMNRMZ.js.map +0 -1
  130. package/dist/chunk-OTLSUYQQ.js +0 -29
  131. package/dist/chunk-OTLSUYQQ.js.map +0 -1
  132. package/dist/chunk-PWF757B6.js.map +0 -1
  133. package/dist/chunk-RONH2KDI.js +0 -455
  134. package/dist/chunk-RONH2KDI.js.map +0 -1
  135. package/dist/chunk-RTRFJVCZ.js +0 -454
  136. package/dist/chunk-RTRFJVCZ.js.map +0 -1
  137. package/dist/chunk-UL6Q5HDP.js.map +0 -1
  138. package/dist/chunk-V74N7D6Q.js.map +0 -1
  139. package/dist/chunk-WWVD5DR5.js.map +0 -1
  140. package/dist/chunk-WXXXJ22R.js.map +0 -1
  141. package/dist/chunk-XLUJDKCT.js.map +0 -1
  142. package/dist/components-BWG1GkZA.d.ts +0 -20
  143. package/dist/use-behavior-h9-T5FSv.d.ts +0 -13
  144. /package/dist/{chunk-5SM5SH5O.js.map → chunk-7JLWZXPA.js.map} +0 -0
  145. /package/dist/{chunk-ZA43LPRM.js.map → chunk-KIYUUSPK.js.map} +0 -0
  146. /package/dist/{chunk-XP3ASVGJ.js.map → chunk-NW4SE5XW.js.map} +0 -0
package/dist/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/capabilities/transform-store.ts","../src/lib/capabilities/moveable.ts","../src/lib/entities/entity.ts"],"sourcesContent":["import { proxy } from 'valtio';\n\nexport type VelocityIntentMode = 'replace' | 'add';\n\nexport interface VelocityIntent {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n\tmode: VelocityIntentMode;\n\tpriority?: number;\n}\n\n/**\n * Transform state managed by Valtio for batched physics updates.\n * \n * This store accumulates transformation intents during the frame,\n * then applies them all at once after onUpdate() callbacks complete.\n * \n * Design decisions:\n * - Position: Accumulated deltas (additive)\n * - Rotation: Last value wins (replacement)\n * - Velocity: Accumulated deltas (additive)\n * - Angular velocity: Accumulated deltas (additive)\n */\nexport interface TransformState {\n\t/** Position deltas to be applied (accumulated) */\n\tposition: { x: number; y: number; z: number };\n\t\n\t/** Rotation quaternion (last value wins) */\n\trotation: { x: number; y: number; z: number; w: number };\n\t\n\t/** Linear velocity (accumulated) */\n\tvelocity: { x: number; y: number; z: number };\n\t\n\t/** Angular velocity (accumulated) */\n\tangularVelocity: { x: number; y: number; z: number };\n\n\t/** Per-source velocity intents composed once per frame */\n\tvelocityChannels: Record<string, VelocityIntent>;\n\t\n\t/** Dirty flags to track what needs to be applied */\n\tdirty: {\n\t\tposition: boolean;\n\t\trotation: boolean;\n\t\tvelocityX: boolean;\n\t\tvelocityY: boolean;\n\t\tvelocityZ: boolean;\n\t\tvelocityChannels: boolean;\n\t\tangularVelocity: boolean;\n\t};\n}\n\n/**\n * Create a new transform store with optional initial values.\n * The store is a Valtio proxy, making it reactive for debugging/visualization.\n * \n * @param initial Optional initial state values\n * @returns Reactive transform state\n */\nexport function createTransformStore(initial?: Partial<TransformState>): TransformState {\n\tconst defaultState: TransformState = {\n\t\tposition: { x: 0, y: 0, z: 0 },\n\t\trotation: { x: 0, y: 0, z: 0, w: 1 },\n\t\tvelocity: { x: 0, y: 0, z: 0 },\n\t\tangularVelocity: { x: 0, y: 0, z: 0 },\n\t\tvelocityChannels: {},\n\t\tdirty: {\n\t\t\tposition: false,\n\t\t\trotation: false,\n\t\t\tvelocityX: false,\n\t\t\tvelocityY: false,\n\t\t\tvelocityZ: false,\n\t\t\tvelocityChannels: false,\n\t\t\tangularVelocity: false,\n\t\t},\n\t};\n\n\treturn proxy({\n\t\t...defaultState,\n\t\t...initial,\n\t\t// Ensure dirty flags are properly initialized even if partial initial state\n\t\tdirty: {\n\t\t\t...defaultState.dirty,\n\t\t\t...initial?.dirty,\n\t\t},\n\t});\n}\n\n","import { Vector3 } from 'three';\nimport { RigidBody, Vector } from '@dimforge/rapier3d-compat';\nimport type { TransformState } from './transform-store';\nimport { createTransformStore } from './transform-store';\nimport { setVelocityIntent } from './velocity-intents';\n\nexport interface EntityWithBody {\n\tbody: RigidBody | null;\n\ttransformStore?: TransformState;\n}\n\n/**\n * Move an entity along the X axis, preserving other velocities.\n */\nexport function moveX(entity: EntityWithBody, delta: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(entity.transformStore, 'actions', { x: delta }, { mode: 'replace' });\n}\n\n/**\n * Move an entity along the Y axis, preserving other velocities.\n */\nexport function moveY(entity: EntityWithBody, delta: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(entity.transformStore, 'actions', { y: delta }, { mode: 'replace' });\n}\n\n/**\n * Move an entity along the Z axis, preserving other velocities.\n */\nexport function moveZ(entity: EntityWithBody, delta: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(entity.transformStore, 'actions', { z: delta }, { mode: 'replace' });\n}\n\n/**\n * Move an entity along the X and Y axis, preserving Z velocity.\n */\nexport function moveXY(entity: EntityWithBody, deltaX: number, deltaY: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(\n\t\tentity.transformStore,\n\t\t'actions',\n\t\t{ x: deltaX, y: deltaY },\n\t\t{ mode: 'replace' },\n\t);\n}\n\n/**\n * Move an entity along the X and Z axis, preserving Y velocity.\n */\nexport function moveXZ(entity: EntityWithBody, deltaX: number, deltaZ: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(\n\t\tentity.transformStore,\n\t\t'actions',\n\t\t{ x: deltaX, z: deltaZ },\n\t\t{ mode: 'replace' },\n\t);\n}\n\n/**\n * Move entity based on a vector, adding to existing velocities.\n */\nexport function move(entity: EntityWithBody, vector: Vector3): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(\n\t\tentity.transformStore,\n\t\t'actions',\n\t\t{ x: vector.x, y: vector.y, z: vector.z },\n\t\t{ mode: 'add' },\n\t);\n}\n\n/**\n * Reset entity velocity\n */\nexport function resetVelocity(entity: EntityWithBody): void {\n\tif (!entity.body) return;\n\tentity.body.setLinvel(new Vector3(0, 0, 0), true);\n\tentity.body.setLinearDamping(5);\n}\n\n/**\n * Move entity forward in 2D space, preserving Z velocity\n */\nexport function moveForwardXY(entity: EntityWithBody, delta: number, rotation2DAngle: number): void {\n\tconst deltaX = Math.sin(-rotation2DAngle) * delta;\n\tconst deltaY = Math.cos(-rotation2DAngle) * delta;\n\tmoveXY(entity, deltaX, deltaY);\n}\n\n/**\n * Get entity position\n */\nexport function getPosition(entity: EntityWithBody): Vector | null {\n\tif (!entity.body) return null;\n\treturn entity.body.translation();\n}\n\n/**\n * Get entity velocity\n */\nexport function getVelocity(entity: EntityWithBody): Vector | null {\n\tif (!entity.body) return null;\n\treturn entity.body.linvel();\n}\n\n/**\n * Set entity position\n */\nexport function setPosition(entity: EntityWithBody, x: number, y: number, z: number): void {\n\tif (!entity.body) return;\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Set entity X position\n */\nexport function setPositionX(entity: EntityWithBody, x: number): void {\n\tif (!entity.body) return;\n\tconst { y, z } = entity.body.translation();\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Set entity Y position\n */\nexport function setPositionY(entity: EntityWithBody, y: number): void {\n\tif (!entity.body) return;\n\tconst { x, z } = entity.body.translation();\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Set entity Z position\n */\nexport function setPositionZ(entity: EntityWithBody, z: number): void {\n\tif (!entity.body) return;\n\tconst { x, y } = entity.body.translation();\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Wrap entity around 2D bounds\n */\nexport function wrapAroundXY(entity: EntityWithBody, boundsX: number, boundsY: number): void {\n\tconst position = getPosition(entity);\n\tif (!position) return;\n\n\tconst { x, y } = position;\n\tconst newX = x > boundsX ? -boundsX : (x < -boundsX ? boundsX : x);\n\tconst newY = y > boundsY ? -boundsY : (y < -boundsY ? boundsY : y);\n\n\tif (newX !== x || newY !== y) {\n\t\tsetPosition(entity, newX, newY, 0);\n\t}\n}\n\n/**\n * Wrap entity around 3D bounds\n */\nexport function wrapAround3D(entity: EntityWithBody, boundsX: number, boundsY: number, boundsZ: number): void {\n\tconst position = getPosition(entity);\n\tif (!position) return;\n\n\tconst { x, y, z } = position;\n\tconst newX = x > boundsX ? -boundsX : (x < -boundsX ? boundsX : x);\n\tconst newY = y > boundsY ? -boundsY : (y < -boundsY ? boundsY : y);\n\tconst newZ = z > boundsZ ? -boundsZ : (z < -boundsZ ? boundsZ : z);\n\n\tif (newX !== x || newY !== y || newZ !== z) {\n\t\tsetPosition(entity, newX, newY, newZ);\n\t}\n}\n\n/**\n * Enhanced moveable entity with bound methods\n */\nexport interface MoveableEntity extends EntityWithBody {\n\tmoveX(delta: number): void;\n\tmoveY(delta: number): void;\n\tmoveZ(delta: number): void;\n\tmoveXY(deltaX: number, deltaY: number): void;\n\tmoveXZ(deltaX: number, deltaZ: number): void;\n\tmove(vector: Vector3): void;\n\tresetVelocity(): void;\n\tmoveForwardXY(delta: number, rotation2DAngle: number): void;\n\tgetPosition(): Vector | null;\n\tgetVelocity(): Vector | null;\n\tsetPosition(x: number, y: number, z: number): void;\n\tsetPositionX(x: number): void;\n\tsetPositionY(y: number): void;\n\tsetPositionZ(z: number): void;\n\twrapAroundXY(boundsX: number, boundsY: number): void;\n\twrapAround3D(boundsX: number, boundsY: number, boundsZ: number): void;\n}\n\n/**\n * Enhance an entity with additive movement methods.\n * Automatically creates a transform store if one doesn't exist.\n */\nexport function makeMoveable<T extends EntityWithBody>(entity: T): T & MoveableEntity {\n\tconst moveable = entity as T & MoveableEntity;\n\n\t// Create transform store if it doesn't exist\n\tif (!moveable.transformStore) {\n\t\tmoveable.transformStore = createTransformStore();\n\t}\n\n\tmoveable.moveX = (delta: number) => moveX(entity, delta);\n\tmoveable.moveY = (delta: number) => moveY(entity, delta);\n\tmoveable.moveZ = (delta: number) => moveZ(entity, delta);\n\tmoveable.moveXY = (deltaX: number, deltaY: number) => moveXY(entity, deltaX, deltaY);\n\tmoveable.moveXZ = (deltaX: number, deltaZ: number) => moveXZ(entity, deltaX, deltaZ);\n\tmoveable.move = (vector: Vector3) => move(entity, vector);\n\tmoveable.resetVelocity = () => resetVelocity(entity);\n\tmoveable.moveForwardXY = (delta: number, rotation2DAngle: number) => moveForwardXY(entity, delta, rotation2DAngle);\n\tmoveable.getPosition = () => getPosition(entity);\n\tmoveable.getVelocity = () => getVelocity(entity);\n\tmoveable.setPosition = (x: number, y: number, z: number) => setPosition(entity, x, y, z);\n\tmoveable.setPositionX = (x: number) => setPositionX(entity, x);\n\tmoveable.setPositionY = (y: number) => setPositionY(entity, y);\n\tmoveable.setPositionZ = (z: number) => setPositionZ(entity, z);\n\tmoveable.wrapAroundXY = (boundsX: number, boundsY: number) => wrapAroundXY(entity, boundsX, boundsY);\n\tmoveable.wrapAround3D = (boundsX: number, boundsY: number, boundsZ: number) => wrapAround3D(entity, boundsX, boundsY, boundsZ);\n\n\treturn moveable;\n}","import type { Collider, RigidBody } from '@dimforge/rapier3d-compat';\nimport type {\n\tBehaviorDescriptor,\n\tBehaviorHandle,\n\tBehaviorRef,\n} from '../behaviors/behavior-descriptor';\nimport type { TransformState } from '../capabilities/transform-store';\n\n/**\n * Minimal, runtime-agnostic entity options contract.\n *\n * The full engine entity (in `@zylem/game-lib`) provides a richer options type,\n * but behaviors only rely on this loose shape.\n */\nexport interface GameEntityOptions {\n\t[key: string]: any;\n\tname?: string;\n}\n\n/**\n * Structural stand-in for the engine `GameEntity`.\n *\n * Behaviors annotate against this loose contract so that `@zylem/behaviors`\n * (and its `@zylem/behaviors/core` surface) never has to depend on the concrete\n * `@zylem/game-lib` entity implementation. The real engine entity is\n * structurally assignable to this type.\n */\nexport class GameEntity<TOptions = unknown> {\n\t[key: string]: any;\n\n\tuuid!: string;\n\tname!: string;\n\ttype!: string;\n\toptions?: TOptions & Record<string, unknown>;\n\tgroup: any = null;\n\tmesh?: any;\n\tmaterials?: any[];\n\tbody: RigidBody | null = null;\n\tcollider: Collider | null = null;\n\tcolliderDesc?: any;\n\tcolliderDescs: any[] = [];\n\tbodyDesc?: any;\n\tphysicsAttached = false;\n\truntimeHandle?: number;\n\ttransformStore?: TransformState;\n\tnodeDestroy?: any;\n\tisInstanced?: boolean;\n\n\tprivate __behaviorRefs: BehaviorRef<any>[] = [];\n\n\tcreate(): this {\n\t\treturn this;\n\t}\n\n\tonCleanup(callback: () => void): this {\n\t\tvoid callback;\n\t\treturn this;\n\t}\n\n\tsetPosition(_x: number, _y: number, _z: number): void {}\n\tsetRotation(_x: number, _y: number, _z: number): void {}\n\tsetRotationZ(_z: number): void {}\n\tsetScale(_x: number, _y: number, _z: number): void {}\n\n\t/**\n\t * Attach a behavior to this entity. The real engine entity does substantially\n\t * more, but this functional stub stores the merged ref and builds the handle\n\t * so descriptor/handle logic (and tests that drive behaviors directly) work\n\t * without the full engine.\n\t */\n\tuse<\n\t\tO extends Record<string, any>,\n\t\tH extends Record<string, any> = Record<string, never>,\n\t>(\n\t\tdescriptor: BehaviorDescriptor<O, H>,\n\t\toptions?: Partial<O>,\n\t): BehaviorHandle<O, H> {\n\t\tconst mergedOptions = {\n\t\t\t...(descriptor.defaultOptions as O),\n\t\t\t...(options ?? {}),\n\t\t} as O;\n\t\tconst ref: BehaviorRef<O> = { descriptor, options: mergedOptions };\n\t\tthis.__behaviorRefs.push(ref as BehaviorRef<any>);\n\n\t\tconst baseHandle = {\n\t\t\tgetFSM: () => ref.fsm ?? null,\n\t\t\tgetOptions: () => ref.options,\n\t\t\tref,\n\t\t};\n\t\tconst extra = descriptor.createHandle\n\t\t\t? descriptor.createHandle(ref)\n\t\t\t: ({} as H);\n\t\treturn { ...baseHandle, ...extra } as BehaviorHandle<O, H>;\n\t}\n\n\t/** Live behavior refs attached via {@link use}. */\n\tgetBehaviorRefs(): BehaviorRef<any>[] {\n\t\treturn this.__behaviorRefs;\n\t}\n}\n\n/**\n * Factory contract injected into behavior systems via\n * {@link BehaviorSystemContext.createEntity}. The host engine supplies the real\n * entity factory at stage-construction time.\n */\nexport type CreateEntityFn = (\n\toptions?: Partial<GameEntityOptions>,\n) => GameEntity<GameEntityOptions>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa;AA2Df,SAAS,qBAAqB,SAAmD;AACvF,QAAM,eAA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EACA,gBAAuB,CAAC;AAAA,EACxB;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEQ,iBAAqC,CAAC;AAAA,EAE9C,SAAe;AACd,WAAO;AAAA,EACR;AAAA,EAEA,UAAU,UAA4B;AACrC,SAAK;AACL,WAAO;AAAA,EACR;AAAA,EAEA,YAAY,IAAY,IAAY,IAAkB;AAAA,EAAC;AAAA,EACvD,YAAY,IAAY,IAAY,IAAkB;AAAA,EAAC;AAAA,EACvD,aAAa,IAAkB;AAAA,EAAC;AAAA,EAChC,SAAS,IAAY,IAAY,IAAkB;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQpD,IAIC,YACA,SACuB;AACvB,UAAM,gBAAgB;AAAA,MACrB,GAAI,WAAW;AAAA,MACf,GAAI,WAAW,CAAC;AAAA,IACjB;AACA,UAAM,MAAsB,EAAE,YAAY,SAAS,cAAc;AACjE,SAAK,eAAe,KAAK,GAAuB;AAEhD,UAAM,aAAa;AAAA,MAClB,QAAQ,MAAM,IAAI,OAAO;AAAA,MACzB,YAAY,MAAM,IAAI;AAAA,MACtB;AAAA,IACD;AACA,UAAM,QAAQ,WAAW,eACtB,WAAW,aAAa,GAAG,IAC1B,CAAC;AACL,WAAO,EAAE,GAAG,YAAY,GAAG,MAAM;AAAA,EAClC;AAAA;AAAA,EAGA,kBAAsC;AACrC,WAAO,KAAK;AAAA,EACb;AACD;","names":[]}
1
+ {"version":3,"sources":["../src/lib/capabilities/transform-store.ts","../src/lib/capabilities/velocity-intents.ts","../src/lib/capabilities/moveable.ts","../src/lib/runtime/mock-behavior-runtime.ts","../src/lib/runtime/simulation.ts","../src/lib/entities/entity.ts"],"sourcesContent":["import { proxy } from 'valtio';\n\nexport type VelocityIntentMode = 'replace' | 'add';\n\nexport interface VelocityIntent {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n\tmode: VelocityIntentMode;\n\tpriority?: number;\n}\n\n/**\n * Transform state managed by Valtio for batched physics updates.\n * \n * This store accumulates transformation intents during the frame,\n * then applies them all at once after onUpdate() callbacks complete.\n * \n * Design decisions:\n * - Position: Accumulated deltas (additive)\n * - Rotation: Last value wins (replacement)\n * - Velocity: Accumulated deltas (additive)\n * - Angular velocity: Accumulated deltas (additive)\n */\nexport interface TransformState {\n\t/** Position deltas to be applied (accumulated) */\n\tposition: { x: number; y: number; z: number };\n\t\n\t/** Rotation quaternion (last value wins) */\n\trotation: { x: number; y: number; z: number; w: number };\n\t\n\t/** Linear velocity (accumulated) */\n\tvelocity: { x: number; y: number; z: number };\n\t\n\t/** Angular velocity (accumulated) */\n\tangularVelocity: { x: number; y: number; z: number };\n\n\t/** Per-source velocity intents composed once per frame */\n\tvelocityChannels: Record<string, VelocityIntent>;\n\t\n\t/** Dirty flags to track what needs to be applied */\n\tdirty: {\n\t\tposition: boolean;\n\t\trotation: boolean;\n\t\tvelocityX: boolean;\n\t\tvelocityY: boolean;\n\t\tvelocityZ: boolean;\n\t\tvelocityChannels: boolean;\n\t\tangularVelocity: boolean;\n\t};\n}\n\n/**\n * Create a new transform store with optional initial values.\n * The store is a Valtio proxy, making it reactive for debugging/visualization.\n * \n * @param initial Optional initial state values\n * @returns Reactive transform state\n */\nexport function createTransformStore(initial?: Partial<TransformState>): TransformState {\n\tconst defaultState: TransformState = {\n\t\tposition: { x: 0, y: 0, z: 0 },\n\t\trotation: { x: 0, y: 0, z: 0, w: 1 },\n\t\tvelocity: { x: 0, y: 0, z: 0 },\n\t\tangularVelocity: { x: 0, y: 0, z: 0 },\n\t\tvelocityChannels: {},\n\t\tdirty: {\n\t\t\tposition: false,\n\t\t\trotation: false,\n\t\t\tvelocityX: false,\n\t\t\tvelocityY: false,\n\t\t\tvelocityZ: false,\n\t\t\tvelocityChannels: false,\n\t\t\tangularVelocity: false,\n\t\t},\n\t};\n\n\treturn proxy({\n\t\t...defaultState,\n\t\t...initial,\n\t\t// Ensure dirty flags are properly initialized even if partial initial state\n\t\tdirty: {\n\t\t\t...defaultState.dirty,\n\t\t\t...initial?.dirty,\n\t\t},\n\t});\n}\n\n","import { TransformState, VelocityIntentMode } from './transform-store';\n\nexport interface VelocityIntentOptions {\n\tmode?: VelocityIntentMode;\n\tpriority?: number;\n}\n\nexport interface VelocityIntentVector {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n}\n\nexport function setVelocityIntent(\n\tstore: TransformState,\n\tsourceId: string,\n\tvector: VelocityIntentVector,\n\toptions: VelocityIntentOptions = {},\n): void {\n\tconst prev = store.velocityChannels[sourceId];\n\tconst mode = options.mode ?? prev?.mode ?? 'replace';\n\tconst priority = options.priority ?? prev?.priority ?? 0;\n\tconst isAdditiveMerge = mode === 'add' && prev?.mode === 'add';\n\n\tconst x =\n\t\tvector.x == null\n\t\t\t? prev?.x\n\t\t\t: isAdditiveMerge\n\t\t\t\t? (prev?.x ?? 0) + vector.x\n\t\t\t\t: vector.x;\n\tconst y =\n\t\tvector.y == null\n\t\t\t? prev?.y\n\t\t\t: isAdditiveMerge\n\t\t\t\t? (prev?.y ?? 0) + vector.y\n\t\t\t\t: vector.y;\n\tconst z =\n\t\tvector.z == null\n\t\t\t? prev?.z\n\t\t\t: isAdditiveMerge\n\t\t\t\t? (prev?.z ?? 0) + vector.z\n\t\t\t\t: vector.z;\n\n\tstore.velocityChannels[sourceId] = {\n\t\tx,\n\t\ty,\n\t\tz,\n\t\tmode,\n\t\tpriority,\n\t};\n\tstore.dirty.velocityChannels = true;\n}\n\nexport function clearVelocityIntent(store: TransformState, sourceId: string): void {\n\tif (!(sourceId in store.velocityChannels)) return;\n\tdelete store.velocityChannels[sourceId];\n\tstore.dirty.velocityChannels = true;\n}\n","import { Vector3 } from 'three';\nimport type { TransformState } from './transform-store';\nimport { createTransformStore } from './transform-store';\nimport { setVelocityIntent } from './velocity-intents';\n\n/** Plain `{ x, y, z }` vector returned by pose/velocity reads. */\nexport interface Vector {\n\tx: number;\n\ty: number;\n\tz: number;\n}\n\n/**\n * Structural slice of the host body reference used by the direct-body helpers\n * below (`getPosition`, `setPosition`, `resetVelocity`, ...). The host's\n * runtime-backed body proxy satisfies this shape.\n */\nexport interface MoveableBodyLike {\n\ttranslation(): Vector;\n\tlinvel(): Vector;\n\tsetTranslation(translation: Vector, wakeUp: boolean): void;\n\tsetLinvel(velocity: Vector, wakeUp: boolean): void;\n\tsetLinearDamping(damping: number): void;\n}\n\nexport interface EntityWithBody {\n\tbody: MoveableBodyLike | null;\n\ttransformStore?: TransformState;\n}\n\n/**\n * Move an entity along the X axis, preserving other velocities.\n */\nexport function moveX(entity: EntityWithBody, delta: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(entity.transformStore, 'actions', { x: delta }, { mode: 'replace' });\n}\n\n/**\n * Move an entity along the Y axis, preserving other velocities.\n */\nexport function moveY(entity: EntityWithBody, delta: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(entity.transformStore, 'actions', { y: delta }, { mode: 'replace' });\n}\n\n/**\n * Move an entity along the Z axis, preserving other velocities.\n */\nexport function moveZ(entity: EntityWithBody, delta: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(entity.transformStore, 'actions', { z: delta }, { mode: 'replace' });\n}\n\n/**\n * Move an entity along the X and Y axis, preserving Z velocity.\n */\nexport function moveXY(entity: EntityWithBody, deltaX: number, deltaY: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(\n\t\tentity.transformStore,\n\t\t'actions',\n\t\t{ x: deltaX, y: deltaY },\n\t\t{ mode: 'replace' },\n\t);\n}\n\n/**\n * Move an entity along the X and Z axis, preserving Y velocity.\n */\nexport function moveXZ(entity: EntityWithBody, deltaX: number, deltaZ: number): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(\n\t\tentity.transformStore,\n\t\t'actions',\n\t\t{ x: deltaX, z: deltaZ },\n\t\t{ mode: 'replace' },\n\t);\n}\n\n/**\n * Move entity based on a vector, adding to existing velocities.\n */\nexport function move(entity: EntityWithBody, vector: Vector3): void {\n\tif (!entity.transformStore) return;\n\tsetVelocityIntent(\n\t\tentity.transformStore,\n\t\t'actions',\n\t\t{ x: vector.x, y: vector.y, z: vector.z },\n\t\t{ mode: 'add' },\n\t);\n}\n\n/**\n * Reset entity velocity\n */\nexport function resetVelocity(entity: EntityWithBody): void {\n\tif (!entity.body) return;\n\tentity.body.setLinvel(new Vector3(0, 0, 0), true);\n\tentity.body.setLinearDamping(5);\n}\n\n/**\n * Move entity forward in 2D space, preserving Z velocity\n */\nexport function moveForwardXY(entity: EntityWithBody, delta: number, rotation2DAngle: number): void {\n\tconst deltaX = Math.sin(-rotation2DAngle) * delta;\n\tconst deltaY = Math.cos(-rotation2DAngle) * delta;\n\tmoveXY(entity, deltaX, deltaY);\n}\n\n/**\n * Get entity position\n */\nexport function getPosition(entity: EntityWithBody): Vector | null {\n\tif (!entity.body) return null;\n\treturn entity.body.translation();\n}\n\n/**\n * Get entity velocity\n */\nexport function getVelocity(entity: EntityWithBody): Vector | null {\n\tif (!entity.body) return null;\n\treturn entity.body.linvel();\n}\n\n/**\n * Set entity position\n */\nexport function setPosition(entity: EntityWithBody, x: number, y: number, z: number): void {\n\tif (!entity.body) return;\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Set entity X position\n */\nexport function setPositionX(entity: EntityWithBody, x: number): void {\n\tif (!entity.body) return;\n\tconst { y, z } = entity.body.translation();\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Set entity Y position\n */\nexport function setPositionY(entity: EntityWithBody, y: number): void {\n\tif (!entity.body) return;\n\tconst { x, z } = entity.body.translation();\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Set entity Z position\n */\nexport function setPositionZ(entity: EntityWithBody, z: number): void {\n\tif (!entity.body) return;\n\tconst { x, y } = entity.body.translation();\n\tentity.body.setTranslation({ x, y, z }, true);\n}\n\n/**\n * Wrap entity around 2D bounds\n */\nexport function wrapAroundXY(entity: EntityWithBody, boundsX: number, boundsY: number): void {\n\tconst position = getPosition(entity);\n\tif (!position) return;\n\n\tconst { x, y } = position;\n\tconst newX = x > boundsX ? -boundsX : (x < -boundsX ? boundsX : x);\n\tconst newY = y > boundsY ? -boundsY : (y < -boundsY ? boundsY : y);\n\n\tif (newX !== x || newY !== y) {\n\t\tsetPosition(entity, newX, newY, 0);\n\t}\n}\n\n/**\n * Wrap entity around 3D bounds\n */\nexport function wrapAround3D(entity: EntityWithBody, boundsX: number, boundsY: number, boundsZ: number): void {\n\tconst position = getPosition(entity);\n\tif (!position) return;\n\n\tconst { x, y, z } = position;\n\tconst newX = x > boundsX ? -boundsX : (x < -boundsX ? boundsX : x);\n\tconst newY = y > boundsY ? -boundsY : (y < -boundsY ? boundsY : y);\n\tconst newZ = z > boundsZ ? -boundsZ : (z < -boundsZ ? boundsZ : z);\n\n\tif (newX !== x || newY !== y || newZ !== z) {\n\t\tsetPosition(entity, newX, newY, newZ);\n\t}\n}\n\n/**\n * Enhanced moveable entity with bound methods\n */\nexport interface MoveableEntity extends EntityWithBody {\n\tmoveX(delta: number): void;\n\tmoveY(delta: number): void;\n\tmoveZ(delta: number): void;\n\tmoveXY(deltaX: number, deltaY: number): void;\n\tmoveXZ(deltaX: number, deltaZ: number): void;\n\tmove(vector: Vector3): void;\n\tresetVelocity(): void;\n\tmoveForwardXY(delta: number, rotation2DAngle: number): void;\n\tgetPosition(): Vector | null;\n\tgetVelocity(): Vector | null;\n\tsetPosition(x: number, y: number, z: number): void;\n\tsetPositionX(x: number): void;\n\tsetPositionY(y: number): void;\n\tsetPositionZ(z: number): void;\n\twrapAroundXY(boundsX: number, boundsY: number): void;\n\twrapAround3D(boundsX: number, boundsY: number, boundsZ: number): void;\n}\n\n/**\n * Enhance an entity with additive movement methods.\n * Automatically creates a transform store if one doesn't exist.\n */\nexport function makeMoveable<T extends EntityWithBody>(entity: T): T & MoveableEntity {\n\tconst moveable = entity as T & MoveableEntity;\n\n\t// Create transform store if it doesn't exist\n\tif (!moveable.transformStore) {\n\t\tmoveable.transformStore = createTransformStore();\n\t}\n\n\tmoveable.moveX = (delta: number) => moveX(entity, delta);\n\tmoveable.moveY = (delta: number) => moveY(entity, delta);\n\tmoveable.moveZ = (delta: number) => moveZ(entity, delta);\n\tmoveable.moveXY = (deltaX: number, deltaY: number) => moveXY(entity, deltaX, deltaY);\n\tmoveable.moveXZ = (deltaX: number, deltaZ: number) => moveXZ(entity, deltaX, deltaZ);\n\tmoveable.move = (vector: Vector3) => move(entity, vector);\n\tmoveable.resetVelocity = () => resetVelocity(entity);\n\tmoveable.moveForwardXY = (delta: number, rotation2DAngle: number) => moveForwardXY(entity, delta, rotation2DAngle);\n\tmoveable.getPosition = () => getPosition(entity);\n\tmoveable.getVelocity = () => getVelocity(entity);\n\tmoveable.setPosition = (x: number, y: number, z: number) => setPosition(entity, x, y, z);\n\tmoveable.setPositionX = (x: number) => setPositionX(entity, x);\n\tmoveable.setPositionY = (y: number) => setPositionY(entity, y);\n\tmoveable.setPositionZ = (z: number) => setPositionZ(entity, z);\n\tmoveable.wrapAroundXY = (boundsX: number, boundsY: number) => wrapAroundXY(entity, boundsX, boundsY);\n\tmoveable.wrapAround3D = (boundsX: number, boundsY: number, boundsZ: number) => wrapAround3D(entity, boundsX, boundsY, boundsZ);\n\n\treturn moveable;\n}","/**\n * In-memory implementation of the {@link BehaviorRuntime} contract for unit\n * tests. Records every attach / input call per handle and lets tests seed\n * poses and behavior snapshots without instantiating the wasm runtime.\n */\n\nimport type {\n\tBehaviorRuntime,\n\tStageBehaviorSnapshot,\n\tStageBoundaryDimValue,\n\tStageFirstPersonInput,\n\tStageFirstPersonOptions,\n\tStageJumper2DOptions,\n\tStageJumper3DOptions,\n\tStagePlatformer2DOptions,\n\tStagePlatformer3DOptions,\n\tStagePose,\n\tStageRicochetDimValue,\n\tStageRicochetOptions,\n\tStageScreenWrapOptions,\n\tStageShooter2DOptions,\n\tStageThrusterOptions,\n\tStageTopDownOptions,\n\tStageWorldBoundaryOptions,\n} from './wasm-stage-runtime';\n\ninterface MockSlotState {\n\tpose: StagePose;\n\tsnapshot: StageBehaviorSnapshot | null;\n\tinput: {\n\t\taxisA: number;\n\t\taxisB: number;\n\t\tyawDelta: number;\n\t\tpitchDelta: number;\n\t\treservedA: number;\n\t\treservedB: number;\n\t\tbuttons: number;\n\t};\n\tattachments: Map<string, unknown>;\n\tinputs: Array<{ kind: string; args: unknown[] }>;\n\tscreenWrapQuery: { fsm: number; lastWrappedAxes: number } | null;\n\tworldBoundaryQuery: { hits: number; clamped: [number, number, number] } | null;\n}\n\nfunction freshSlot(): MockSlotState {\n\treturn {\n\t\tpose: { position: [0, 0, 0], rotation: [0, 0, 0, 1] },\n\t\tsnapshot: null,\n\t\tinput: { axisA: 0, axisB: 0, yawDelta: 0, pitchDelta: 0, reservedA: 0, reservedB: 0, buttons: 0 },\n\t\tattachments: new Map(),\n\t\tinputs: [],\n\t\tscreenWrapQuery: null,\n\t\tworldBoundaryQuery: null,\n\t};\n}\n\nexport class MockBehaviorRuntime implements BehaviorRuntime {\n\tprivate slots = new Map<number, MockSlotState>();\n\n\tprivate slot(handle: number): MockSlotState {\n\t\tlet state = this.slots.get(handle);\n\t\tif (!state) {\n\t\t\tstate = freshSlot();\n\t\t\tthis.slots.set(handle, state);\n\t\t}\n\t\treturn state;\n\t}\n\n\t// ─── Test seams ─────────────────────────────────────────────────────\n\n\t/** Seed the pose returned by {@link getPose} for a handle. */\n\tsetPose(handle: number, pose: StagePose): void {\n\t\tthis.slot(handle).pose = pose;\n\t}\n\n\t/** Seed the snapshot returned by {@link readSnapshot} for a handle. */\n\tsetSnapshot(handle: number, snapshot: StageBehaviorSnapshot | null): void {\n\t\tthis.slot(handle).snapshot = snapshot;\n\t}\n\n\t/** Seed {@link queryScreenWrap} results. */\n\tsetScreenWrapQuery(handle: number, value: { fsm: number; lastWrappedAxes: number } | null): void {\n\t\tthis.slot(handle).screenWrapQuery = value;\n\t}\n\n\t/** Seed {@link queryWorldBoundary} results. */\n\tsetWorldBoundaryQuery(\n\t\thandle: number,\n\t\tvalue: { hits: number; clamped: [number, number, number] } | null,\n\t): void {\n\t\tthis.slot(handle).worldBoundaryQuery = value;\n\t}\n\n\t/** Attachment options recorded for a handle, keyed by behavior name. */\n\tgetAttachment<T>(handle: number, kind: string): T | undefined {\n\t\treturn this.slots.get(handle)?.attachments.get(kind) as T | undefined;\n\t}\n\n\thasAttachment(handle: number, kind: string): boolean {\n\t\treturn this.slots.get(handle)?.attachments.has(kind) ?? false;\n\t}\n\n\t/** Every per-entity input call recorded for a handle, oldest first. */\n\tgetInputCalls(handle: number): Array<{ kind: string; args: unknown[] }> {\n\t\treturn this.slots.get(handle)?.inputs ?? [];\n\t}\n\n\t/** Last written batched-input state for a handle. */\n\tgetBatchedInput(handle: number): MockSlotState['input'] {\n\t\treturn this.slot(handle).input;\n\t}\n\n\treset(): void {\n\t\tthis.slots.clear();\n\t}\n\n\t// ─── BehaviorRuntime contract ───────────────────────────────────────\n\n\tsetPosition(handle: number, x: number, y: number, z: number): boolean {\n\t\tconst pose = this.slot(handle).pose;\n\t\tpose.position[0] = x;\n\t\tpose.position[1] = y;\n\t\tpose.position[2] = z;\n\t\treturn true;\n\t}\n\n\tsetRotation(handle: number, x: number, y: number, z: number, w: number): boolean {\n\t\tconst pose = this.slot(handle).pose;\n\t\tpose.rotation[0] = x;\n\t\tpose.rotation[1] = y;\n\t\tpose.rotation[2] = z;\n\t\tpose.rotation[3] = w;\n\t\treturn true;\n\t}\n\n\tgetPose(handle: number, out?: StagePose): StagePose | null {\n\t\tconst state = this.slots.get(handle);\n\t\tif (!state) return null;\n\t\tconst result = out ?? { position: [0, 0, 0], rotation: [0, 0, 0, 1] } as StagePose;\n\t\tresult.position[0] = state.pose.position[0];\n\t\tresult.position[1] = state.pose.position[1];\n\t\tresult.position[2] = state.pose.position[2];\n\t\tresult.rotation[0] = state.pose.rotation[0];\n\t\tresult.rotation[1] = state.pose.rotation[1];\n\t\tresult.rotation[2] = state.pose.rotation[2];\n\t\tresult.rotation[3] = state.pose.rotation[3];\n\t\treturn result;\n\t}\n\n\twriteInputAxes(handle: number, axisA: number, axisB: number): boolean {\n\t\tconst input = this.slot(handle).input;\n\t\tinput.axisA = axisA;\n\t\tinput.axisB = axisB;\n\t\treturn true;\n\t}\n\n\twriteInputLook(handle: number, yawDelta: number, pitchDelta: number): boolean {\n\t\tconst input = this.slot(handle).input;\n\t\tinput.yawDelta = yawDelta;\n\t\tinput.pitchDelta = pitchDelta;\n\t\treturn true;\n\t}\n\n\twriteInputReserved(handle: number, reservedA: number, reservedB: number): boolean {\n\t\tconst input = this.slot(handle).input;\n\t\tinput.reservedA = reservedA;\n\t\tinput.reservedB = reservedB;\n\t\treturn true;\n\t}\n\n\twriteInputButton(handle: number, buttonMask: number, pressed: boolean): boolean {\n\t\tconst input = this.slot(handle).input;\n\t\tinput.buttons = pressed ? (input.buttons | buttonMask) : (input.buttons & ~buttonMask);\n\t\treturn true;\n\t}\n\n\treadSnapshot(handle: number, out?: StageBehaviorSnapshot): StageBehaviorSnapshot | null {\n\t\tconst snapshot = this.slots.get(handle)?.snapshot ?? null;\n\t\tif (!snapshot) return null;\n\t\tif (!out) return { ...snapshot };\n\t\tObject.assign(out, snapshot);\n\t\treturn out;\n\t}\n\n\tattachThruster(handle: number, opts: StageThrusterOptions): boolean {\n\t\tthis.slot(handle).attachments.set('thruster', opts);\n\t\treturn true;\n\t}\n\n\tsetThrusterInput(\n\t\thandle: number,\n\t\tthrust: number,\n\t\trotate: number,\n\t\tvectorX = 0,\n\t\tvectorY = 0,\n\t): void {\n\t\tthis.slot(handle).inputs.push({\n\t\t\tkind: 'thruster',\n\t\t\targs: [thrust, rotate, vectorX, vectorY],\n\t\t});\n\t}\n\n\tattachTopDown(handle: number, opts: StageTopDownOptions): boolean {\n\t\tthis.slot(handle).attachments.set('topDown', opts);\n\t\treturn true;\n\t}\n\n\tsetTopDownInput(handle: number, moveX: number, moveY: number): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'topDown', args: [moveX, moveY] });\n\t}\n\n\tattachShooter2D(handle: number, opts: StageShooter2DOptions): boolean {\n\t\tthis.slot(handle).attachments.set('shooter2d', opts);\n\t\treturn true;\n\t}\n\n\tattachScreenWrap(handle: number, opts: StageScreenWrapOptions): boolean {\n\t\tthis.slot(handle).attachments.set('screenWrap', opts);\n\t\treturn true;\n\t}\n\n\tqueryScreenWrap(handle: number): { fsm: number; lastWrappedAxes: number } | null {\n\t\treturn this.slots.get(handle)?.screenWrapQuery ?? null;\n\t}\n\n\tattachWorldBoundary(\n\t\thandle: number,\n\t\tdim: StageBoundaryDimValue,\n\t\topts: StageWorldBoundaryOptions,\n\t): boolean {\n\t\tthis.slot(handle).attachments.set('worldBoundary', { dim, ...opts });\n\t\treturn true;\n\t}\n\n\tqueryWorldBoundary(handle: number): { hits: number; clamped: [number, number, number] } | null {\n\t\treturn this.slots.get(handle)?.worldBoundaryQuery ?? null;\n\t}\n\n\tattachRicochet(handle: number, dim: StageRicochetDimValue, opts: StageRicochetOptions): boolean {\n\t\tthis.slot(handle).attachments.set('ricochet', { dim, ...opts });\n\t\treturn true;\n\t}\n\n\tattachPlatformer3D(handle: number, opts: StagePlatformer3DOptions): boolean {\n\t\tthis.slot(handle).attachments.set('platformer3d', opts);\n\t\treturn true;\n\t}\n\n\tsetPlatformer3DInputAxes(handle: number, moveX: number, moveZ: number): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'platformer3dAxes', args: [moveX, moveZ] });\n\t}\n\n\tsetPlatformer3DInputButtons(handle: number, jump: boolean, run: boolean): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'platformer3dButtons', args: [jump, run] });\n\t}\n\n\tattachPlatformer2D(handle: number, opts: StagePlatformer2DOptions): boolean {\n\t\tthis.slot(handle).attachments.set('platformer2d', opts);\n\t\treturn true;\n\t}\n\n\tsetPlatformer2DInputAxes(handle: number, moveX: number): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'platformer2dAxes', args: [moveX] });\n\t}\n\n\tsetPlatformer2DInputButtons(handle: number, jump: boolean, run: boolean): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'platformer2dButtons', args: [jump, run] });\n\t}\n\n\tattachFirstPerson(handle: number, opts: StageFirstPersonOptions): boolean {\n\t\tthis.slot(handle).attachments.set('firstPerson', opts);\n\t\treturn true;\n\t}\n\n\tsetFirstPersonInput(handle: number, input: StageFirstPersonInput): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'firstPerson', args: [input] });\n\t}\n\n\tattachJumper2D(handle: number, opts: StageJumper2DOptions): boolean {\n\t\tthis.slot(handle).attachments.set('jumper2d', opts);\n\t\treturn true;\n\t}\n\n\tsetJumper2DInput(handle: number, jumpPressed: boolean): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'jumper2d', args: [jumpPressed] });\n\t}\n\n\tattachJumper3D(handle: number, opts: StageJumper3DOptions): boolean {\n\t\tthis.slot(handle).attachments.set('jumper3d', opts);\n\t\treturn true;\n\t}\n\n\tsetJumper3DInput(handle: number, jumpPressed: boolean): void {\n\t\tthis.slot(handle).inputs.push({ kind: 'jumper3d', args: [jumpPressed] });\n\t}\n}\n","/**\n * `Simulation` (a.k.a. `BehaviorWorld`) — the primary public abstraction of\n * `@zylem/behaviors`. It owns the wasm runtime lifecycle (one\n * `WebAssembly.Instance` of `@zylem/runtime` per simulation), the fixed\n * timestep accumulator, an entity registry mapping opaque\n * {@link EntityHandle}s to runtime slots, and per-step event translation\n * from raw stage events into typed {@link SimulationEvent}s.\n *\n * Hosts (e.g. `@zylem/game-lib`) call {@link createSimulation} once per\n * stage, `spawn()`/`despawn()` entities, call `update(delta)` once per\n * render frame, and read poses for rendering from the returned\n * {@link SimulationFrame}.\n */\n\nimport {\n\tWasmStageRuntime,\n\tcreateWasmStageRuntime,\n\tStageBodyKind,\n\tStageEventType,\n\tSTAGE_RENDER_STRIDE,\n\treadStageRenderSlot,\n\ttype StageBehaviorSnapshot,\n\ttype StageBodyConfig,\n\ttype StageBodyKindValue,\n\ttype StageColliderConfig,\n\ttype StageColliderShape,\n\ttype StageDebugRender,\n\ttype StageBodyInfo,\n\ttype StageEvent,\n\ttype StagePose,\n\ttype StageRaycastHit,\n\ttype StageRenderSlot,\n\ttype WasmStageRuntimeOptions,\n} from './wasm-stage-runtime';\n\n/**\n * Opaque, stable identifier for a simulation entity. `slot` is the raw\n * runtime slot index — treat it as an implementation detail owned by the\n * Simulation (it is only exposed so hosts can wire behavior systems, which\n * address the batched buffers by slot).\n */\nexport interface EntityHandle {\n\t/** Monotonic public id, never reused within a Simulation. */\n\treadonly id: number;\n\t/** Raw runtime slot index. Internal — may be reused after despawn. */\n\treadonly slot: number;\n}\n\n/** Partial body description; unspecified fields use sensible defaults. */\nexport interface SimulationBodyDefinition {\n\tkind?: StageBodyKindValue;\n\tposition?: readonly [number, number, number];\n\trotation?: readonly [number, number, number, number];\n\tlinearDamping?: number;\n\tangularDamping?: number;\n\tgravityScale?: number;\n\tcanSleep?: boolean;\n\tccdEnabled?: boolean;\n\tlockRotation?: readonly [boolean, boolean, boolean];\n\tlockTranslation?: readonly [boolean, boolean, boolean];\n}\n\n/** Partial collider description; unspecified fields use sensible defaults. */\nexport interface SimulationColliderDefinition {\n\tshape: StageColliderShape;\n\toffset?: readonly [number, number, number];\n\tfriction?: number;\n\trestitution?: number;\n\tsensor?: boolean;\n\tcollisionGroups?: number;\n}\n\n/** Everything needed to materialize one entity inside the runtime. */\nexport interface EntityDefinition {\n\tbody?: SimulationBodyDefinition;\n\tcolliders?: SimulationColliderDefinition[];\n}\n\n/** Typed, handle-resolved simulation event. */\nexport type SimulationEvent =\n\t| {\n\t\ttype: 'collisionStarted' | 'collisionStopped';\n\t\ta: EntityHandle | null;\n\t\tb: EntityHandle | null;\n\t\t/** True when either collider in the pair is a sensor (zone overlap). */\n\t\tsensor: boolean;\n\t\t/** Best-effort contact normal (x, y); zero for sensor pairs / stops. */\n\t\tnormal: [number, number];\n\t}\n\t| { type: 'boundaryHit'; entity: EntityHandle | null; axes: number; signs: number }\n\t| { type: 'ricochet'; entity: EntityHandle | null; kind: number }\n\t| { type: 'regionEntered'; entity: EntityHandle | null; triggerId: number }\n\t| { type: 'jumpStarted'; entity: EntityHandle | null; jumpCount: number }\n\t| { type: 'landed'; entity: EntityHandle | null }\n\t| { type: 'wrapped'; entity: EntityHandle | null; axes: number }\n\t| { type: 'cooldownFired'; entity: EntityHandle | null; cooldownId: number };\n\n/**\n * Snapshot of one `update()` call: how many fixed steps ran, the live render\n * buffer view, the previous-step render copy + interpolation alpha for\n * smooth rendering, and the translated events from every step taken.\n */\nexport interface SimulationFrame {\n\t/** Wall-clock delta handed to `update()`. */\n\tdeltaTime: number;\n\t/** Number of fixed steps executed (0 when accumulating). */\n\tstepsTaken: number;\n\t/** Interpolation alpha in [0, 1): fraction of a fixed step accumulated. */\n\talpha: number;\n\t/** Live render buffer (post-step poses), {@link STAGE_RENDER_STRIDE} floats per slot. */\n\trender: Float32Array;\n\t/** Copy of the render buffer as of the step before the last one. */\n\tpreviousRender: Float32Array;\n\trenderStride: number;\n\t/** Typed events from all steps taken this update, oldest first. */\n\tevents: SimulationEvent[];\n}\n\nexport interface SimulationOptions extends WasmStageRuntimeOptions {\n\t/** Fixed physics timestep in seconds (default 1/60). */\n\tfixedTimestep?: number;\n\t/** Max fixed steps per `update()` to avoid death spirals (default 4). */\n\tmaxSubSteps?: number;\n}\n\nconst DEFAULT_FIXED_TIMESTEP = 1 / 60;\nconst DEFAULT_MAX_SUB_STEPS = 4;\n\n/**\n * The behavior world. Construct via {@link createSimulation}.\n */\nexport class Simulation {\n\t/**\n\t * The low-level wasm adapter. Behavior systems receive this as their\n\t * `wasmStage` context so descriptors can attach/query behaviors by slot;\n\t * hosts should prefer the handle-based methods on the Simulation itself.\n\t */\n\treadonly adapter: WasmStageRuntime;\n\n\treadonly fixedTimestep: number;\n\tprivate readonly maxSubSteps: number;\n\n\tprivate accumulator = 0;\n\tprivate nextEntityId = 1;\n\tprivate slotToHandle = new Map<number, EntityHandle>();\n\tprivate idToHandle = new Map<number, EntityHandle>();\n\tprivate previousRender: Float32Array = new Float32Array(0);\n\tprivate disposed = false;\n\n\tconstructor(adapter: WasmStageRuntime, options: SimulationOptions = {}) {\n\t\tthis.adapter = adapter;\n\t\tthis.fixedTimestep = options.fixedTimestep ?? DEFAULT_FIXED_TIMESTEP;\n\t\tthis.maxSubSteps = Math.max(1, options.maxSubSteps ?? DEFAULT_MAX_SUB_STEPS);\n\t}\n\n\t// ─── Entity lifecycle ───────────────────────────────────────────────\n\n\t/**\n\t * Create a runtime entity from a plain definition. Returns `null` when\n\t * the runtime rejects the allocation.\n\t */\n\tspawn(definition: EntityDefinition = {}): EntityHandle | null {\n\t\tconst slot = this.adapter.createEntity();\n\t\tif (slot === 0xffffffff) return null;\n\n\t\tconst body = definition.body;\n\t\tconst bodyConfig: StageBodyConfig = {\n\t\t\tkind: body?.kind ?? StageBodyKind.Dynamic,\n\t\t\tposition: body?.position ?? [0, 0, 0],\n\t\t\trotation: body?.rotation ?? [0, 0, 0, 1],\n\t\t\tlinearDamping: body?.linearDamping ?? 0,\n\t\t\tangularDamping: body?.angularDamping ?? 0,\n\t\t\tgravityScale: body?.gravityScale ?? 1,\n\t\t\tcanSleep: body?.canSleep ?? false,\n\t\t\tccdEnabled: body?.ccdEnabled ?? true,\n\t\t\tlockRotation: body?.lockRotation ?? [false, false, false],\n\t\t\tlockTranslation: body?.lockTranslation ?? [false, false, false],\n\t\t};\n\t\tthis.adapter.attachBody(slot, bodyConfig);\n\n\t\tfor (const collider of definition.colliders ?? []) {\n\t\t\tconst config: StageColliderConfig = {\n\t\t\t\tshape: collider.shape,\n\t\t\t\toffset: collider.offset ?? [0, 0, 0],\n\t\t\t\tfriction: collider.friction ?? 0.5,\n\t\t\t\trestitution: collider.restitution ?? 0,\n\t\t\t\tsensor: collider.sensor ?? false,\n\t\t\t\tcollisionGroups: collider.collisionGroups ?? 0xffffffff,\n\t\t\t};\n\t\t\tthis.adapter.addCollider(slot, config);\n\t\t}\n\n\t\tconst handle: EntityHandle = { id: this.nextEntityId++, slot };\n\t\tthis.slotToHandle.set(slot, handle);\n\t\tthis.idToHandle.set(handle.id, handle);\n\t\treturn handle;\n\t}\n\n\tdespawn(handle: EntityHandle): boolean {\n\t\tconst registered = this.idToHandle.get(handle.id);\n\t\tif (!registered) return false;\n\t\tthis.idToHandle.delete(handle.id);\n\t\tif (this.slotToHandle.get(registered.slot) === registered) {\n\t\t\tthis.slotToHandle.delete(registered.slot);\n\t\t}\n\t\treturn this.adapter.destroyEntity(registered.slot);\n\t}\n\n\t/** Resolve a raw runtime slot back to its public handle, if alive. */\n\thandleForSlot(slot: number): EntityHandle | null {\n\t\treturn this.slotToHandle.get(slot) ?? null;\n\t}\n\n\tget entityCount(): number {\n\t\treturn this.idToHandle.size;\n\t}\n\n\t// ─── Per-frame update ───────────────────────────────────────────────\n\n\t/**\n\t * Advance the simulation by `deltaTime` seconds using a fixed-timestep\n\t * accumulator. Runs zero or more fixed steps and returns a\n\t * {@link SimulationFrame} with translated events and interpolation data.\n\t */\n\tupdate(deltaTime: number): SimulationFrame {\n\t\tconst events: SimulationEvent[] = [];\n\t\tthis.accumulator += Math.max(0, deltaTime);\n\t\tlet steps = 0;\n\n\t\twhile (this.accumulator >= this.fixedTimestep && steps < this.maxSubSteps) {\n\t\t\tthis.capturePreviousRender();\n\t\t\tthis.adapter.step(this.fixedTimestep);\n\t\t\tthis.translateEvents(this.adapter.drainEvents(), events);\n\t\t\tthis.accumulator -= this.fixedTimestep;\n\t\t\tsteps++;\n\t\t}\n\t\t// Drop leftover time we couldn't consume (death-spiral guard).\n\t\tif (steps === this.maxSubSteps && this.accumulator >= this.fixedTimestep) {\n\t\t\tthis.accumulator = this.accumulator % this.fixedTimestep;\n\t\t}\n\n\t\treturn {\n\t\t\tdeltaTime,\n\t\t\tstepsTaken: steps,\n\t\t\talpha: this.fixedTimestep > 0 ? this.accumulator / this.fixedTimestep : 0,\n\t\t\trender: this.adapter.render,\n\t\t\tpreviousRender: this.previousRender,\n\t\t\trenderStride: STAGE_RENDER_STRIDE,\n\t\t\tevents,\n\t\t};\n\t}\n\n\tprivate capturePreviousRender(): void {\n\t\tconst current = this.adapter.render;\n\t\tif (this.previousRender.length !== current.length) {\n\t\t\tthis.previousRender = new Float32Array(current.length);\n\t\t}\n\t\tthis.previousRender.set(current);\n\t}\n\n\tprivate translateEvents(raw: StageEvent[], out: SimulationEvent[]): void {\n\t\tfor (const event of raw) {\n\t\t\tconst primary = event.primarySlot !== null ? this.handleForSlot(event.primarySlot) : null;\n\t\t\tconst secondary = event.secondarySlot !== null ? this.handleForSlot(event.secondarySlot) : null;\n\t\t\tswitch (event.type) {\n\t\t\t\tcase StageEventType.CollisionStarted:\n\t\t\t\tcase StageEventType.CollisionStopped:\n\t\t\t\t\tout.push({\n\t\t\t\t\t\ttype: event.type === StageEventType.CollisionStarted\n\t\t\t\t\t\t\t? 'collisionStarted'\n\t\t\t\t\t\t\t: 'collisionStopped',\n\t\t\t\t\t\ta: primary,\n\t\t\t\t\t\tb: secondary,\n\t\t\t\t\t\tsensor: event.payload[0] !== 0,\n\t\t\t\t\t\tnormal: [event.payload[1], event.payload[2]],\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase StageEventType.BoundaryHit:\n\t\t\t\t\tout.push({\n\t\t\t\t\t\ttype: 'boundaryHit',\n\t\t\t\t\t\tentity: primary,\n\t\t\t\t\t\taxes: event.payload[0] | 0,\n\t\t\t\t\t\tsigns: event.payload[1] | 0,\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase StageEventType.Ricochet:\n\t\t\t\t\tout.push({ type: 'ricochet', entity: primary, kind: event.payload[0] | 0 });\n\t\t\t\t\tbreak;\n\t\t\t\tcase StageEventType.RegionEntered:\n\t\t\t\t\tout.push({ type: 'regionEntered', entity: primary, triggerId: event.payload[0] | 0 });\n\t\t\t\t\tbreak;\n\t\t\t\tcase StageEventType.JumpStarted:\n\t\t\t\t\tout.push({ type: 'jumpStarted', entity: primary, jumpCount: event.payload[0] | 0 });\n\t\t\t\t\tbreak;\n\t\t\t\tcase StageEventType.Landed:\n\t\t\t\t\tout.push({ type: 'landed', entity: primary });\n\t\t\t\t\tbreak;\n\t\t\t\tcase StageEventType.Wrapped:\n\t\t\t\t\tout.push({ type: 'wrapped', entity: primary, axes: event.payload[0] | 0 });\n\t\t\t\t\tbreak;\n\t\t\t\tcase StageEventType.CooldownFired:\n\t\t\t\t\tout.push({ type: 'cooldownFired', entity: primary, cooldownId: event.payload[0] | 0 });\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// ─── Handle-based reads / writes ────────────────────────────────────\n\n\tgetPose(handle: EntityHandle, out?: StagePose): StagePose | null {\n\t\treturn this.adapter.getPose(handle.slot, out);\n\t}\n\n\tsetPosition(handle: EntityHandle, x: number, y: number, z: number): boolean {\n\t\treturn this.adapter.setPosition(handle.slot, x, y, z);\n\t}\n\n\tsetRotation(handle: EntityHandle, x: number, y: number, z: number, w: number): boolean {\n\t\treturn this.adapter.setRotation(handle.slot, x, y, z, w);\n\t}\n\n\tsetLinearVelocity(handle: EntityHandle, x: number, y: number, z: number): boolean {\n\t\treturn this.adapter.setLinearVelocity(handle.slot, x, y, z);\n\t}\n\n\tgetLinearVelocity(handle: EntityHandle): [number, number, number] | null {\n\t\treturn this.adapter.getLinearVelocity(handle.slot);\n\t}\n\n\tsetAngularVelocity(handle: EntityHandle, x: number, y: number, z: number): boolean {\n\t\treturn this.adapter.setAngularVelocity(handle.slot, x, y, z);\n\t}\n\n\tapplyImpulse(handle: EntityHandle, x: number, y: number, z: number): boolean {\n\t\treturn this.adapter.applyImpulse(handle.slot, x, y, z);\n\t}\n\n\treadRenderSlot(handle: EntityHandle, out?: StageRenderSlot): StageRenderSlot | null {\n\t\treturn readStageRenderSlot(this.adapter.render, handle.slot, out);\n\t}\n\n\t/** Decode a handle's pose from the previous-step render copy. */\n\treadPreviousRenderSlot(handle: EntityHandle, out?: StageRenderSlot): StageRenderSlot | null {\n\t\treturn readStageRenderSlot(this.previousRender, handle.slot, out);\n\t}\n\n\treadSnapshot(handle: EntityHandle, out?: StageBehaviorSnapshot): StageBehaviorSnapshot | null {\n\t\treturn this.adapter.readSnapshot(handle.slot, out);\n\t}\n\n\t// ─── World-level controls / diagnostics ─────────────────────────────\n\n\tsetGravity(x: number, y: number, z: number): void {\n\t\tthis.adapter.setGravity(x, y, z);\n\t}\n\n\t/** Physics raycast; the hit's slot is resolved to an entity handle. */\n\tcastRay(\n\t\torigin: readonly [number, number, number],\n\t\tdir: readonly [number, number, number],\n\t\tmaxDistance: number,\n\t\tsolidOnly = true,\n\t): (Omit<StageRaycastHit, 'slot'> & { entity: EntityHandle | null }) | null {\n\t\tconst hit = this.adapter.castRay(origin, dir, maxDistance, solidOnly);\n\t\tif (!hit) return null;\n\t\treturn {\n\t\t\tdistance: hit.distance,\n\t\t\tnormal: hit.normal,\n\t\t\tentity: this.handleForSlot(hit.slot),\n\t\t};\n\t}\n\n\tgetBodyInfo(handle: EntityHandle): StageBodyInfo | null {\n\t\treturn this.adapter.getBodyInfo(handle.slot);\n\t}\n\n\tgetDebugRender(): StageDebugRender | null {\n\t\treturn this.adapter.getDebugRender();\n\t}\n\n\tget isDisposed(): boolean {\n\t\treturn this.disposed;\n\t}\n\n\t/** Destroy the wasm stage. The Simulation must not be used afterwards. */\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.slotToHandle.clear();\n\t\tthis.idToHandle.clear();\n\t\tthis.adapter.dispose();\n\t}\n}\n\n/** Alias matching the architecture doc's naming. */\nexport type BehaviorWorld = Simulation;\n\n/**\n * Load and instantiate the `@zylem/runtime` wasm module and wrap it in a\n * {@link Simulation}. One call per logical stage/world.\n */\nexport async function createSimulation(options: SimulationOptions = {}): Promise<Simulation> {\n\tconst adapter = await createWasmStageRuntime(options);\n\treturn new Simulation(adapter, options);\n}\n","import type {\n\tBehaviorDescriptor,\n\tBehaviorHandle,\n\tBehaviorRef,\n} from '../behaviors/behavior-descriptor';\nimport type { TransformState } from '../capabilities/transform-store';\n\n/**\n * Minimal, runtime-agnostic entity options contract.\n *\n * The full engine entity (in `@zylem/game-lib`) provides a richer options type,\n * but behaviors only rely on this loose shape.\n */\nexport interface GameEntityOptions {\n\t[key: string]: any;\n\tname?: string;\n}\n\n/**\n * Structural stand-in for the engine `GameEntity`.\n *\n * Behaviors annotate against this loose contract so that `@zylem/behaviors`\n * (and its `@zylem/behaviors/core` surface) never has to depend on the concrete\n * `@zylem/game-lib` entity implementation. The real engine entity is\n * structurally assignable to this type.\n */\nexport class GameEntity<TOptions = unknown> {\n\t[key: string]: any;\n\n\tuuid!: string;\n\tname!: string;\n\ttype!: string;\n\toptions?: TOptions & Record<string, unknown>;\n\tgroup: any = null;\n\tmesh?: any;\n\tmaterials?: any[];\n\t/** Opaque host-owned physics references (never inspected by behaviors). */\n\tbody: unknown | null = null;\n\tcollider: unknown | null = null;\n\tcolliderDesc?: any;\n\tcolliderDescs: any[] = [];\n\tbodyDesc?: any;\n\tphysicsAttached = false;\n\truntimeHandle?: number;\n\ttransformStore?: TransformState;\n\tnodeDestroy?: any;\n\tisInstanced?: boolean;\n\n\tprivate __behaviorRefs: BehaviorRef<any>[] = [];\n\n\tcreate(): this {\n\t\treturn this;\n\t}\n\n\tonCleanup(callback: () => void): this {\n\t\tvoid callback;\n\t\treturn this;\n\t}\n\n\tsetPosition(_x: number, _y: number, _z: number): void {}\n\tsetRotation(_x: number, _y: number, _z: number): void {}\n\tsetRotationZ(_z: number): void {}\n\tsetScale(_x: number, _y: number, _z: number): void {}\n\n\t/**\n\t * Attach a behavior to this entity. The real engine entity does substantially\n\t * more, but this functional stub stores the merged ref and builds the handle\n\t * so descriptor/handle logic (and tests that drive behaviors directly) work\n\t * without the full engine.\n\t */\n\tuse<\n\t\tO extends Record<string, any>,\n\t\tH extends Record<string, any> = Record<string, never>,\n\t>(\n\t\tdescriptor: BehaviorDescriptor<O, H>,\n\t\toptions?: Partial<O>,\n\t): BehaviorHandle<O, H> {\n\t\tconst mergedOptions = {\n\t\t\t...(descriptor.defaultOptions as O),\n\t\t\t...(options ?? {}),\n\t\t} as O;\n\t\tconst ref: BehaviorRef<O> = { descriptor, options: mergedOptions };\n\t\tthis.__behaviorRefs.push(ref as BehaviorRef<any>);\n\n\t\tconst baseHandle = {\n\t\t\tgetFSM: () => ref.fsm ?? null,\n\t\t\tgetOptions: () => ref.options,\n\t\t\tref,\n\t\t};\n\t\tconst extra = descriptor.createHandle\n\t\t\t? descriptor.createHandle(ref)\n\t\t\t: ({} as H);\n\t\treturn { ...baseHandle, ...extra } as BehaviorHandle<O, H>;\n\t}\n\n\t/** Live behavior refs attached via {@link use}. */\n\tgetBehaviorRefs(): BehaviorRef<any>[] {\n\t\treturn this.__behaviorRefs;\n\t}\n}\n\n/**\n * Factory contract injected into behavior systems via\n * {@link BehaviorSystemContext.createEntity}. The host engine supplies the real\n * entity factory at stage-construction time.\n */\nexport type CreateEntityFn = (\n\toptions?: Partial<GameEntityOptions>,\n) => GameEntity<GameEntityOptions>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa;AA2Df,SAAS,qBAAqB,SAAmD;AACvF,QAAM,eAA+B;AAAA,IACpC,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE;AAAA,IAC7B,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE;AAAA,IACnC,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE;AAAA,IAC7B,iBAAiB,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE;AAAA,IACpC,kBAAkB,CAAC;AAAA,IACnB,OAAO;AAAA,MACN,UAAU;AAA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c;AACjE,SAAK,eAAe,KAAK,GAAuB;AAEhD,UAAM,aAAa;AAAA,MAClB,QAAQ,MAAM,IAAI,OAAO;AAAA,MACzB,YAAY,MAAM,IAAI;AAAA,MACtB;AAAA,IACD;AACA,UAAM,QAAQ,WAAW,eACtB,WAAW,aAAa,GAAG,IAC1B,CAAC;AACL,WAAO,EAAE,GAAG,YAAY,GAAG,MAAM;AAAA,EAClC;AAAA;AAAA,EAGA,kBAAsC;AACrC,WAAO,KAAK;AAAA,EACb;AACD;","names":["moveX","moveY","moveZ"]}
@@ -1,9 +1,9 @@
1
- import { a as BehaviorDescriptor } from './behavior-system-DSNek0W9.js';
1
+ import { a as BehaviorDescriptor } from './behavior-system-CeJXzNvr.js';
2
2
  import { Material } from 'three';
3
3
  import { FractureOptions, DestructibleMesh } from '@dgreenheck/three-pinata';
4
4
  export { DestructibleMesh, FractureOptions, VoronoiOptions } from '@dgreenheck/three-pinata';
5
5
  export { D as DestructiblePrebakeWorkerAPI, P as PlainBufferGeometryPayload, a as PlainFractureOptions, c as PrebakeWorkerRequest, d as PrebakeWorkerResponse } from './payload-BQzu-oY_.js';
6
- import '@dimforge/rapier3d-compat';
6
+ import '@zylem/runtime';
7
7
 
8
8
  type FractureOptionsInput = NonNullable<ConstructorParameters<typeof FractureOptions>[0]>;
9
9
  type Destructible3DFragmentColliderShape = 'convexHull' | 'cuboid' | 'trimesh';
@@ -11,7 +11,35 @@ interface Destructible3DColliderOptions {
11
11
  shape?: Destructible3DFragmentColliderShape;
12
12
  sensor?: boolean;
13
13
  collisionGroups?: number;
14
- activeCollisionTypes?: number;
14
+ }
15
+ /**
16
+ * Plain-data collider definition produced for fracture fragments. The host
17
+ * (game-lib) translates these into simulation colliders when it attaches
18
+ * fragment entities to the WASM stage.
19
+ */
20
+ interface Destructible3DFragmentColliderDefinition {
21
+ shape: {
22
+ type: 'convexHull';
23
+ vertices: Float32Array;
24
+ } | {
25
+ type: 'trimesh';
26
+ vertices: Float32Array;
27
+ indices: Uint32Array;
28
+ } | {
29
+ type: 'box';
30
+ halfExtents: [number, number, number];
31
+ };
32
+ offset?: [number, number, number];
33
+ sensor: boolean;
34
+ collisionGroups?: number;
35
+ }
36
+ /** Plain-data body definition produced for independent fracture fragments. */
37
+ interface Destructible3DFragmentBodyDefinition {
38
+ kind: 'dynamic';
39
+ position: [number, number, number];
40
+ rotation: [number, number, number, number];
41
+ canSleep: boolean;
42
+ ccdEnabled: boolean;
15
43
  }
16
44
  interface Destructible3DFragmentPhysicsOptions {
17
45
  mode?: 'compound' | 'independent';
@@ -40,4 +68,4 @@ interface Destructible3DHandle {
40
68
  }
41
69
  declare const Destructible3DBehavior: BehaviorDescriptor<Destructible3DBehaviorOptions, Destructible3DHandle, unknown>;
42
70
 
43
- export { Destructible3DBehavior, type Destructible3DBehaviorOptions, type Destructible3DColliderOptions, type Destructible3DFragmentColliderShape, type Destructible3DFragmentPhysicsOptions, type Destructible3DHandle, type FractureOptionsInput };
71
+ export { Destructible3DBehavior, type Destructible3DBehaviorOptions, type Destructible3DColliderOptions, type Destructible3DFragmentBodyDefinition, type Destructible3DFragmentColliderDefinition, type Destructible3DFragmentColliderShape, type Destructible3DFragmentPhysicsOptions, type Destructible3DHandle, type FractureOptionsInput };
@@ -2,9 +2,10 @@ import {
2
2
  Destructible3DBehavior,
3
3
  DestructibleMesh,
4
4
  FractureOptions
5
- } from "./chunk-BXP4K7RF.js";
5
+ } from "./chunk-JVADRLWX.js";
6
6
  import "./chunk-HZMY3TT4.js";
7
7
  import "./chunk-EZNCCO4L.js";
8
+ import "./chunk-5WRI5ZAA.js";
8
9
  export {
9
10
  Destructible3DBehavior,
10
11
  DestructibleMesh,
@@ -9,6 +9,7 @@ import {
9
9
  plainToBufferGeometry,
10
10
  plainWorkerResultToTemplateParts
11
11
  } from "./chunk-HZMY3TT4.js";
12
+ import "./chunk-5WRI5ZAA.js";
12
13
  export {
13
14
  bufferGeometryToPlain,
14
15
  buildFractureGeometryCacheKey,
@@ -1,15 +1,17 @@
1
1
  import { Group } from 'three';
2
- import { RigidBody, Collider } from '@dimforge/rapier3d-compat';
3
2
 
4
3
  /**
5
4
  * Base entity interface - shared across modules to prevent circular dependencies
5
+ *
6
+ * `body` / `collider` are opaque host-owned physics references; simulation
7
+ * state itself lives in the wasm runtime and is addressed via `runtimeHandle`.
6
8
  */
7
9
  interface BaseEntityInterface {
8
10
  uuid: string;
9
11
  name: string;
10
12
  group: Group | null | undefined;
11
- body: RigidBody | null | undefined;
12
- collider: Collider | null | undefined;
13
+ body: unknown | null | undefined;
14
+ collider: unknown | null | undefined;
13
15
  }
14
16
 
15
17
  export type { BaseEntityInterface as B };
@@ -2,11 +2,11 @@ import { F as FirstPersonInputComponent, b as FirstPersonStateComponent, a as Fi
2
2
  export { c as createFirstPersonInputComponent, d as createFirstPersonMovementComponent, e as createFirstPersonStateComponent } from './components-qWwOsvwh.js';
3
3
  import { S as SyncStateMachine } from './sync-state-machine-CZyspBpj.js';
4
4
  import { Vector3, Euler } from 'three';
5
- import { RigidBody } from '@dimforge/rapier3d-compat';
6
5
  import { F as FirstPersonPerspective } from './first-person-perspective-C9Mptl0-.js';
7
- import { T as TransformState, Z as ZylemWorld, a as BehaviorDescriptor } from './behavior-system-DSNek0W9.js';
8
- import { i as Vec3Input } from './vector-Bm65-FOG.js';
6
+ import { Y as TransformState, e as BehaviorRuntime, a as BehaviorDescriptor } from './behavior-system-CeJXzNvr.js';
7
+ import { i as Vec3Input } from './vector-DjhLUrak.js';
9
8
  import 'typescript-fsm';
9
+ import '@zylem/runtime';
10
10
 
11
11
  /**
12
12
  * First Person Controller Finite State Machine
@@ -62,16 +62,29 @@ declare class FirstPersonFSM {
62
62
  }
63
63
 
64
64
  /**
65
- * First Person Controller Behavior System
65
+ * First Person Presentation System
66
66
  *
67
- * Handles first-person camera control and movement:
68
- * - Reads input component for WASD movement and mouse look deltas
69
- * - Drives a FirstPersonPerspective (yaw/pitch accumulation)
70
- * - Writes velocity to transformStore (physics-based movement)
71
- * - Syncs camera position from the entity's rigid body each frame
67
+ * Presentation-only companion to the wasm `first_person` Stage behavior:
68
+ * - Syncs the FirstPersonPerspective eye position from the runtime pose
69
+ * - Applies the runtime's yaw/pitch (from the behavior snapshot) to the
70
+ * perspective so the camera matches the simulated look state
72
71
  * - Positions an optional viewmodel entity relative to the camera
72
+ *
73
+ * All movement/look simulation happens in the wasm runtime; this system only
74
+ * reads poses and snapshots.
73
75
  */
74
76
 
77
+ /**
78
+ * Entity interface for the first-person controller.
79
+ * Entities with this behavior have these components attached.
80
+ */
81
+ interface FirstPersonEntity {
82
+ uuid: string;
83
+ transformStore: TransformState;
84
+ firstPerson: FirstPersonMovementComponent;
85
+ $fps: FirstPersonInputComponent;
86
+ firstPersonState: FirstPersonStateComponent;
87
+ }
75
88
  /**
76
89
  * Viewmodel configuration for an entity that follows the camera.
77
90
  */
@@ -84,28 +97,11 @@ interface ViewmodelConfig {
84
97
  rotation?: Euler;
85
98
  }
86
99
  /**
87
- * Entity interface for first-person controller.
88
- * Entities with this behavior have these components attached.
89
- */
90
- interface FirstPersonEntity {
91
- uuid: string;
92
- body: RigidBody | null;
93
- transformStore: TransformState;
94
- firstPerson: FirstPersonMovementComponent;
95
- $fps: FirstPersonInputComponent;
96
- firstPersonState: FirstPersonStateComponent;
97
- }
98
- /**
99
- * First Person Controller Behavior
100
- *
101
- * Core movement + look system for first-person cameras.
102
- * Reads from entity.$fps input component and drives a FirstPersonPerspective.
100
+ * Presentation system driven by runtime pose + snapshot reads.
103
101
  */
104
- declare class FirstPersonSystem {
105
- private world;
102
+ declare class FirstPersonPresentation {
106
103
  private perspectives;
107
104
  private viewmodels;
108
- constructor(world: ZylemWorld | null);
109
105
  /**
110
106
  * Associate a FirstPersonPerspective with an entity (by uuid).
111
107
  * Called once by the descriptor system when the behavior is initialized.
@@ -119,18 +115,11 @@ declare class FirstPersonSystem {
119
115
  setViewmodel(entityUuid: string, config: ViewmodelConfig): void;
120
116
  hasViewmodel(entityUuid: string): boolean;
121
117
  /**
122
- * Update one first-person entity.
123
- */
124
- updateEntity(entity: any, _delta: number): void;
125
- /**
126
- * Update all first-person entities.
118
+ * Sync camera + viewmodel for one entity from the runtime state.
127
119
  */
128
- update(delta: number): void;
120
+ syncEntity(entityUuid: string, runtime: BehaviorRuntime, handle: number, movement: FirstPersonMovementComponent, state: FirstPersonStateComponent | undefined): void;
129
121
  /**
130
122
  * Position a viewmodel entity relative to the camera's eye position and rotation.
131
- *
132
- * The physics transform system overwrites group.position from the rigid body
133
- * each frame, so we must also move the body to keep them in sync.
134
123
  */
135
124
  private positionViewmodel;
136
125
  /** Cleanup */
@@ -201,4 +190,4 @@ declare const FirstPersonBehavior: BehaviorDescriptor<FirstPersonBehaviorOptions
201
190
  attachViewmodel: (entity: any, offset: Vec3Input) => void;
202
191
  }, FirstPersonEntity>;
203
192
 
204
- export { FirstPersonBehavior, type FirstPersonBehaviorOptions, type FirstPersonContext, type FirstPersonEntity, FirstPersonEvent, FirstPersonFSM, FirstPersonInputComponent, FirstPersonMovementComponent, FirstPersonState, FirstPersonStateComponent, FirstPersonSystem, type ViewmodelConfig };
193
+ export { FirstPersonBehavior, type FirstPersonBehaviorOptions, type FirstPersonContext, type FirstPersonEntity, FirstPersonEvent, FirstPersonFSM, FirstPersonInputComponent, FirstPersonMovementComponent, FirstPersonPresentation, FirstPersonState, FirstPersonStateComponent, type ViewmodelConfig };
@@ -2,24 +2,25 @@ import {
2
2
  FirstPersonBehavior,
3
3
  FirstPersonEvent,
4
4
  FirstPersonFSM,
5
- FirstPersonState,
6
- FirstPersonSystem
7
- } from "./chunk-WXXXJ22R.js";
5
+ FirstPersonPresentation,
6
+ FirstPersonState
7
+ } from "./chunk-5NJGASUJ.js";
8
8
  import {
9
9
  createFirstPersonInputComponent,
10
10
  createFirstPersonMovementComponent,
11
11
  createFirstPersonStateComponent
12
12
  } from "./chunk-QVCMJ4Q2.js";
13
- import "./chunk-WWVD5DR5.js";
14
- import "./chunk-OTLSUYQQ.js";
15
- import "./chunk-4URF65BR.js";
13
+ import "./chunk-M3QDKKDF.js";
14
+ import "./chunk-AS3HR7AS.js";
15
+ import "./chunk-E4X4YJZB.js";
16
16
  import "./chunk-EZNCCO4L.js";
17
+ import "./chunk-5WRI5ZAA.js";
17
18
  export {
18
19
  FirstPersonBehavior,
19
20
  FirstPersonEvent,
20
21
  FirstPersonFSM,
22
+ FirstPersonPresentation,
21
23
  FirstPersonState,
22
- FirstPersonSystem,
23
24
  createFirstPersonInputComponent,
24
25
  createFirstPersonMovementComponent,
25
26
  createFirstPersonStateComponent
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- export { a as BehaviorDescriptor, c as BehaviorHandle, d as BehaviorRef, e as BehaviorSystem, g as BehaviorSystemFactory, D as DefineBehaviorConfig, K as defineBehavior } from './behavior-system-DSNek0W9.js';
2
- export { u as useBehavior } from './use-behavior-h9-T5FSv.js';
3
- export { P as PhysicsBodyComponent, T as TransformComponent, c as createPhysicsBodyComponent, a as createTransformComponent } from './components-BWG1GkZA.js';
1
+ export { a as BehaviorDescriptor, c as BehaviorHandle, d as BehaviorRef, f as BehaviorSystem, h as BehaviorSystemFactory, D as DefineBehaviorConfig, a4 as defineBehavior } from './behavior-system-CeJXzNvr.js';
2
+ export { P as PhysicsBodyComponent, T as TransformComponent, c as createPhysicsBodyComponent, a as createTransformComponent, u as useBehavior } from './components-BANNjAZP.js';
4
3
  export { T as ThrusterInputComponent, a as ThrusterMovementComponent, b as ThrusterStateComponent, c as createThrusterInputComponent, d as createThrusterMovementComponent, e as createThrusterStateComponent } from './components-B29WHGQN.js';
5
- export { PlayerInput, ThrusterBehavior, ThrusterBehaviorOptions, ThrusterEntity, ThrusterEvent, ThrusterFSM, ThrusterFSMContext, ThrusterState, ThrusterSystem } from './thruster.js';
4
+ export { PlayerInput, ThrusterBehavior, ThrusterBehaviorOptions, ThrusterEntity, ThrusterEvent, ThrusterFSM, ThrusterFSMContext, ThrusterState } from './thruster.js';
6
5
  export { T as TopDownMovementComponent, a as TopDownMovementInputComponent, b as TopDownMovementStateComponent, c as createTopDownMovementComponent, d as createTopDownMovementInputComponent, e as createTopDownMovementStateComponent } from './components-XCpL6IYt.js';
7
- export { TopDownMovementBehavior, TopDownMovementBehaviorOptions, TopDownMovementEntity, TopDownMovementHandle, TopDownMovementSystem } from './top-down-movement.js';
6
+ export { TopDownMovementBehavior, TopDownMovementBehaviorOptions, TopDownMovementEntity, TopDownMovementHandle } from './top-down-movement.js';
8
7
  export { Shooter2DBehavior, Shooter2DBehaviorOptions, Shooter2DFireArgs, Shooter2DHandle, Shooter2DProjectileFactory, Shooter2DSourceEntity, Shooter2DStageLike, Shooter2DStateComponent, Shooter2DTarget, createShooter2DStateComponent } from './shooter-2d.js';
9
8
  export { ScreenWrapBehavior, ScreenWrapEvent, ScreenWrapFSM, ScreenWrapOptions, ScreenWrapState } from './screen-wrap.js';
10
9
  export { ScreenVisibilityBehavior, ScreenVisibilityChangeContext, ScreenVisibilityFSM, ScreenVisibilityHandle, ScreenVisibilityOptions, ScreenVisibilitySize, ScreenVisibilitySnapshot } from './screen-visibility.js';
@@ -12,15 +11,15 @@ export { WorldBoundary2DBehavior, WorldBoundary2DBounds, WorldBoundary2DEvent, W
12
11
  export { WorldBoundary3DBehavior, WorldBoundary3DBounds, WorldBoundary3DEvent, WorldBoundary3DFSM, WorldBoundary3DHandle, WorldBoundary3DHit, WorldBoundary3DHits, WorldBoundary3DOptions, WorldBoundary3DPosition, WorldBoundary3DState, computeWorldBoundary3DHits, hasAnyWorldBoundary3DHit } from './world-boundary-3d.js';
13
12
  export { Ricochet2DBehavior, Ricochet2DCollisionContext, Ricochet2DEvent, Ricochet2DFSM, Ricochet2DHandle, Ricochet2DOptions, Ricochet2DResult, Ricochet2DState, RicochetCallback } from './ricochet-2d.js';
14
13
  export { Ricochet3DBehavior, Ricochet3DCallback, Ricochet3DCollisionContext, Ricochet3DEvent, Ricochet3DFSM, Ricochet3DHandle, Ricochet3DOptions, Ricochet3DResult, Ricochet3DState } from './ricochet-3d.js';
15
- export { Platformer2DBehavior, Platformer2DBehaviorOptions, Platformer2DCollisionContext, Platformer2DContext, Platformer2DEntity, Platformer2DEvent, Platformer2DFSM, Platformer2DInputComponent, Platformer2DMovementComponent, Platformer2DState, Platformer2DStateComponent, Platformer2DSystem, createPlatformer2DInputComponent, createPlatformer2DMovementComponent, createPlatformer2DStateComponent } from './platformer-2d.js';
16
- export { Platformer3DBehavior, Platformer3DBehaviorOptions, Platformer3DContext, Platformer3DEntity, Platformer3DEvent, Platformer3DFSM, Platformer3DInputComponent, Platformer3DMovementComponent, Platformer3DState, Platformer3DStateComponent, Platformer3DSystem, PlatformerCollisionContext, createPlatformer3DInputComponent, createPlatformer3DMovementComponent, createPlatformer3DStateComponent } from './platformer-3d.js';
14
+ export { Platformer2DBehavior, Platformer2DBehaviorOptions, Platformer2DCollisionContext, Platformer2DContext, Platformer2DEntity, Platformer2DEvent, Platformer2DFSM, Platformer2DInputComponent, Platformer2DMovementComponent, Platformer2DState, Platformer2DStateComponent, createPlatformer2DInputComponent, createPlatformer2DMovementComponent, createPlatformer2DStateComponent } from './platformer-2d.js';
15
+ export { Platformer3DBehavior, Platformer3DBehaviorOptions, Platformer3DContext, Platformer3DEntity, Platformer3DEvent, Platformer3DFSM, Platformer3DInputComponent, Platformer3DMovementComponent, Platformer3DState, Platformer3DStateComponent, PlatformerCollisionContext, createPlatformer3DInputComponent, createPlatformer3DMovementComponent, createPlatformer3DStateComponent } from './platformer-3d.js';
17
16
  export { F as FirstPersonInputComponent, a as FirstPersonMovementComponent, b as FirstPersonStateComponent, c as createFirstPersonInputComponent, d as createFirstPersonMovementComponent, e as createFirstPersonStateComponent } from './components-qWwOsvwh.js';
18
- export { FirstPersonBehavior, FirstPersonBehaviorOptions, FirstPersonContext, FirstPersonEntity, FirstPersonEvent, FirstPersonFSM, FirstPersonState, FirstPersonSystem, ViewmodelConfig } from './first-person.js';
17
+ export { FirstPersonBehavior, FirstPersonBehaviorOptions, FirstPersonContext, FirstPersonEntity, FirstPersonEvent, FirstPersonFSM, FirstPersonPresentation, FirstPersonState, ViewmodelConfig } from './first-person.js';
19
18
  export { J as JumpConfig3D, a as JumpContext3D, b as JumpInput3D, c as JumpState3D, V as Vec3Like, d as createJumpConfig3D, e as createJumpInput3D, f as createJumpState3D } from './components--hjBMTnz.js';
20
- export { Jumper3DBehavior, Jumper3DBehaviorOptions, Jumper3DEntity, Jumper3DEvent, Jumper3DFSM, Jumper3DState, Jumper3DSystem, JumperTickEvent, JumperTickResult } from './jumper-3d.js';
21
- export { JumpConfig2D, JumpContext2D, JumpInput2D, JumpState2D, Jumper2DBehavior, Jumper2DBehaviorOptions, Jumper2DEntity, Jumper2DEvent, Jumper2DFSM, Jumper2DState, Jumper2DSystem, Jumper2DTickEvent, Jumper2DTickResult, createJumpConfig2D, createJumpInput2D, createJumpState2D } from './jumper-2d.js';
19
+ export { Jumper3DBehavior, Jumper3DBehaviorOptions, Jumper3DEntity, Jumper3DEvent, Jumper3DFSM, Jumper3DState } from './jumper-3d.js';
20
+ export { JumpConfig2D, JumpContext2D, JumpInput2D, JumpState2D, Jumper2DBehavior, Jumper2DBehaviorOptions, Jumper2DEntity, Jumper2DEvent, Jumper2DFSM, Jumper2DState, createJumpConfig2D, createJumpInput2D, createJumpState2D } from './jumper-2d.js';
22
21
  export { CooldownBehavior, CooldownConfig, CooldownEntry, CooldownHandle, CooldownOptions, fireCooldown, getCooldown, getCooldownStore, registerCooldown, resetCooldown, tickCooldowns } from './cooldown.js';
23
- export { Destructible3DBehavior, Destructible3DBehaviorOptions, Destructible3DColliderOptions, Destructible3DFragmentColliderShape, Destructible3DFragmentPhysicsOptions, Destructible3DHandle, FractureOptionsInput } from './destructible-3d.js';
22
+ export { Destructible3DBehavior, Destructible3DBehaviorOptions, Destructible3DColliderOptions, Destructible3DFragmentBodyDefinition, Destructible3DFragmentColliderDefinition, Destructible3DFragmentColliderShape, Destructible3DFragmentPhysicsOptions, Destructible3DHandle, FractureOptionsInput } from './destructible-3d.js';
24
23
  export { DestructibleMesh, FractureOptions, VoronoiOptions } from '@dgreenheck/three-pinata';
25
24
  export { D as DestructiblePrebakeWorkerAPI, P as PlainBufferGeometryPayload, a as PlainFractureOptions, c as PrebakeWorkerRequest, d as PrebakeWorkerResponse } from './payload-BQzu-oY_.js';
26
25
  export { BurstParticlePresetOptions, ParticleEmitterBehavior, ParticleEmitterBehaviorOptions, ParticleEmitterHandle, particlePresets } from './particle-emitter.js';
@@ -31,14 +30,14 @@ export { TopDownShooterCoordinator, TopDownShooterEntity, TopDownShooterInput }
31
30
  export { MultidirectionalSpaceShooterCoordinator, MultidirectionalSpaceShooterEntity, MultidirectionalSpaceShooterInput } from './coordinators/multidirectional-space-shooter.js';
32
31
  export { F as FacingAngle2DEntity, R as ResolvedAim2D, S as Shooter2DAimFireInput, f as fireShooter2DIfRequested, g as getEntityFacingAngle2D, r as resolveAim2D } from './shooter-fire-DGripl0z.js';
33
32
  export { P as ParticleEffectDefinition, a as ParticleMagicAgency, b as ParticleMagicAlignment, c as ParticleMagicModifierInput, d as ParticleMagicModifierOptions, e as ParticleMagicOrder, f as ParticleMagicRealityEffect, g as ParticleMagicTemperament, h as ParticlePresetMaterialOptions, S as SemanticParticlePresetOptions, v as particleEffect } from './spark-Dx3cJbTW.js';
34
- import '@dimforge/rapier3d-compat';
33
+ import '@zylem/runtime';
35
34
  import 'three';
36
35
  import './sync-state-machine-CZyspBpj.js';
37
36
  import 'typescript-fsm';
38
- import './vector-Bm65-FOG.js';
39
- import './entity-types-CmtQ-IBp.js';
37
+ import './vector-DjhLUrak.js';
38
+ import './entity-types-DhfsZbSK.js';
40
39
  import './first-person-perspective-C9Mptl0-.js';
41
- import './moveable-BLTHO7Jq.js';
40
+ import './moveable-XhzWPAw5.js';
42
41
  import 'three/webgpu';
43
42
 
44
43
  /**