@relu-interactives/spatial-ecs 0.11.0 → 0.11.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 (503) hide show
  1. package/dist/{System-BldSHxZV.d.cts → System-D8vm-Jvv.d.cts} +110 -3
  2. package/dist/{System-CADhPyQs.d.ts → System-ttkDQCrj.d.ts} +110 -3
  3. package/dist/{XRHandPose-D3Ab1Dfs.d.cts → XRHandPose-C97XVW2R.d.cts} +2 -41
  4. package/dist/{XRHandPose-BNSwd1y9.d.ts → XRHandPose-CxXtWF1y.d.ts} +2 -41
  5. package/dist/animation/index.cjs +33 -1
  6. package/dist/animation/index.cjs.map +1 -1
  7. package/dist/animation/index.js +1 -1
  8. package/dist/{chunk-TY3XCHOR.js → chunk-2DJBNWBB.js} +56 -15
  9. package/dist/chunk-2DJBNWBB.js.map +1 -0
  10. package/dist/{chunk-WWP46AEF.js → chunk-4FHJA6U4.js} +8 -4
  11. package/dist/chunk-4FHJA6U4.js.map +1 -0
  12. package/dist/{chunk-GSWC6LLD.js → chunk-GMSFEXUZ.js} +35 -3
  13. package/dist/chunk-GMSFEXUZ.js.map +1 -0
  14. package/dist/{chunk-JEPUCLZX.js → chunk-QAZCVCMP.js} +88 -27
  15. package/dist/chunk-QAZCVCMP.js.map +1 -0
  16. package/dist/{chunk-NXASMBDS.js → chunk-SM5KGNYX.js} +4 -4
  17. package/dist/{chunk-NXASMBDS.js.map → chunk-SM5KGNYX.js.map} +1 -1
  18. package/dist/{chunk-JNYPJB55.js → chunk-T7SRBLPJ.js} +24 -4
  19. package/dist/chunk-T7SRBLPJ.js.map +1 -0
  20. package/dist/components/index.cjs +21 -1
  21. package/dist/components/index.cjs.map +1 -1
  22. package/dist/components/index.d.cts +3 -3
  23. package/dist/components/index.d.ts +3 -3
  24. package/dist/components/index.js +1 -1
  25. package/dist/docs/api/Behaviour/classes/Behaviour.md +187 -46
  26. package/dist/docs/api/Behaviour/type-aliases/UiInteractionEvent.md +5 -5
  27. package/dist/docs/api/Component/classes/Component.md +7 -1
  28. package/dist/docs/api/components/classes/AnimationComponent.md +26 -26
  29. package/dist/docs/api/components/classes/AudioComponent.md +20 -19
  30. package/dist/docs/api/components/classes/BoneAttachmentComponent.md +65 -0
  31. package/dist/docs/api/components/classes/CameraComponent.md +14 -14
  32. package/dist/docs/api/components/classes/EntityType.md +3 -3
  33. package/dist/docs/api/components/classes/Environment.md +3 -3
  34. package/dist/docs/api/components/classes/IKComponent.md +59 -0
  35. package/dist/docs/api/components/classes/ImageComponent.md +7 -7
  36. package/dist/docs/api/components/classes/ImageTarget.md +7 -7
  37. package/dist/docs/api/components/classes/ImageTargetAnchor.md +4 -4
  38. package/dist/docs/api/components/classes/InstanceSlotComponent.md +4 -4
  39. package/dist/docs/api/components/classes/InstancedMeshComponent.md +10 -10
  40. package/dist/docs/api/components/classes/LightComponent.md +6 -6
  41. package/dist/docs/api/components/classes/MaterialComponent.md +14 -14
  42. package/dist/docs/api/components/classes/MeshComponent.md +3 -3
  43. package/dist/docs/api/components/classes/MeshGeometryComponent.md +9 -9
  44. package/dist/docs/api/components/classes/ModelComponent.md +6 -6
  45. package/dist/docs/api/components/classes/Name.md +3 -3
  46. package/dist/docs/api/components/classes/NetworkIdentityComponent.md +42 -0
  47. package/dist/docs/api/components/classes/NetworkSpawnerComponent.md +48 -0
  48. package/dist/docs/api/components/classes/NetworkTransformComponent.md +51 -0
  49. package/dist/docs/api/components/classes/NetworkedPropsComponent.md +47 -0
  50. package/dist/docs/api/components/classes/Object3DRef.md +4 -4
  51. package/dist/docs/api/components/classes/ParentId.md +3 -3
  52. package/dist/docs/api/components/classes/PhysicsComponent.md +7 -7
  53. package/dist/docs/api/components/classes/Postprocessing.md +3 -3
  54. package/dist/docs/api/components/classes/PrefabInstance.md +5 -5
  55. package/dist/docs/api/components/classes/PrefabNode.md +3 -3
  56. package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
  57. package/dist/docs/api/components/classes/ScriptObjectComponent.md +9 -9
  58. package/dist/docs/api/components/classes/Selectable.md +3 -3
  59. package/dist/docs/api/components/classes/SelectionTransformState.md +5 -5
  60. package/dist/docs/api/components/classes/SpriteComponent.md +7 -7
  61. package/dist/docs/api/components/classes/TransformComponent.md +12 -12
  62. package/dist/docs/api/components/classes/UIButtonComponent.md +18 -14
  63. package/dist/docs/api/components/classes/UIPanelComponent.md +13 -11
  64. package/dist/docs/api/components/classes/UISliderComponent.md +16 -11
  65. package/dist/docs/api/components/classes/UITextComponent.md +14 -12
  66. package/dist/docs/api/components/classes/UIToggleComponent.md +12 -9
  67. package/dist/docs/api/components/classes/VRTeleportAreaComponent.md +6 -6
  68. package/dist/docs/api/components/classes/VideoComponent.md +28 -28
  69. package/dist/docs/api/components/classes/XRAnchorComponent.md +3 -3
  70. package/dist/docs/api/components/classes/XREnvironmentComponent.md +5 -5
  71. package/dist/docs/api/components/classes/XRHandPoseComponent.md +4 -4
  72. package/dist/docs/api/components/classes/XRInteractableComponent.md +28 -28
  73. package/dist/docs/api/components/classes/XRInteractorComponent.md +10 -10
  74. package/dist/docs/api/components/classes/XRInteractorSideComponent.md +3 -3
  75. package/dist/docs/api/components/classes/XRRigComponent.md +17 -17
  76. package/dist/docs/api/components/functions/createAttachPoint.md +1 -1
  77. package/dist/docs/api/components/functions/createHandPoseEntry.md +1 -1
  78. package/dist/docs/api/components/functions/defaultMaterialValue.md +1 -1
  79. package/dist/docs/api/components/functions/handPoseDefinitionFor.md +1 -1
  80. package/dist/docs/api/components/functions/normalizeBoneHold.md +25 -0
  81. package/dist/docs/api/components/functions/normalizeEnvironmentLighting.md +1 -1
  82. package/dist/docs/api/components/functions/normalizeIKChain.md +25 -0
  83. package/dist/docs/api/components/functions/normalizePhysicsState.md +1 -1
  84. package/dist/docs/api/components/functions/setModelLoadState.md +1 -1
  85. package/dist/docs/api/components/functions/setPhysicsLiveRef.md +1 -1
  86. package/dist/docs/api/components/index.md +18 -0
  87. package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +9 -9
  88. package/dist/docs/api/components/type-aliases/BoneAttachmentOptions.md +35 -0
  89. package/dist/docs/api/components/type-aliases/BoneHold.md +34 -0
  90. package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +13 -13
  91. package/dist/docs/api/components/type-aliases/CameraProjection.md +1 -1
  92. package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +1 -1
  93. package/dist/docs/api/components/type-aliases/ColliderShape.md +1 -1
  94. package/dist/docs/api/components/type-aliases/ColliderState.md +20 -20
  95. package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +4 -4
  96. package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +1 -1
  97. package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +8 -8
  98. package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +1 -1
  99. package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +1 -1
  100. package/dist/docs/api/components/type-aliases/EnvironmentLightingState.md +9 -9
  101. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxImageProjection.md +1 -1
  102. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +8 -8
  103. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +1 -1
  104. package/dist/docs/api/components/type-aliases/EnvironmentState.md +6 -6
  105. package/dist/docs/api/components/type-aliases/EnvironmentToneMapping.md +1 -1
  106. package/dist/docs/api/components/type-aliases/IKChain.md +37 -0
  107. package/dist/docs/api/components/type-aliases/IKLimb.md +15 -0
  108. package/dist/docs/api/components/type-aliases/IKOptions.md +27 -0
  109. package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +3 -3
  110. package/dist/docs/api/components/type-aliases/ImageTargetReference.md +7 -7
  111. package/dist/docs/api/components/type-aliases/InstanceTransform.md +13 -13
  112. package/dist/docs/api/components/type-aliases/InstancedMeshKind.md +1 -1
  113. package/dist/docs/api/components/type-aliases/LightShadowState.md +8 -8
  114. package/dist/docs/api/components/type-aliases/LightValueState.md +12 -12
  115. package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +1 -1
  116. package/dist/docs/api/components/type-aliases/MaterialValueState.md +28 -28
  117. package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +1 -1
  118. package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +7 -7
  119. package/dist/docs/api/components/type-aliases/ModelLoadState.md +1 -1
  120. package/dist/docs/api/components/type-aliases/NetValue.md +23 -0
  121. package/dist/docs/api/components/type-aliases/NetworkTransformOptions.md +18 -0
  122. package/dist/docs/api/components/type-aliases/PhysicsState.md +3 -3
  123. package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +3 -3
  124. package/dist/docs/api/components/type-aliases/PostprocessingState.md +62 -62
  125. package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +3 -3
  126. package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +2 -2
  127. package/dist/docs/api/components/type-aliases/RigidbodyState.md +17 -17
  128. package/dist/docs/api/components/type-aliases/RigidbodyType.md +1 -1
  129. package/dist/docs/api/components/type-aliases/ScriptEntry.md +8 -8
  130. package/dist/docs/api/components/type-aliases/ScriptObjectComponentInput.md +1 -1
  131. package/dist/docs/api/components/type-aliases/ScriptObjectRuntimeState.md +1 -1
  132. package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +1 -1
  133. package/dist/docs/api/components/type-aliases/TransformData.md +4 -4
  134. package/dist/docs/api/components/type-aliases/TransformModeValue.md +1 -1
  135. package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +1 -1
  136. package/dist/docs/api/components/type-aliases/UIButtonOptions.md +21 -13
  137. package/dist/docs/api/components/type-aliases/UIPanelOptions.md +14 -10
  138. package/dist/docs/api/components/type-aliases/UISliderOptions.md +20 -10
  139. package/dist/docs/api/components/type-aliases/UITextOptions.md +15 -11
  140. package/dist/docs/api/components/type-aliases/UIToggleOptions.md +14 -8
  141. package/dist/docs/api/components/type-aliases/UiFollowMode.md +1 -1
  142. package/dist/docs/api/components/type-aliases/UiIconPosition.md +13 -0
  143. package/dist/docs/api/components/type-aliases/UiSliderVariant.md +13 -0
  144. package/dist/docs/api/components/type-aliases/UiTextAlign.md +1 -1
  145. package/dist/docs/api/components/type-aliases/UiTextVAlign.md +1 -1
  146. package/dist/docs/api/components/type-aliases/UiToggleVariant.md +13 -0
  147. package/dist/docs/api/components/type-aliases/VRTeleportAreaOptions.md +5 -5
  148. package/dist/docs/api/components/type-aliases/Vec3.md +4 -4
  149. package/dist/docs/api/components/type-aliases/VrTeleportShape.md +1 -1
  150. package/dist/docs/api/components/type-aliases/XRAnchorOptions.md +2 -2
  151. package/dist/docs/api/components/type-aliases/XRHandPoseOptions.md +3 -3
  152. package/dist/docs/api/components/type-aliases/XRInteractableOptions.md +27 -27
  153. package/dist/docs/api/components/type-aliases/XRInteractorOptions.md +9 -9
  154. package/dist/docs/api/components/type-aliases/XRRigOptions.md +16 -16
  155. package/dist/docs/api/components/type-aliases/XrAttachPoint.md +13 -13
  156. package/dist/docs/api/components/type-aliases/XrDistanceGrabBehavior.md +1 -1
  157. package/dist/docs/api/components/type-aliases/XrEnvironmentKind.md +1 -1
  158. package/dist/docs/api/components/type-aliases/XrEnvironmentOrientation.md +1 -1
  159. package/dist/docs/api/components/type-aliases/XrEnvironmentPhysics.md +1 -1
  160. package/dist/docs/api/components/type-aliases/XrGrabGesture.md +1 -1
  161. package/dist/docs/api/components/type-aliases/XrGrabHands.md +1 -1
  162. package/dist/docs/api/components/type-aliases/XrGrabReach.md +1 -1
  163. package/dist/docs/api/components/type-aliases/XrHandPoseEntry.md +12 -12
  164. package/dist/docs/api/components/type-aliases/XrHandPreset.md +1 -1
  165. package/dist/docs/api/components/type-aliases/XrInteractorSide.md +1 -1
  166. package/dist/docs/api/components/type-aliases/XrInteractorType.md +1 -1
  167. package/dist/docs/api/components/type-aliases/XrLocomotionMode.md +1 -1
  168. package/dist/docs/api/components/type-aliases/XrTrackingOrigin.md +1 -1
  169. package/dist/docs/api/components/type-aliases/XrTwoHandRotation.md +1 -1
  170. package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +1 -1
  171. package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_LIGHTING.md +1 -1
  172. package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +1 -1
  173. package/dist/docs/api/components/variables/DEFAULT_INSTANCED_MESH_PARAMETERS.md +1 -1
  174. package/dist/docs/api/components/variables/DEFAULT_INSTANCE_TRANSFORM.md +1 -1
  175. package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +1 -1
  176. package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +1 -1
  177. package/dist/docs/api/components/variables/DEFAULT_POSE_CURLS.md +1 -1
  178. package/dist/docs/api/components/variables/DEFAULT_POSE_DIRECTIONS.md +1 -1
  179. package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +1 -1
  180. package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +1 -1
  181. package/dist/docs/api/components/variables/MODEL_NO_PATH_MESSAGE.md +1 -1
  182. package/dist/docs/api/index/classes/AnimationStateMachine.md +16 -16
  183. package/dist/docs/api/index/classes/AnimationStateManager.md +13 -13
  184. package/dist/docs/api/index/classes/AnimationSystem.md +3 -3
  185. package/dist/docs/api/index/classes/AudioMixer.md +161 -0
  186. package/dist/docs/api/index/classes/AudioSystem.md +138 -4
  187. package/dist/docs/api/index/classes/BoneHoldSystem.md +54 -0
  188. package/dist/docs/api/index/classes/CameraSyncSystem.md +2 -2
  189. package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +4 -4
  190. package/dist/docs/api/index/classes/HandPoseTracker.md +6 -6
  191. package/dist/docs/api/index/classes/IKSystem.md +98 -0
  192. package/dist/docs/api/index/classes/InputSystem.md +33 -33
  193. package/dist/docs/api/index/classes/InstancedMeshSystem.md +2 -2
  194. package/dist/docs/api/index/classes/LightSyncSystem.md +2 -2
  195. package/dist/docs/api/index/classes/MaterialSyncSystem.md +3 -3
  196. package/dist/docs/api/index/classes/MeshGeometrySystem.md +2 -2
  197. package/dist/docs/api/index/classes/ObjectManagementSystem.md +269 -14
  198. package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +2 -2
  199. package/dist/docs/api/index/classes/PhysicsSyncSystem.md +4 -4
  200. package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +4 -4
  201. package/dist/docs/api/index/classes/RenderSystem.md +3 -3
  202. package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +4 -4
  203. package/dist/docs/api/index/classes/ScriptObject.md +10 -10
  204. package/dist/docs/api/index/classes/ScriptObjectSystem.md +6 -6
  205. package/dist/docs/api/index/classes/SlotChooser.md +59 -0
  206. package/dist/docs/api/index/classes/TeleportAimGate.md +4 -4
  207. package/dist/docs/api/index/classes/ThrowVelocityTracker.md +4 -4
  208. package/dist/docs/api/index/classes/TransformSyncSystem.md +2 -2
  209. package/dist/docs/api/index/classes/UIInteractionSystem.md +3 -3
  210. package/dist/docs/api/index/classes/UIPanelSystem.md +4 -4
  211. package/dist/docs/api/index/classes/VRTeleportAreaSystem.md +2 -2
  212. package/dist/docs/api/index/classes/VideoSystem.md +4 -4
  213. package/dist/docs/api/index/classes/World.md +168 -98
  214. package/dist/docs/api/index/classes/XRAnchorSystem.md +4 -4
  215. package/dist/docs/api/index/classes/XRControllerVisualSystem.md +4 -4
  216. package/dist/docs/api/index/classes/XREnvironmentSystem.md +7 -7
  217. package/dist/docs/api/index/classes/XRHandPoseSystem.md +5 -5
  218. package/dist/docs/api/index/classes/XRHitTestSystem.md +4 -4
  219. package/dist/docs/api/index/classes/XRHoverVisualSystem.md +4 -4
  220. package/dist/docs/api/index/classes/XRInputSystem.md +9 -9
  221. package/dist/docs/api/index/classes/XRInteractionSystem.md +18 -18
  222. package/dist/docs/api/index/classes/XRLocomotionSystem.md +7 -7
  223. package/dist/docs/api/index/classes/XRSessionSystem.md +6 -6
  224. package/dist/docs/api/index/classes/XRTeleportVisualSystem.md +4 -4
  225. package/dist/docs/api/index/functions/angularVelocityFrom.md +1 -1
  226. package/dist/docs/api/index/functions/applyHandMaterial.md +1 -1
  227. package/dist/docs/api/index/functions/applyPrefabToSnapshotInstances.md +1 -1
  228. package/dist/docs/api/index/functions/arcGroundCrossing.md +1 -1
  229. package/dist/docs/api/index/functions/buildComponentValueMaps.md +1 -1
  230. package/dist/docs/api/index/functions/buildNodeKeyMapsFromSnapshot.md +1 -1
  231. package/dist/docs/api/index/functions/buildNodeMapsFromSnapshot.md +1 -1
  232. package/dist/docs/api/index/functions/canonicalizeComponentValue.md +1 -1
  233. package/dist/docs/api/index/functions/clearModelCache.md +1 -1
  234. package/dist/docs/api/index/functions/clearPrefabCache.md +1 -1
  235. package/dist/docs/api/index/functions/cloneHandPose.md +1 -1
  236. package/dist/docs/api/index/functions/collectDiffPaths.md +1 -1
  237. package/dist/docs/api/index/functions/collectDirectPrefabDependencies.md +1 -1
  238. package/dist/docs/api/index/functions/collectEntitySubtree.md +1 -1
  239. package/dist/docs/api/index/functions/collectSnapshotSubtreeIds.md +1 -1
  240. package/dist/docs/api/index/functions/computeFingerCurl.md +1 -1
  241. package/dist/docs/api/index/functions/computeHandShape.md +1 -1
  242. package/dist/docs/api/index/functions/computeInstanceOverrides.md +1 -1
  243. package/dist/docs/api/index/functions/computePalmPose.md +1 -1
  244. package/dist/docs/api/index/functions/computePalmWidth.md +1 -1
  245. package/dist/docs/api/index/functions/computePinch.md +1 -1
  246. package/dist/docs/api/index/functions/computeSpread.md +1 -1
  247. package/dist/docs/api/index/functions/createAnimationComponent.md +1 -1
  248. package/dist/docs/api/index/functions/createAudioComponent.md +1 -1
  249. package/dist/docs/api/index/functions/createBoneAttachmentComponent.md +28 -0
  250. package/dist/docs/api/index/functions/createCameraComponent.md +1 -1
  251. package/dist/docs/api/index/functions/createEntityTypeComponent.md +1 -1
  252. package/dist/docs/api/index/functions/createEnvironmentComponent.md +1 -1
  253. package/dist/docs/api/index/functions/createGLTFLoader.md +30 -0
  254. package/dist/docs/api/index/functions/createHandMaterial.md +1 -1
  255. package/dist/docs/api/index/functions/createIKComponent.md +28 -0
  256. package/dist/docs/api/index/functions/createImageComponent.md +1 -1
  257. package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +1 -1
  258. package/dist/docs/api/index/functions/createImageTargetComponent.md +1 -1
  259. package/dist/docs/api/index/functions/createInstanceSlotComponent.md +1 -1
  260. package/dist/docs/api/index/functions/createInstancedMeshComponent.md +1 -1
  261. package/dist/docs/api/index/functions/createLightComponent.md +1 -1
  262. package/dist/docs/api/index/functions/createMaterialComponent.md +1 -1
  263. package/dist/docs/api/index/functions/createMeshComponent.md +1 -1
  264. package/dist/docs/api/index/functions/createMeshGeometryComponent.md +1 -1
  265. package/dist/docs/api/index/functions/createModelComponent.md +1 -1
  266. package/dist/docs/api/index/functions/createNameComponent.md +1 -1
  267. package/dist/docs/api/index/functions/createNetworkIdentityComponent.md +24 -0
  268. package/dist/docs/api/index/functions/createNetworkSpawnerComponent.md +28 -0
  269. package/dist/docs/api/index/functions/createNetworkTransformComponent.md +28 -0
  270. package/dist/docs/api/index/functions/createNetworkedPropsComponent.md +28 -0
  271. package/dist/docs/api/index/functions/createObject3DRefComponent.md +1 -1
  272. package/dist/docs/api/index/functions/createParentIdComponent.md +1 -1
  273. package/dist/docs/api/index/functions/createPhysicsComponent.md +1 -1
  274. package/dist/docs/api/index/functions/createPostprocessingComponent.md +1 -1
  275. package/dist/docs/api/index/functions/createScriptComponent.md +1 -1
  276. package/dist/docs/api/index/functions/createScriptObjectComponent.md +1 -1
  277. package/dist/docs/api/index/functions/createSelectableComponent.md +1 -1
  278. package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +1 -1
  279. package/dist/docs/api/index/functions/createSpriteComponent.md +1 -1
  280. package/dist/docs/api/index/functions/createTransformComponent.md +1 -1
  281. package/dist/docs/api/index/functions/createUIButtonComponent.md +1 -1
  282. package/dist/docs/api/index/functions/createUIPanelComponent.md +1 -1
  283. package/dist/docs/api/index/functions/createUISliderComponent.md +1 -1
  284. package/dist/docs/api/index/functions/createUITextComponent.md +1 -1
  285. package/dist/docs/api/index/functions/createUIToggleComponent.md +1 -1
  286. package/dist/docs/api/index/functions/createVRTeleportAreaComponent.md +1 -1
  287. package/dist/docs/api/index/functions/createVideoComponent.md +1 -1
  288. package/dist/docs/api/index/functions/createXRAnchorComponent.md +1 -1
  289. package/dist/docs/api/index/functions/createXRHandPoseComponent.md +1 -1
  290. package/dist/docs/api/index/functions/createXRInteractableComponent.md +1 -1
  291. package/dist/docs/api/index/functions/createXRInteractorComponent.md +1 -1
  292. package/dist/docs/api/index/functions/createXRInteractorSideComponent.md +1 -1
  293. package/dist/docs/api/index/functions/createXRRigComponent.md +1 -1
  294. package/dist/docs/api/index/functions/decanonicalizeComponentValue.md +1 -1
  295. package/dist/docs/api/index/functions/despawnPrefab.md +1 -1
  296. package/dist/docs/api/index/functions/encodeOverride.md +1 -1
  297. package/dist/docs/api/index/functions/estimateHandScale.md +1 -1
  298. package/dist/docs/api/index/functions/findModelBone.md +30 -0
  299. package/dist/docs/api/index/functions/findSnapshotRootEntityIds.md +1 -1
  300. package/dist/docs/api/index/functions/findTopLevelNestedRegions.md +1 -1
  301. package/dist/docs/api/index/functions/getHandPosePreset.md +1 -1
  302. package/dist/docs/api/index/functions/gripQuaternion.md +36 -0
  303. package/dist/docs/api/index/functions/groupOverridePaths.md +1 -1
  304. package/dist/docs/api/index/functions/handPoseFromCurls.md +1 -1
  305. package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +1 -1
  306. package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +1 -1
  307. package/dist/docs/api/index/functions/indexSnapshotByEntity.md +1 -1
  308. package/dist/docs/api/index/functions/instantiateSubtree.md +1 -1
  309. package/dist/docs/api/index/functions/listModelBones.md +25 -0
  310. package/dist/docs/api/index/functions/loadPrefab.md +1 -1
  311. package/dist/docs/api/index/functions/loadSharedGltf.md +1 -1
  312. package/dist/docs/api/index/functions/matchHandPose.md +1 -1
  313. package/dist/docs/api/index/functions/mergeComponentValue.md +1 -1
  314. package/dist/docs/api/index/functions/parseOverride.md +1 -1
  315. package/dist/docs/api/index/functions/parsePrefabAsset.md +1 -1
  316. package/dist/docs/api/index/functions/prefabFileVersionFor.md +1 -1
  317. package/dist/docs/api/index/functions/readXrCapabilities.md +1 -1
  318. package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +1 -1
  319. package/dist/docs/api/index/functions/registerDefaultFactories.md +1 -1
  320. package/dist/docs/api/index/functions/remapSnapshotEntityIds.md +3 -3
  321. package/dist/docs/api/index/functions/resolveDracoDecoderPath.md +1 -1
  322. package/dist/docs/api/index/functions/restoreComponentState.md +1 -1
  323. package/dist/docs/api/index/functions/restorePostCreateComponents.md +1 -1
  324. package/dist/docs/api/index/functions/sampleTeleportArc.md +1 -1
  325. package/dist/docs/api/index/functions/serializeEntitySubtree.md +1 -1
  326. package/dist/docs/api/index/functions/setDracoDecoderPath.md +1 -1
  327. package/dist/docs/api/index/functions/setPrefabAssetUrlResolver.md +1 -1
  328. package/dist/docs/api/index/functions/setWorldQuaternion.md +26 -0
  329. package/dist/docs/api/index/functions/soundBankFiles.md +25 -0
  330. package/dist/docs/api/index/functions/spawnPrefab.md +1 -1
  331. package/dist/docs/api/index/functions/twoBoneIK.md +41 -0
  332. package/dist/docs/api/index/index.md +31 -0
  333. package/dist/docs/api/index/interfaces/ChromaKeyOptions.md +5 -5
  334. package/dist/docs/api/index/interfaces/EcsSystem.md +3 -3
  335. package/dist/docs/api/index/interfaces/NetworkHandle.md +180 -0
  336. package/dist/docs/api/index/interfaces/PostprocessingBuildContext.md +6 -6
  337. package/dist/docs/api/index/interfaces/PostprocessingPipeline.md +5 -5
  338. package/dist/docs/api/index/interfaces/RenderBackend.md +8 -8
  339. package/dist/docs/api/index/interfaces/SoundBankAsset.md +18 -0
  340. package/dist/docs/api/index/interfaces/SoundSlot.md +31 -0
  341. package/dist/docs/api/index/interfaces/SoundTake.md +18 -0
  342. package/dist/docs/api/index/interfaces/StateMachine.md +13 -13
  343. package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +4 -4
  344. package/dist/docs/api/index/type-aliases/ApplyPrefabToSnapshotResult.md +3 -3
  345. package/dist/docs/api/index/type-aliases/AudioBus.md +15 -0
  346. package/dist/docs/api/index/type-aliases/ComponentFactory.md +1 -1
  347. package/dist/docs/api/index/type-aliases/ComponentValueMaps.md +50 -38
  348. package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +7 -1
  349. package/dist/docs/api/index/type-aliases/EcsRenderer.md +1 -1
  350. package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +3 -3
  351. package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +4 -4
  352. package/dist/docs/api/index/type-aliases/ExternalRefWarning.md +5 -5
  353. package/dist/docs/api/index/type-aliases/HandMaterialOptions.md +4 -4
  354. package/dist/docs/api/index/type-aliases/HandPoseTrackerOptions.md +5 -5
  355. package/dist/docs/api/index/type-aliases/HydrateOptions.md +3 -3
  356. package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +4 -4
  357. package/dist/docs/api/index/type-aliases/InstantiateSubtreeResult.md +3 -3
  358. package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
  359. package/dist/docs/api/index/type-aliases/ModelBoneInfo.md +29 -0
  360. package/dist/docs/api/index/type-aliases/ModuleLoader.md +1 -1
  361. package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
  362. package/dist/docs/api/index/type-aliases/NestedRegion.md +5 -5
  363. package/dist/docs/api/index/type-aliases/NetSpawnOptions.md +41 -0
  364. package/dist/docs/api/index/type-aliases/NodeKeyMaps.md +5 -5
  365. package/dist/docs/api/index/type-aliases/NodeMaps.md +4 -4
  366. package/dist/docs/api/index/type-aliases/PlaySlotOptions.md +32 -0
  367. package/dist/docs/api/index/type-aliases/PrefabAsset.md +5 -5
  368. package/dist/docs/api/index/type-aliases/RemapSnapshotOptions.md +2 -2
  369. package/dist/docs/api/index/type-aliases/RendererKind.md +1 -1
  370. package/dist/docs/api/index/type-aliases/ScriptBehaviourSystemOptions.md +2 -2
  371. package/dist/docs/api/index/type-aliases/ScriptErrorEvent.md +9 -9
  372. package/dist/docs/api/index/type-aliases/ScriptErrorListener.md +1 -1
  373. package/dist/docs/api/index/type-aliases/ScriptErrorPhase.md +1 -1
  374. package/dist/docs/api/index/type-aliases/ScriptErrorReport.md +6 -6
  375. package/dist/docs/api/index/type-aliases/ScriptErrorSource.md +1 -1
  376. package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
  377. package/dist/docs/api/index/type-aliases/SerializeEntitySubtreeResult.md +4 -4
  378. package/dist/docs/api/index/type-aliases/SpawnPrefabOptions.md +5 -5
  379. package/dist/docs/api/index/type-aliases/SpawnPrefabSource.md +1 -1
  380. package/dist/docs/api/index/type-aliases/SubtreeSnapshot.md +4 -3
  381. package/dist/docs/api/index/type-aliases/UiCanvasLike.md +4 -4
  382. package/dist/docs/api/index/type-aliases/UiColorStop.md +37 -0
  383. package/dist/docs/api/index/type-aliases/UiPaint.md +81 -0
  384. package/dist/docs/api/index/type-aliases/UiShadow.md +27 -0
  385. package/dist/docs/api/index/type-aliases/UiStyle.md +43 -0
  386. package/dist/docs/api/index/type-aliases/UiTextStyle.md +33 -0
  387. package/dist/docs/api/index/type-aliases/UiTokens.md +13 -0
  388. package/dist/docs/api/index/type-aliases/VelocitySample.md +3 -3
  389. package/dist/docs/api/index/type-aliases/XrCapabilities.md +9 -9
  390. package/dist/docs/api/index/type-aliases/XrFinger.md +1 -1
  391. package/dist/docs/api/index/type-aliases/XrFingerCurl.md +4 -4
  392. package/dist/docs/api/index/type-aliases/XrFingerTarget.md +6 -6
  393. package/dist/docs/api/index/type-aliases/XrHandJointName.md +1 -1
  394. package/dist/docs/api/index/type-aliases/XrHandJoints.md +1 -1
  395. package/dist/docs/api/index/type-aliases/XrHandPoseAxis.md +1 -1
  396. package/dist/docs/api/index/type-aliases/XrHandPoseContext.md +2 -2
  397. package/dist/docs/api/index/type-aliases/XrHandPoseDefinition.md +11 -11
  398. package/dist/docs/api/index/type-aliases/XrHandPoseDirection.md +1 -1
  399. package/dist/docs/api/index/type-aliases/XrHandPoseEvent.md +1 -1
  400. package/dist/docs/api/index/type-aliases/XrHandPoseEventDetail.md +5 -5
  401. package/dist/docs/api/index/type-aliases/XrHandPoseMatch.md +4 -4
  402. package/dist/docs/api/index/type-aliases/XrHandPoseOrientation.md +4 -4
  403. package/dist/docs/api/index/type-aliases/XrHandShape.md +13 -13
  404. package/dist/docs/api/index/type-aliases/XrHandedness.md +1 -1
  405. package/dist/docs/api/index/type-aliases/XrHitResult.md +3 -3
  406. package/dist/docs/api/index/type-aliases/XrInputKind.md +1 -1
  407. package/dist/docs/api/index/type-aliases/XrInputState.md +18 -18
  408. package/dist/docs/api/index/type-aliases/XrPalmPose.md +6 -6
  409. package/dist/docs/api/index/variables/ADDED_NODE_MARKER_COMPONENT.md +1 -1
  410. package/dist/docs/api/index/variables/ARC_GRAVITY.md +1 -1
  411. package/dist/docs/api/index/variables/ARC_MAX_TIME.md +1 -1
  412. package/dist/docs/api/index/variables/ARC_SPEED.md +1 -1
  413. package/dist/docs/api/index/variables/ARC_STEPS.md +1 -1
  414. package/dist/docs/api/index/variables/CURLED_COS.md +1 -1
  415. package/dist/docs/api/index/variables/DEFAULT_DIRECTION_TOLERANCE.md +1 -1
  416. package/dist/docs/api/index/variables/DEFAULT_ENTER_CONFIDENCE.md +1 -1
  417. package/dist/docs/api/index/variables/DEFAULT_EXIT_CONFIDENCE.md +1 -1
  418. package/dist/docs/api/index/variables/DEFAULT_LOST_GRACE_SECONDS.md +1 -1
  419. package/dist/docs/api/index/variables/DEFAULT_MIN_HOLD_SECONDS.md +1 -1
  420. package/dist/docs/api/index/variables/DEFAULT_SCRIPT_ERROR_RETRY_DELAY.md +1 -1
  421. package/dist/docs/api/index/variables/FALLBACK_HAND_SCALE.md +1 -1
  422. package/dist/docs/api/index/variables/HAND_POSE_PRESETS.md +1 -1
  423. package/dist/docs/api/index/variables/HAND_POSE_PRESET_IDS.md +1 -1
  424. package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +1 -1
  425. package/dist/docs/api/index/variables/KeyboardKeys.md +89 -89
  426. package/dist/docs/api/index/variables/MATCH_FALLOFF.md +1 -1
  427. package/dist/docs/api/index/variables/MAX_PLAUSIBLE_SPEED.md +1 -1
  428. package/dist/docs/api/index/variables/MAX_SAMPLE_AGE_SECONDS.md +1 -1
  429. package/dist/docs/api/index/variables/NODE_KEY_SEPARATOR.md +1 -1
  430. package/dist/docs/api/index/variables/NO_XR_CAPABILITIES.md +1 -1
  431. package/dist/docs/api/index/variables/OVERRIDE_DIFF_EXCLUDED_COMPONENTS.md +1 -1
  432. package/dist/docs/api/index/variables/OVERRIDE_ROOT_EXCLUDED_COMPONENTS.md +1 -1
  433. package/dist/docs/api/index/variables/PINCH_FINGERS.md +1 -1
  434. package/dist/docs/api/index/variables/PREFAB_FILE_VERSION.md +1 -1
  435. package/dist/docs/api/index/variables/PREFAB_FILE_VERSION_NESTED.md +1 -1
  436. package/dist/docs/api/index/variables/SCRIPT_OBJECT_ROOT_FLAG.md +1 -1
  437. package/dist/docs/api/index/variables/SHARED_MODEL_RESOURCE_FLAG.md +1 -1
  438. package/dist/docs/api/index/variables/STRAIGHT_COS.md +1 -1
  439. package/dist/docs/api/index/variables/VELOCITY_SAMPLES.md +1 -1
  440. package/dist/docs/api/index/variables/XR_FINGERS.md +1 -1
  441. package/dist/docs/api/index/variables/XR_HOVER_SHELL_FLAG.md +1 -1
  442. package/dist/docs/api/index/variables/webglBackend.md +1 -1
  443. package/dist/docs/api/typedoc-sidebar.json +1 -1
  444. package/dist/docs/api/types/type-aliases/AssetInput.md +3 -3
  445. package/dist/docs/api/types/type-aliases/CheckboxInput.md +3 -3
  446. package/dist/docs/api/types/type-aliases/ColorInput.md +1 -1
  447. package/dist/docs/api/types/type-aliases/ComponentInput.md +4 -4
  448. package/dist/docs/api/types/type-aliases/ComponentKind.md +1 -1
  449. package/dist/docs/api/types/type-aliases/DropdownInput.md +3 -3
  450. package/dist/docs/api/types/type-aliases/DropdownOption.md +3 -3
  451. package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +1 -1
  452. package/dist/docs/api/types/type-aliases/EcsEntityKind.md +1 -1
  453. package/dist/docs/api/types/type-aliases/EntityId.md +1 -1
  454. package/dist/docs/api/types/type-aliases/EntityInput.md +3 -3
  455. package/dist/docs/api/types/type-aliases/FloatInput.md +1 -1
  456. package/dist/docs/api/types/type-aliases/IntersectionResult.md +3 -3
  457. package/dist/docs/api/types/type-aliases/ParentLookup.md +3 -3
  458. package/dist/docs/api/types/type-aliases/SelectionListener.md +1 -1
  459. package/dist/docs/api/types/type-aliases/SliderInput.md +5 -5
  460. package/dist/docs/api/types/type-aliases/TextInput.md +1 -1
  461. package/dist/docs/api/types/type-aliases/ToggleInput.md +1 -1
  462. package/dist/docs/api/types/type-aliases/Vec3.md +1 -1
  463. package/dist/docs/api/types/type-aliases/Vector2Input.md +3 -3
  464. package/dist/docs/api/types/type-aliases/Vector3Input.md +4 -4
  465. package/dist/docs/api/types/type-aliases/WorldEntityView.md +1 -1
  466. package/dist/docs/guide/bone-attachments-and-ik.md +51 -0
  467. package/dist/docs/guide/components/audio.md +1 -1
  468. package/dist/factories/index.cjs +29 -1
  469. package/dist/factories/index.cjs.map +1 -1
  470. package/dist/factories/index.d.cts +2 -2
  471. package/dist/factories/index.d.ts +2 -2
  472. package/dist/factories/index.js +4 -4
  473. package/dist/{index-BXjwEdNq.d.cts → index-BbrnjNXy.d.ts} +5 -3
  474. package/dist/{index-CVG-hREM.d.ts → index-DD7aHv0p.d.cts} +5 -3
  475. package/dist/{index-6pZO_gV7.d.ts → index-OgOoIpEI.d.ts} +14 -2
  476. package/dist/{index-BdghvXKE.d.cts → index-xyqzT0PQ.d.cts} +14 -2
  477. package/dist/index.cjs +174 -13
  478. package/dist/index.cjs.map +1 -1
  479. package/dist/index.d.cts +10 -9
  480. package/dist/index.d.ts +10 -9
  481. package/dist/index.js +13 -11
  482. package/dist/index.js.map +1 -1
  483. package/dist/network/index.cjs +70 -38
  484. package/dist/network/index.cjs.map +1 -1
  485. package/dist/network/index.d.cts +2 -2
  486. package/dist/network/index.d.ts +2 -2
  487. package/dist/network/index.js +4 -4
  488. package/dist/systems/index.cjs +171 -13
  489. package/dist/systems/index.cjs.map +1 -1
  490. package/dist/systems/index.d.cts +2 -2
  491. package/dist/systems/index.d.ts +2 -2
  492. package/dist/systems/index.js +5 -5
  493. package/dist/types.d.cts +1 -1
  494. package/dist/types.d.ts +1 -1
  495. package/dist/webgpu/index.d.ts +2 -2
  496. package/dist/worldSnapshotUtils.d.cts +1 -1
  497. package/dist/worldSnapshotUtils.d.ts +1 -1
  498. package/package.json +2 -1
  499. package/dist/chunk-GSWC6LLD.js.map +0 -1
  500. package/dist/chunk-JEPUCLZX.js.map +0 -1
  501. package/dist/chunk-JNYPJB55.js.map +0 -1
  502. package/dist/chunk-TY3XCHOR.js.map +0 -1
  503. package/dist/chunk-WWP46AEF.js.map +0 -1
@@ -1,5 +1,5 @@
1
- export { a7 as AudioSystem, ab as ComponentFactory, ag as EcsComponentFactoryKind, al as IKSystem, am as InputSystem, ao as KeyboardKey, ap as KeyboardKeys, ar as MouseButton, a1 as ObjectManagementSystem, Y as PlaySlotOptions, ay as RenderSystem, aN as TransformSyncSystem } from '../System-BldSHxZV.cjs';
2
- export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, b as XrHandPoseEventDetail, z as XrHitResult } from '../index-BdghvXKE.cjs';
1
+ export { ab as AudioSystem, af as ComponentFactory, ak as EcsComponentFactoryKind, ap as IKSystem, aq as InputSystem, as as KeyboardKey, at as KeyboardKeys, av as MouseButton, a5 as ObjectManagementSystem, a0 as PlaySlotOptions, aC as RenderSystem, aR as TransformSyncSystem } from '../System-D8vm-Jvv.cjs';
2
+ export { A as AnimationSystem, B as BoneHoldSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, b as XrHandPoseEventDetail, z as XrHitResult } from '../index-xyqzT0PQ.cjs';
3
3
  import 'three';
4
4
  import '@dimforge/rapier3d-compat';
5
5
  import '../animation/index.cjs';
@@ -1,5 +1,5 @@
1
- export { ac as AudioSystem, af as ComponentFactory, ak as EcsComponentFactoryKind, ao as IKSystem, ap as InputSystem, ar as KeyboardKey, as as KeyboardKeys, au as MouseButton, a6 as ObjectManagementSystem, a2 as PlaySlotOptions, az as RenderSystem, aN as TransformSyncSystem } from '../System-CADhPyQs.js';
2
- export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, b as XrHandPoseEventDetail, z as XrHitResult } from '../index-6pZO_gV7.js';
1
+ export { ag as AudioSystem, aj as ComponentFactory, ao as EcsComponentFactoryKind, as as IKSystem, at as InputSystem, av as KeyboardKey, aw as KeyboardKeys, ay as MouseButton, aa as ObjectManagementSystem, a6 as PlaySlotOptions, aD as RenderSystem, aR as TransformSyncSystem } from '../System-ttkDQCrj.js';
2
+ export { A as AnimationSystem, B as BoneHoldSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, b as XrHandPoseEventDetail, z as XrHitResult } from '../index-OgOoIpEI.js';
3
3
  import 'three';
4
4
  import '@dimforge/rapier3d-compat';
5
5
  import '../animation/index.js';
@@ -1,10 +1,10 @@
1
- export { AnimationSystem, AudioSystem, CameraSyncSystem, DEFAULT_SCRIPT_ERROR_RETRY_DELAY, EnvironmentSyncSystem, IKSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObjectSystem, TransformSyncSystem, UIInteractionSystem, UIPanelSystem, VRTeleportAreaSystem, VideoSystem, XRAnchorSystem, XRControllerVisualSystem, XREnvironmentSystem, XRHandPoseSystem, XRHitTestSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_HOVER_SHELL_FLAG } from '../chunk-TY3XCHOR.js';
1
+ export { AnimationSystem, AudioSystem, BoneHoldSystem, CameraSyncSystem, DEFAULT_SCRIPT_ERROR_RETRY_DELAY, EnvironmentSyncSystem, IKSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObjectSystem, TransformSyncSystem, UIInteractionSystem, UIPanelSystem, VRTeleportAreaSystem, VideoSystem, XRAnchorSystem, XRControllerVisualSystem, XREnvironmentSystem, XRHandPoseSystem, XRHitTestSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_HOVER_SHELL_FLAG } from '../chunk-2DJBNWBB.js';
2
2
  import '../chunk-OHCNPPMX.js';
3
- import '../chunk-WWP46AEF.js';
4
- export { ObjectManagementSystem } from '../chunk-JEPUCLZX.js';
5
- import '../chunk-JNYPJB55.js';
3
+ import '../chunk-4FHJA6U4.js';
4
+ export { ObjectManagementSystem } from '../chunk-QAZCVCMP.js';
5
+ import '../chunk-T7SRBLPJ.js';
6
6
  import '../chunk-CKTHDXPS.js';
7
- import '../chunk-GSWC6LLD.js';
7
+ import '../chunk-GMSFEXUZ.js';
8
8
  import '../chunk-XE4OXN2W.js';
9
9
  //# sourceMappingURL=index.js.map
10
10
  //# sourceMappingURL=index.js.map
package/dist/types.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import 'three';
2
- export { a4 as AssetInput, a8 as CheckboxInput, aa as ColorInput, ac as ComponentInput, ad as ComponentKind, ae as DropdownInput, af as DropdownOption, ah as EcsEntityEditorKind, a0 as EcsEntityKind, M as EntityId, aj as EntityInput, ak as FloatInput, an as IntersectionResult, _ as ParentLookup, aF as SelectionListener, aG as SliderInput, aL as TextInput, aM as ToggleInput, aO as Vec3, aP as Vector2Input, aQ as Vector3Input, S as WorldEntityView } from './System-BldSHxZV.cjs';
2
+ export { a8 as AssetInput, ac as CheckboxInput, ae as ColorInput, ag as ComponentInput, ah as ComponentKind, ai as DropdownInput, aj as DropdownOption, al as EcsEntityEditorKind, a4 as EcsEntityKind, S as EntityId, an as EntityInput, ao as FloatInput, ar as IntersectionResult, a2 as ParentLookup, aJ as SelectionListener, aK as SliderInput, aP as TextInput, aQ as ToggleInput, aS as Vec3, aT as Vector2Input, aU as Vector3Input, Z as WorldEntityView } from './System-D8vm-Jvv.cjs';
3
3
  import '@dimforge/rapier3d-compat';
4
4
  import './animation/index.cjs';
5
5
  import 'three/webgpu';
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import 'three';
2
- export { a9 as AssetInput, ad as CheckboxInput, ae as ColorInput, ag as ComponentInput, ah as ComponentKind, ai as DropdownInput, aj as DropdownOption, al as EcsEntityEditorKind, a5 as EcsEntityKind, X as EntityId, am as EntityInput, an as FloatInput, aq as IntersectionResult, a4 as ParentLookup, aF as SelectionListener, aG as SliderInput, aL as TextInput, aM as ToggleInput, aO as Vec3, aP as Vector2Input, aQ as Vector3Input, $ as WorldEntityView } from './System-CADhPyQs.js';
2
+ export { ad as AssetInput, ah as CheckboxInput, ai as ColorInput, ak as ComponentInput, al as ComponentKind, am as DropdownInput, an as DropdownOption, ap as EcsEntityEditorKind, a9 as EcsEntityKind, $ as EntityId, aq as EntityInput, ar as FloatInput, au as IntersectionResult, a8 as ParentLookup, aJ as SelectionListener, aK as SliderInput, aP as TextInput, aQ as ToggleInput, aS as Vec3, aT as Vector2Input, aU as Vector3Input, a3 as WorldEntityView } from './System-ttkDQCrj.js';
3
3
  import '@dimforge/rapier3d-compat';
4
4
  import './animation/index.js';
5
5
  import 'three/webgpu';
@@ -1,5 +1,5 @@
1
- import { C as ChromaKeyOptions, P as PostprocessingPipeline, a as PostprocessingBuildContext, b as PostprocessingState, R as RenderBackend } from '../System-CADhPyQs.js';
2
- export { E as EcsRenderer, c as RendererKind } from '../System-CADhPyQs.js';
1
+ import { C as ChromaKeyOptions, P as PostprocessingPipeline, a as PostprocessingBuildContext, b as PostprocessingState, R as RenderBackend } from '../System-ttkDQCrj.js';
2
+ export { E as EcsRenderer, c as RendererKind } from '../System-ttkDQCrj.js';
3
3
  import * as THREE from 'three';
4
4
  import { UniformNode, MeshBasicNodeMaterial, PassNode, Node, RenderPipeline } from 'three/webgpu';
5
5
  import BloomNode from 'three/examples/jsm/tsl/display/BloomNode.js';
@@ -1,4 +1,4 @@
1
- export { b0 as AnyComponent, Z as ComponentClass, b1 as DEBUG_CHANGE_IGNORED_SYSTEMS, b2 as WorldHistorySnapshot, b3 as cloneHistoryValue, b4 as normalizeDebugValue } from './System-BldSHxZV.cjs';
1
+ export { b4 as AnyComponent, a1 as ComponentClass, b5 as DEBUG_CHANGE_IGNORED_SYSTEMS, b6 as WorldHistorySnapshot, b7 as cloneHistoryValue, b8 as normalizeDebugValue } from './System-D8vm-Jvv.cjs';
2
2
  import 'three';
3
3
  import '@dimforge/rapier3d-compat';
4
4
  import './animation/index.cjs';
@@ -1,4 +1,4 @@
1
- export { b0 as AnyComponent, a3 as ComponentClass, b1 as DEBUG_CHANGE_IGNORED_SYSTEMS, b2 as WorldHistorySnapshot, b3 as cloneHistoryValue, b4 as normalizeDebugValue } from './System-CADhPyQs.js';
1
+ export { b4 as AnyComponent, a7 as ComponentClass, b5 as DEBUG_CHANGE_IGNORED_SYSTEMS, b6 as WorldHistorySnapshot, b7 as cloneHistoryValue, b8 as normalizeDebugValue } from './System-ttkDQCrj.js';
2
2
  import 'three';
3
3
  import '@dimforge/rapier3d-compat';
4
4
  import './animation/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relu-interactives/spatial-ecs",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Reusable ECS core engine for Relu Spatial editor and runtime experiences.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -63,6 +63,7 @@
63
63
  ],
64
64
  "sideEffects": false,
65
65
  "scripts": {
66
+ "prepublishOnly": "pnpm run docs:generate && pnpm run build",
66
67
  "build": "node scripts/clean-dist.mjs && tsup --config tsup.config.ts && node scripts/check-dist-entries.mjs && node scripts/copy-assets.mjs && node scripts/copy-docs.mjs",
67
68
  "dev": "tsup --config tsup.config.ts --watch",
68
69
  "typecheck": "tsc --noEmit",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../core/animation/humanoid.ts"],"names":[],"mappings":";;;AA6CO,IAAM,uBAAA,GAAmD;AAAA,EAC9D,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF;AAuCO,IAAM,IAAA,mBAAO,MAAA,CAAA,CAAC,CAAA,EAAS,CAAA,KAAkB;AAAA,EAC9C,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA;AAAA,EACpD,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA;AAAA,EACpD,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,IAAI,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA;AAAA,EACpD,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,GAA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AAAA,IACrD,QAAA,EAAW,CAAA,CAAE,QAAA,CAA+B,GAAA,CAAI,oBAAoB;AAAA,GACtE;AACF;AAfgB,MAAA,CAAA,oBAAA,EAAA,sBAAA,CAAA","file":"chunk-GSWC6LLD.js","sourcesContent":["/**\n * One vocabulary for humanoid skeletons.\n *\n * Every source names its bones differently: Mixamo `mixamorig:LeftForeArm`,\n * Meshy `LeftForeArm` with its spine numbered top-down (`Spine02` is the\n * LOWEST), Unreal / Quaternius UAL `lowerarm_l` with `spine_01` lowest,\n * Blender rigify `forearm.L`, VRM `leftLowerArm`. Retargeting, the animation\n * editor and bone sockets all need \"the left forearm\" regardless, so a\n * skeleton is mapped once onto VRM's humanoid bone names (the closest thing\n * to a standard) and everything downstream speaks those.\n *\n * Pure data + math, no three.js: the editor's Node tools (gltf-transform\n * documents) and the runtime (THREE.Bone trees) both build a `SkeletonNode`\n * tree and call `detectRig`.\n */\n\nexport type HumanoidBone =\n | \"hips\"\n | \"spine\"\n | \"chest\"\n | \"upperChest\"\n | \"neck\"\n | \"head\"\n | \"leftShoulder\"\n | \"leftUpperArm\"\n | \"leftLowerArm\"\n | \"leftHand\"\n | \"rightShoulder\"\n | \"rightUpperArm\"\n | \"rightLowerArm\"\n | \"rightHand\"\n | \"leftUpperLeg\"\n | \"leftLowerLeg\"\n | \"leftFoot\"\n | \"leftToes\"\n | \"rightUpperLeg\"\n | \"rightLowerLeg\"\n | \"rightFoot\"\n | \"rightToes\"\n | `${\"left\" | \"right\"}${Finger}${FingerJoint}`;\n\ntype Finger = \"Thumb\" | \"Index\" | \"Middle\" | \"Ring\" | \"Little\";\ntype FingerJoint = \"Metacarpal\" | \"Proximal\" | \"Intermediate\" | \"Distal\";\n\n/** The bones a humanoid must have to retarget a full-body clip. */\nexport const REQUIRED_HUMANOID_BONES: readonly HumanoidBone[] = [\n \"hips\",\n \"spine\",\n \"head\",\n \"leftUpperArm\",\n \"leftLowerArm\",\n \"leftHand\",\n \"rightUpperArm\",\n \"rightLowerArm\",\n \"rightHand\",\n \"leftUpperLeg\",\n \"leftLowerLeg\",\n \"leftFoot\",\n \"rightUpperLeg\",\n \"rightLowerLeg\",\n \"rightFoot\",\n];\n\n/** Vector [x, y, z] and quaternion [x, y, z, w]. */\nexport type Vec3 = [number, number, number];\nexport type Quat = [number, number, number, number];\n\n/** A bone (or any node) with its LOCAL rest transform. */\nexport interface SkeletonNode {\n name: string;\n translation: Vec3;\n rotation: Quat;\n scale?: Vec3;\n children: SkeletonNode[];\n}\n\nexport type RigProfile =\n | \"mixamo\"\n | \"meshy\"\n | \"unreal\"\n | \"rigify\"\n | \"vrm\"\n | \"generic\";\n\nexport interface RigDetection {\n profile: RigProfile;\n /** Humanoid bone → the rig's own bone name. */\n bones: Partial<Record<HumanoidBone, string>>;\n /** Rig bone name → humanoid bone. */\n byName: Map<string, HumanoidBone>;\n /** Arms level (T), angled down (A), or neither. */\n restPose: \"T\" | \"A\" | \"unknown\";\n /** Degrees the left upper arm points below horizontal at rest. */\n armDrop: number | null;\n /** Required bones the rig lacks (empty = can retarget). */\n missing: HumanoidBone[];\n}\n\n// ── quaternion helpers ───────────────────────────────────────────────────────\n\nexport const qmul = (a: Quat, b: Quat): Quat => [\n a[3] * b[0] + a[0] * b[3] + a[1] * b[2] - a[2] * b[1],\n a[3] * b[1] - a[0] * b[2] + a[1] * b[3] + a[2] * b[0],\n a[3] * b[2] + a[0] * b[1] - a[1] * b[0] + a[2] * b[3],\n a[3] * b[3] - a[0] * b[0] - a[1] * b[1] - a[2] * b[2],\n];\nexport const qinv = (q: Quat): Quat => [-q[0], -q[1], -q[2], q[3]];\nexport const qrot = (q: Quat, v: Vec3): Vec3 => {\n const r = qmul(qmul(q, [v[0], v[1], v[2], 0]), qinv(q));\n return [r[0], r[1], r[2]];\n};\n\n/** World (rig-space) rest position of every node, by name. */\nexport function restPositions(root: SkeletonNode): Map<string, Vec3> {\n const out = new Map<string, Vec3>();\n const walk = (n: SkeletonNode, pq: Quat, pp: Vec3, ps: number) => {\n const t = qrot(pq, [n.translation[0] * ps, n.translation[1] * ps, n.translation[2] * ps]);\n const p: Vec3 = [pp[0] + t[0], pp[1] + t[1], pp[2] + t[2]];\n out.set(n.name, p);\n const q = qmul(pq, n.rotation);\n const s = ps * (n.scale?.[0] ?? 1);\n for (const c of n.children) walk(c, q, p, s);\n };\n walk(root, [0, 0, 0, 1], [0, 0, 0], 1);\n return out;\n}\n\n// ── names ────────────────────────────────────────────────────────────────────\n\n/**\n * `mixamorig1:LeftForeArm` → { side: \"left\", base: \"forearm\" };\n * `upperarm_l` → { side: \"left\", base: \"upperarm\" }; `forearm.L` → left.\n */\nexport function splitBoneName(raw: string): { side: \"left\" | \"right\" | null; base: string } {\n let n = raw\n .replace(/^.*[:|]/, \"\") // mixamorig:, Armature|, rig:\n .replace(/^(mixamorig\\d*|def[-_]|org[-_]|mch[-_]|bip\\d*[ _]|b[-_])/i, \"\")\n .trim();\n let side: \"left\" | \"right\" | null = null;\n const sided = [\n [/^left[\\s_.-]*/i, \"left\"],\n [/^right[\\s_.-]*/i, \"right\"],\n [/^l[\\s_.-]+/i, \"left\"],\n [/^r[\\s_.-]+/i, \"right\"],\n [/[\\s_.-]+l$/i, \"left\"],\n [/[\\s_.-]+r$/i, \"right\"],\n [/[\\s_.-]*left$/i, \"left\"],\n [/[\\s_.-]*right$/i, \"right\"],\n ] as const;\n for (const [re, s] of sided) {\n if (re.test(n)) {\n side = s;\n n = n.replace(re, \"\");\n break;\n }\n }\n return { side, base: n.toLowerCase().replace(/[^a-z0-9]/g, \"\") };\n}\n\n/** Bases for sided limb bones. Order matters: first match wins. */\nconst LIMB_BASES: Array<[RegExp, string]> = [\n [/^(shoulder|clavicle|collar(bone)?)$/, \"Shoulder\"],\n [/^(upperarm|uparm|arm)$/, \"UpperArm\"],\n [/^(forearm|lowerarm|elbow|loarm)$/, \"LowerArm\"],\n [/^(hand|wrist)$/, \"Hand\"],\n [/^(upleg|upperleg|thigh|hipjoint)$/, \"UpperLeg\"],\n [/^(leg|lowerleg|calf|shin|knee)$/, \"LowerLeg\"],\n [/^(foot|ankle)$/, \"Foot\"],\n [/^(toebase|toe|toes|ball)$/, \"Toes\"],\n];\n\nconst FINGERS: Array<[RegExp, Finger]> = [\n [/^thumb/, \"Thumb\"],\n [/^(index|pointer)/, \"Index\"],\n [/^(middle|fingers)/, \"Middle\"],\n [/^ring/, \"Ring\"],\n [/^(pinky|little|small)/, \"Little\"],\n];\n\nfunction fingerJoint(finger: Finger, digits: string): FingerJoint | null {\n // Mixamo/UE number 1-3 (4 = tip); a bare \"Thumb\"/\"Fingers\" (Meshy after\n // fix-rig) is the first joint.\n const n = digits === \"\" ? 1 : Number(digits);\n const joints: FingerJoint[] =\n finger === \"Thumb\"\n ? [\"Metacarpal\", \"Proximal\", \"Distal\"]\n : [\"Proximal\", \"Intermediate\", \"Distal\"];\n return joints[n - 1] ?? null;\n}\n\n/** A sided bone from its name alone, or null. */\nfunction sidedBone(base: string, side: \"left\" | \"right\"): HumanoidBone | null {\n for (const [re, part] of LIMB_BASES) {\n if (re.test(base)) return `${side}${part}` as HumanoidBone;\n }\n // Mixamo writes fingers as LeftHandIndex1.\n const f = base.replace(/^hand(?=(thumb|index|middle|ring|pinky|little))/, \"\");\n for (const [re, finger] of FINGERS) {\n if (!re.test(f)) continue;\n const digits = /(\\d+)$/.exec(f)?.[1] ?? \"\";\n const joint = fingerJoint(finger, digits.replace(/^0+/, \"\"));\n return joint ? (`${side}${finger}${joint}` as HumanoidBone) : null;\n }\n return null;\n}\n\n// VRM names, recognised directly (leftUpperArm → lowercase \"leftupperarm\").\nconst VRM_LOWER = new Map<string, HumanoidBone>();\n\nconst VRM_FINGER = /^(left|right)(Thumb|Index|Middle|Ring|Little)(Metacarpal|Proximal|Intermediate|Distal)$/;\n\nfunction vrmBone(raw: string): HumanoidBone | null {\n const name = raw.replace(/^.*[:|]/, \"\");\n if (VRM_FINGER.test(name)) return name as HumanoidBone;\n if (VRM_LOWER.size === 0) {\n const sides = [\"left\", \"right\"] as const;\n const parts = [\"Shoulder\", \"UpperArm\", \"LowerArm\", \"Hand\", \"UpperLeg\", \"LowerLeg\", \"Foot\", \"Toes\"];\n for (const s of sides) for (const p of parts) VRM_LOWER.set(`${s}${p}`.toLowerCase(), `${s}${p}` as HumanoidBone);\n for (const b of [\"hips\", \"spine\", \"chest\", \"upperChest\", \"neck\", \"head\"] as const)\n VRM_LOWER.set(b.toLowerCase(), b);\n }\n return VRM_LOWER.get(name.toLowerCase()) ?? null;\n}\n\nfunction profileOf(names: string[]): RigProfile {\n if (names.some((n) => /^mixamorig/i.test(n))) return \"mixamo\";\n if (names.some((n) => /^(upperarm|lowerarm|thigh|calf)_[lr]$/i.test(n))) return \"unreal\";\n if (names.some((n) => /\\.[LR]$/.test(n))) return \"rigify\";\n if (names.some((n) => /^leftUpperArm$/.test(n))) return \"vrm\";\n if (names.some((n) => /^Spine0[12]$/.test(n))) return \"meshy\";\n return \"generic\";\n}\n\nfunction findHips(root: SkeletonNode): SkeletonNode | null {\n let found: SkeletonNode | null = null;\n const walk = (n: SkeletonNode) => {\n if (found) return;\n const { base } = splitBoneName(n.name);\n if (/^(hips|hip|pelvis)$/.test(base)) {\n found = n;\n return;\n }\n for (const c of n.children) walk(c);\n };\n walk(root);\n return found;\n}\n\nconst isSpineLike = (base: string) => /^(spine|chest|upperchest|torso|back)\\d*$/.test(base);\n\n/**\n * Map a skeleton onto humanoid bones. Pass the scene root (the armature's\n * own transform included): the rest-pose check measures \"down\" in that space,\n * and a Mixamo armature is Z-up under a 90° turn.\n *\n * Limbs and fingers come from their names (any of the conventions above, side\n * from prefixes/suffixes, or from which side of the body they sit when the\n * name has none). The spine comes from the CHAIN between the hips and the\n * neck, not from names, because conventions number it in opposite\n * directions: its first bone is `spine`, the second `chest`, a third\n * `upperChest`.\n */\nexport function detectRig(root: SkeletonNode): RigDetection {\n const all: SkeletonNode[] = [];\n const collect = (n: SkeletonNode) => {\n all.push(n);\n for (const c of n.children) collect(c);\n };\n collect(root);\n const profile = profileOf(all.map((n) => n.name));\n const bones: Partial<Record<HumanoidBone, string>> = {};\n const set = (b: HumanoidBone, name: string) => {\n if (!bones[b]) bones[b] = name;\n };\n\n const hips = findHips(root);\n const positions = restPositions(root);\n if (hips) {\n set(\"hips\", hips.name);\n // The spine chain: follow spine-like children upward from the hips.\n const chain: SkeletonNode[] = [];\n let cur: SkeletonNode | undefined = hips;\n while (cur) {\n const next: SkeletonNode | undefined = cur.children.find((c) => isSpineLike(splitBoneName(c.name).base));\n if (!next) break;\n chain.push(next);\n cur = next;\n }\n if (chain[0]) set(\"spine\", chain[0].name);\n if (chain[1]) set(\"chest\", chain[1].name);\n if (chain[2]) set(\"upperChest\", chain[chain.length - 1].name);\n }\n\n for (const n of all) {\n const vrm = vrmBone(n.name);\n if (vrm) {\n set(vrm, n.name);\n continue;\n }\n const { side, base } = splitBoneName(n.name);\n if (/^neck\\d*$/.test(base)) {\n set(\"neck\", n.name);\n continue;\n }\n if (/^head$/.test(base)) {\n set(\"head\", n.name);\n continue;\n }\n if (base === \"hips\" || base === \"pelvis\" || isSpineLike(base)) continue;\n // No side in the name: decide by which side of the hips it sits (glTF\n // humanoids face +Z, so their left is +X).\n const s =\n side ??\n (() => {\n const p = positions.get(n.name);\n const h = hips ? positions.get(hips.name) : undefined;\n if (!p || !h || Math.abs(p[0] - h[0]) < 1e-4) return null;\n return p[0] > h[0] ? \"left\" : \"right\";\n })();\n if (!s) continue;\n const b = sidedBone(base, s);\n if (b) set(b, n.name);\n }\n\n const byName = new Map<string, HumanoidBone>();\n for (const [b, name] of Object.entries(bones)) byName.set(name as string, b as HumanoidBone);\n\n // Rest pose from the left upper arm's direction.\n let armDrop: number | null = null;\n const ua = bones.leftUpperArm && positions.get(bones.leftUpperArm);\n const la = bones.leftLowerArm && positions.get(bones.leftLowerArm);\n if (ua && la) {\n const d: Vec3 = [la[0] - ua[0], la[1] - ua[1], la[2] - ua[2]];\n const len = Math.hypot(d[0], d[1], d[2]) || 1;\n armDrop = (Math.asin(Math.max(-1, Math.min(1, -d[1] / len))) * 180) / Math.PI;\n }\n const restPose = armDrop === null ? \"unknown\" : armDrop < 15 ? \"T\" : armDrop <= 65 ? \"A\" : \"unknown\";\n\n return {\n profile,\n bones,\n byName,\n restPose,\n armDrop,\n missing: REQUIRED_HUMANOID_BONES.filter((b) => !bones[b]),\n };\n}\n\n/** The same bone on the other side (`leftHand` ↔ `rightHand`). */\nexport function mirrorHumanoidBone(b: HumanoidBone): HumanoidBone {\n if (b.startsWith(\"left\")) return `right${b.slice(4)}` as HumanoidBone;\n if (b.startsWith(\"right\")) return `left${b.slice(5)}` as HumanoidBone;\n return b;\n}\n\n/**\n * Duck-typed adapter for a three.js Object3D/Bone tree (position: Vector3,\n * quaternion: Quaternion), so the runtime can call `detectRig` without this\n * module importing three.\n */\nexport function skeletonFromObject3D(object: {\n name: string;\n position: { x: number; y: number; z: number };\n quaternion: { x: number; y: number; z: number; w: number };\n scale?: { x: number; y: number; z: number };\n children: unknown[];\n}): SkeletonNode {\n const o = object;\n return {\n name: o.name,\n translation: [o.position.x, o.position.y, o.position.z],\n rotation: [o.quaternion.x, o.quaternion.y, o.quaternion.z, o.quaternion.w],\n scale: o.scale ? [o.scale.x, o.scale.y, o.scale.z] : undefined,\n children: (o.children as (typeof object)[]).map(skeletonFromObject3D),\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../core/factories/components/AnimationFactory.ts","../core/factories/components/AudioComponentFactory.ts","../core/factories/components/CameraFactory.ts","../core/factories/components/PhysicsFactory.ts","../core/factories/components/EnvironmentFactory.ts","../core/factories/components/EntityTypeFactory.ts","../core/factories/components/ImageComponentFactory.ts","../core/factories/components/ImageTargetAnchorFactory.ts","../core/factories/components/ImageTargetFactory.ts","../core/factories/components/LightFactory.ts","../core/factories/components/MaterialFactory.ts","../core/factories/components/MeshFactory.ts","../core/factories/components/MeshGeometryFactory.ts","../core/factories/components/ModelFactory.ts","../core/factories/components/NameFactory.ts","../core/factories/components/Object3DRefFactory.ts","../core/factories/components/ParentIdFactory.ts","../core/factories/components/PostprocessingFactory.ts","../core/factories/components/ScriptComponentFactory.ts","../core/factories/components/ScriptObjectComponentFactory.ts","../core/factories/components/SelectableFactory.ts","../core/factories/components/SelectionTransformStateFactory.ts","../core/factories/components/SpriteFactory.ts","../core/factories/components/TransformFactory.ts","../core/factories/components/InstancedMeshComponentFactory.ts","../core/factories/components/InstanceSlotComponentFactory.ts","../core/factories/components/VideoFactory.ts","../core/factories/components/XRRigFactory.ts","../core/factories/components/VRTeleportAreaFactory.ts","../core/factories/components/XRHandPoseFactory.ts","../core/factories/components/XRAnchorFactory.ts","../core/factories/components/BoneAttachmentFactory.ts","../core/factories/components/IKFactory.ts","../core/factories/components/NetworkFactory.ts","../core/factories/components/XRInteractableFactory.ts","../core/factories/components/XRInteractorFactory.ts","../core/factories/components/XRInteractorSideFactory.ts","../core/factories/components/UIButtonComponentFactory.ts","../core/factories/components/UIPanelComponentFactory.ts","../core/factories/components/UISliderComponentFactory.ts","../core/factories/components/UITextComponentFactory.ts","../core/factories/components/UIToggleComponentFactory.ts","../core/animation/bones.ts","../core/utils/dracoDecoderPath.ts","../core/utils/gltfLoader.ts","../core/utils/modelCache.ts","../core/factories/objects/shared.ts","../core/factories/objects/ModelFactory.ts","../core/systems/ObjectManagementSystem.ts"],"names":["material","THREE2","THREE3","THREE4","cloneWithSkeleton","THREE5","THREE6"],"mappings":";;;;;;;;;;AAGO,SAAS,wBAAA,CACd,KAAA,EACA,QAAA,EAAA,GACG,IAAA,EACiB;AACpB,EAAA,MAAM,SAAA,GAAY,IAAI,kBAAA,CAAmB,GAAG,IAAI,CAAA;AAChD,EAAA,KAAA,CAAM,YAAA,CAAa,UAAU,SAAS,CAAA;AACtC,EAAA,OAAO,SAAA;AACT;AARgB,MAAA,CAAA,wBAAA,EAAA,0BAAA,CAAA;ACOhB,SAAS,uBACP,aAAA,EACsC;AACtC,EAAA,MAAM,UAAA,GA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AAS,IAAA,KAAS,IAAA,CAAK,KAAA;AACpG,IAAA,IAAA,CAAK,eAAe,QAAQ,CAAA;AAC5B,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,IAAA,CAAK,IAAI,MAAM,CAAA;AACf,MAAA,IAAI,WAAA,KAAgB,OAAA,EAAS,sBAAA,IAA0B,IAAA,CAAA,EAAO;AAC5D,QAAA,IAAA,CAAK,iBAAA,CAAkB,MAAM,KAAK,CAAA;AAClC,QAAA,IAAA,CAAK,WAAA,CAAY,KAAA,EAAM,CAAE,MAAA,GAAS,QAAA,CAAS,WAAW,CAAA,CAAE,SAAA,CAAU,MAAA,CAAO,QAAA,EAAU,MAAA,CAAO,UAAA,EAAY,OAAO,KAAK,CAAA;AAAA,MACpH;AACA,MAAA,MAAA,CAAO,kBAAkB,IAAI,CAAA;AAC7B,MAAA,IAAA,CAAK,gCAAA,CAAiC,KAAA,EAAO,QAAA,EAAU,MAAM,CAAA;AAAA,IAC/D;AACA,IAAA,IAAA,CAAK,wBAAwB,KAAK,CAAA;AAClC,IAAA,OAAO,IAAA;AAAA,EACT;AAAA,EAEA,OAAO,KAAA,EAAoB;AACzB,IAAA,KAAA,MAAW,OAAA,IAAW,IAAA,CAAK,WAAA,CAAY,MAAA,CAAO,CAAC,CAAA,EAAG;AAChD,MAAA,MAAM,WAAW,IAAA,CAAK,SAAA,CAAU,QAAQ,IAAA,EAAM,KAAA,EAAO,QAAQ,OAAO,CAAA;AACpE,MAAA,OAAA,CAAQ,YAAY,QAAQ,CAAA;AAAA,IAC9B;AAEA,IAAA,IAAA,CAAK,wBAAwB,KAAK,CAAA;AAAA,EACpC;AACF,CAAA;AAvhByD,MAAA,CAAA,uBAAA,EAAA,wBAAA,CAAA;AAAlD,IAAM,sBAAA,GAAN","file":"chunk-JEPUCLZX.js","sourcesContent":["import { AnimationComponent } from \"../../components/Animation\";\nimport type { World } from \"../../World\";\n\nexport function createAnimationComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof AnimationComponent>\n): AnimationComponent {\n const component = new AnimationComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import * as THREE from \"three\";\nimport { AudioComponent } from \"../../components/Audio\";\nimport type { World } from \"../../World\";\n\ntype CreateAudioComponentContext = {\n object?: THREE.Object3D | null;\n listener?: THREE.AudioListener | null;\n isEditor?: boolean;\n};\n\nfunction normalizeDistanceModel(\n distanceModel: string,\n): \"inverse\" | \"linear\" | \"exponential\" {\n const normalized = distanceModel.trim().toLowerCase();\n\n if (normalized === \"linear\" || normalized === \"exponential\") {\n return normalized;\n }\n\n return \"inverse\";\n}\n\nfunction createConfiguredAudio(\n listener: THREE.AudioListener,\n options: AudioComponent[\"options\"],\n): THREE.Audio<GainNode> | THREE.PositionalAudio {\n const sound = options.positional\n ? new THREE.PositionalAudio(listener)\n : new THREE.Audio(listener);\n\n sound.setLoop(options.loop);\n sound.setVolume(options.volume);\n sound.setPlaybackRate(options.pitch);\n\n if (sound instanceof THREE.PositionalAudio) {\n sound.setRefDistance(options.refDistance);\n sound.setDistanceModel(normalizeDistanceModel(options.distanceModel));\n sound.setRolloffFactor(options.rolloffFactor);\n }\n\n return sound;\n}\n\nfunction createAudioEditorHelper(): THREE.Object3D {\n if (typeof document === \"undefined\") {\n const geometry = new THREE.EdgesGeometry(\n new THREE.OctahedronGeometry(0.22, 0),\n );\n const material = new THREE.LineBasicMaterial({\n color: \"#8bc8ff\",\n transparent: true,\n opacity: 0.95,\n depthTest: false,\n });\n\n const fallback = new THREE.LineSegments(geometry, material);\n fallback.renderOrder = 10;\n fallback.userData.ecsHelper = true;\n fallback.visible = false;\n return fallback;\n }\n\n const size = 96;\n const canvas = document.createElement(\"canvas\");\n canvas.width = size;\n canvas.height = size;\n\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n return new THREE.Object3D();\n }\n\n ctx.clearRect(0, 0, size, size);\n\n ctx.fillStyle = \"rgba(27, 35, 52, 0.9)\";\n ctx.beginPath();\n ctx.arc(size / 2, size / 2, 36, 0, Math.PI * 2);\n ctx.fill();\n\n ctx.strokeStyle = \"rgba(137, 202, 255, 0.9)\";\n ctx.lineWidth = 4;\n ctx.beginPath();\n ctx.arc(size / 2, size / 2, 36, 0, Math.PI * 2);\n ctx.stroke();\n\n ctx.fillStyle = \"#d9ecff\";\n ctx.beginPath();\n ctx.moveTo(33, 56);\n ctx.lineTo(43, 56);\n ctx.lineTo(54, 66);\n ctx.lineTo(54, 30);\n ctx.lineTo(43, 40);\n ctx.lineTo(33, 40);\n ctx.closePath();\n ctx.fill();\n\n ctx.strokeStyle = \"#7fd2ff\";\n ctx.lineWidth = 4;\n ctx.lineCap = \"round\";\n ctx.beginPath();\n ctx.arc(56, 48, 10, -0.8, 0.8);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.arc(56, 48, 16, -0.8, 0.8);\n ctx.stroke();\n\n const texture = new THREE.CanvasTexture(canvas);\n texture.needsUpdate = true;\n\n const material = new THREE.SpriteMaterial({\n map: texture,\n transparent: true,\n depthTest: false,\n });\n\n const helper = new THREE.Sprite(material);\n helper.scale.set(0.68, 0.68, 0.68);\n helper.renderOrder = 10;\n helper.userData.ecsHelper = true;\n helper.visible = false;\n\n return helper;\n}\n\nexport function createAudioComponent(\n world: World,\n entityId: number,\n path = \"\",\n options: Partial<AudioComponent[\"options\"]> = {},\n context?: CreateAudioComponentContext,\n): AudioComponent {\n const component = new AudioComponent(path, options);\n\n const anchor = context?.object ?? null;\n const listener = context?.listener ?? null;\n if (anchor && listener) {\n component.object = anchor;\n const sound = createConfiguredAudio(listener, component.options);\n\n if (context?.isEditor) {\n anchor.add(createAudioEditorHelper());\n }\n\n anchor.add(sound);\n component.audio = sound;\n }\n\n world.addComponent(entityId, component);\n return component;\n}\n","import * as THREE from \"three\";\n\nimport { CameraComponent, type CameraComponentOptions } from \"../../components/Camera\";\nimport { Object3DRef } from \"../../components/Object3DRef\";\nimport type { World } from \"../../World\";\n\nexport function createCameraComponent(\n world: World,\n entityId: number,\n payload: CameraComponentOptions = {},\n): CameraComponent {\n const object = world.getComponent(entityId, Object3DRef)?.object;\n const objectCamera = object instanceof THREE.Camera ? object : undefined;\n\n const component = new CameraComponent({\n ...payload,\n camera: payload.camera ?? objectCamera,\n });\n\n world.addComponent(entityId, component);\n return component;\n}\n","import {\n PhysicsComponent,\n type ColliderState,\n type RigidbodyState,\n} from \"../../components/Physics\";\nimport {\n MeshGeometryComponent,\n type CubeMeshParameters,\n type PlaneMeshParameters,\n type RadiusHeightMeshParameters,\n type RadiusMeshParameters,\n} from \"../../components/MeshGeometry\";\nimport type { World } from \"../../World\";\n\ntype PhysicsFactoryValues = {\n rigidbody?: Partial<RigidbodyState>;\n collider?: Partial<ColliderState>;\n};\n\n/**\n * Derive a collider that matches the entity's primitive geometry, so adding a\n * PhysicsComponent \"just works\" without hand-authoring dimensions.\n *\n * Collider dimensions are authored in unscaled local units (PhysicsSyncSystem\n * multiplies by world scale), and `size` holds FULL edge lengths — both of\n * which the mesh-geometry parameters already are, so they map 1:1.\n *\n * Returns null for models and unknown kinds — those keep the generic defaults\n * and should be sized explicitly from measured bounds.\n */\nfunction deriveColliderFromGeometry(\n world: World,\n entityId: number,\n): PhysicsFactoryValues | null {\n const meshGeometry = world.getComponent(entityId, MeshGeometryComponent);\n if (!meshGeometry) {\n return null;\n }\n\n switch (meshGeometry.kind) {\n case \"plane\": {\n const params = meshGeometry.parameters as PlaneMeshParameters;\n // PlaneGeometry lies in the local XY plane (the plane factory pre-rotates\n // the entity -90° on X to lay it flat), so the plane's normal is LOCAL Z.\n // The collider must therefore be a thin slab on Z — a thin Y slab would\n // stand up as a wall once the entity rotation is applied.\n return {\n collider: {\n shape: \"cuboid\",\n size: { x: params.width, y: params.height, z: 0.05 },\n },\n // An (effectively) zero-thickness sheet is only physically meaningful\n // as static geometry — planes are floors/walls, not dynamic bodies.\n rigidbody: { type: \"fixed\" },\n };\n }\n case \"cube\": {\n const params = meshGeometry.parameters as CubeMeshParameters;\n return {\n collider: {\n shape: \"cuboid\",\n size: { x: params.width, y: params.height, z: params.depth },\n },\n };\n }\n case \"sphere\": {\n const params = meshGeometry.parameters as RadiusMeshParameters;\n return { collider: { shape: \"ball\", radius: params.radius } };\n }\n case \"capsule\": {\n const params = meshGeometry.parameters as RadiusHeightMeshParameters;\n return {\n collider: {\n shape: \"capsule\",\n radius: params.radius,\n height: params.height,\n },\n };\n }\n case \"cylinder\": {\n const params = meshGeometry.parameters as RadiusHeightMeshParameters;\n return {\n collider: {\n shape: \"cylinder\",\n radius: params.radius,\n height: params.height,\n },\n };\n }\n default:\n return null;\n }\n}\n\nexport function createPhysicsComponent(\n world: World,\n entityId: number,\n values?: PhysicsFactoryValues,\n): PhysicsComponent {\n // Only derive when the caller supplied nothing: hydration/duplication pass\n // (or copy over) saved values, and explicit authoring wins untouched.\n const initial =\n values ?? deriveColliderFromGeometry(world, entityId) ?? undefined;\n const component = new PhysicsComponent(initial);\n world.addComponent(entityId, component);\n return component;\n}\n","import { Environment, type EnvironmentState } from \"../../components/Environment\";\nimport type { World } from \"../../World\";\n\nexport function createEnvironmentComponent(\n world: World,\n entityId: number,\n values?: Partial<EnvironmentState>,\n): Environment {\n const component = new Environment(values);\n world.addComponent(entityId, component);\n return component;\n}\n","import { EntityType } from \"../../components/EntityType\";\nimport type { World } from \"../../World\";\n\nexport function createEntityTypeComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof EntityType>\n): EntityType {\n const component = new EntityType(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { ImageComponent } from \"../../components/Image\";\nimport type { World } from \"../../World\";\n\nexport function createImageComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof ImageComponent>\n): ImageComponent {\n const component = new ImageComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { ImageTargetAnchor } from \"../../components/ImageTargetAnchor\";\nimport type { World } from \"../../World\";\n\nexport function createImageTargetAnchorComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof ImageTargetAnchor>\n): ImageTargetAnchor {\n const component = new ImageTargetAnchor(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { ImageTarget } from \"../../components/ImageTarget\";\nimport type { World } from \"../../World\";\n\nexport function createImageTargetComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof ImageTarget>\n): ImageTarget {\n const component = new ImageTarget(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { LightComponent } from \"../../components/Light\";\nimport type { World } from \"../../World\";\n\nexport function createLightComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof LightComponent>\n): LightComponent {\n const component = new LightComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { MaterialComponent } from \"../../components/Material\";\nimport type { World } from \"../../World\";\n\nexport function createMaterialComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof MaterialComponent>\n): MaterialComponent {\n const component = new MaterialComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { MeshComponent } from \"../../components/Mesh\";\nimport type { World } from \"../../World\";\n\nexport function createMeshComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof MeshComponent>\n): MeshComponent {\n const component = new MeshComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { MeshGeometryComponent } from \"../../components/MeshGeometry\";\nimport type { World } from \"../../World\";\n\nexport function createMeshGeometryComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof MeshGeometryComponent>\n): MeshGeometryComponent {\n const component = new MeshGeometryComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { ModelComponent } from \"../../components/Model\";\nimport type { World } from \"../../World\";\n\nexport function createModelComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof ModelComponent>\n): ModelComponent {\n const component = new ModelComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { Name } from \"../../components/Name\";\nimport type { World } from \"../../World\";\n\nexport function createNameComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof Name>\n): Name {\n const component = new Name(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { Object3DRef } from \"../../components/Object3DRef\";\nimport type { World } from \"../../World\";\n\nexport function createObject3DRefComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof Object3DRef>\n): Object3DRef {\n const component = new Object3DRef(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { ParentId } from \"../../components/ParentId\";\nimport type { World } from \"../../World\";\n\nexport function createParentIdComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof ParentId>\n): ParentId {\n const component = new ParentId(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import {\n Postprocessing,\n type PostprocessingState,\n} from \"../../components/Postprocessing\";\nimport type { World } from \"../../World\";\n\nexport function createPostprocessingComponent(\n world: World,\n entityId: number,\n values?: Partial<PostprocessingState>,\n): Postprocessing {\n const component = new Postprocessing(values);\n world.addComponent(entityId, component);\n return component;\n}\n","import { ScriptComponent, type ScriptEntry } from \"../../components/ScriptComponent\";\nimport type { World } from \"../../World\";\n\ntype ScriptComponentPayload = {\n entries?: Array<Partial<ScriptEntry>>;\n};\n\nexport function createScriptComponent(\n world: World,\n entityId: number,\n payload: ScriptComponentPayload = {},\n): ScriptComponent {\n const entries = Array.isArray(payload.entries)\n ? payload.entries.map((entry) => ({\n entityId,\n className: typeof entry.className === \"string\" ? entry.className : \"\",\n scriptUrl: typeof entry.scriptUrl === \"string\" ? entry.scriptUrl : \"\",\n enabled: typeof entry.enabled === \"boolean\" ? entry.enabled : true,\n data:\n entry.data && typeof entry.data === \"object\" && !Array.isArray(entry.data)\n ? (entry.data as Record<string, unknown>)\n : {},\n runtimeState: entry.runtimeState,\n runtimeMessage:\n typeof entry.runtimeMessage === \"string\" ? entry.runtimeMessage : undefined,\n }))\n : [];\n\n const component = new ScriptComponent(entries);\n\n world.addComponent(entityId, component);\n return component;\n}","import {\n ScriptObjectComponent,\n type ScriptObjectComponentInput,\n} from \"../../components/ScriptObjectComponent\";\nimport type { World } from \"../../World\";\n\nexport function createScriptObjectComponent(\n world: World,\n entityId: number,\n payload: ScriptObjectComponentInput = {},\n): ScriptObjectComponent {\n const component = new ScriptObjectComponent(payload);\n world.addComponent(entityId, component);\n return component;\n}\n","import { Selectable } from \"../../components/Selectable\";\nimport type { World } from \"../../World\";\n\nexport function createSelectableComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof Selectable>\n): Selectable {\n const component = new Selectable(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { SelectionTransformState } from \"../../components/SelectionTransformState\";\nimport type { World } from \"../../World\";\n\nexport function createSelectionTransformStateComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof SelectionTransformState>\n): SelectionTransformState {\n const component = new SelectionTransformState(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { SpriteComponent } from \"../../components/Sprite\";\nimport type { World } from \"../../World\";\n\nexport function createSpriteComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof SpriteComponent>\n): SpriteComponent {\n const component = new SpriteComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { TransformComponent } from \"../../components/Transform\";\nimport type { World } from \"../../World\";\n\nexport function createTransformComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof TransformComponent>\n): TransformComponent {\n const component = new TransformComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { InstancedMeshComponent } from \"../../components/InstancedMesh\";\nimport type { InstancedMeshKind } from \"../../components/InstancedMesh\";\nimport type { MeshGeometryParameters } from \"../../components/MeshGeometry\";\nimport type { World } from \"../../World\";\n\nexport function createInstancedMeshComponent(\n world: World,\n entityId: number,\n meshKind: InstancedMeshKind,\n meshParameters?: Partial<MeshGeometryParameters>,\n options?: {\n castShadow?: boolean;\n receiveShadow?: boolean;\n instanceEntityIds?: number[];\n modelPath?: string;\n },\n): InstancedMeshComponent {\n const component = new InstancedMeshComponent(meshKind, meshParameters, options);\n world.addComponent(entityId, component);\n return component;\n}\n","import { InstanceSlotComponent } from \"../../components/InstanceSlotComponent\";\nimport type { World } from \"../../World\";\n\nexport function createInstanceSlotComponent(\n world: World,\n entityId: number,\n groupEntityId: number,\n slotIndex: number,\n): InstanceSlotComponent {\n const component = new InstanceSlotComponent(groupEntityId, slotIndex);\n world.addComponent(entityId, component);\n return component;\n}\n","import { VideoComponent } from \"../../components/Video\";\nimport type { World } from \"../../World\";\n\nexport function createVideoComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof VideoComponent>\n): VideoComponent {\n const component = new VideoComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { XRRigComponent } from \"../../components/XRRig\";\nimport type { World } from \"../../World\";\n\nexport function createXRRigComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof XRRigComponent>\n): XRRigComponent {\n const component = new XRRigComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { VRTeleportAreaComponent } from \"../../components/VRTeleportArea\";\nimport type { World } from \"../../World\";\n\nexport function createVRTeleportAreaComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof VRTeleportAreaComponent>\n): VRTeleportAreaComponent {\n const component = new VRTeleportAreaComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { XRHandPoseComponent } from \"../../components/XRHandPose\";\nimport type { World } from \"../../World\";\n\nexport function createXRHandPoseComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof XRHandPoseComponent>\n): XRHandPoseComponent {\n const component = new XRHandPoseComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { XRAnchorComponent } from \"../../components/XRAnchor\";\nimport type { World } from \"../../World\";\n\nexport function createXRAnchorComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof XRAnchorComponent>\n): XRAnchorComponent {\n const component = new XRAnchorComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { BoneAttachmentComponent } from \"../../components/BoneAttachment\";\nimport type { World } from \"../../World\";\n\nexport function createBoneAttachmentComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof BoneAttachmentComponent>\n): BoneAttachmentComponent {\n const component = new BoneAttachmentComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { IKComponent } from \"../../components/IK\";\nimport type { World } from \"../../World\";\n\nexport function createIKComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof IKComponent>\n): IKComponent {\n const component = new IKComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import {\n NetworkedPropsComponent,\n NetworkIdentityComponent,\n NetworkSpawnerComponent,\n NetworkTransformComponent,\n} from \"../../components/Network\";\nimport type { World } from \"../../World\";\n\nexport function createNetworkIdentityComponent(world: World, entityId: number) {\n const component = new NetworkIdentityComponent();\n world.addComponent(entityId, component);\n return component;\n}\n\nexport function createNetworkTransformComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof NetworkTransformComponent>\n) {\n const component = new NetworkTransformComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n\nexport function createNetworkedPropsComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof NetworkedPropsComponent>\n) {\n const component = new NetworkedPropsComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n\nexport function createNetworkSpawnerComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof NetworkSpawnerComponent>\n) {\n const component = new NetworkSpawnerComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { XRInteractableComponent } from \"../../components/XRInteractable\";\nimport type { World } from \"../../World\";\n\nexport function createXRInteractableComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof XRInteractableComponent>\n): XRInteractableComponent {\n const component = new XRInteractableComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { XRInteractorComponent } from \"../../components/XRInteractor\";\nimport type { World } from \"../../World\";\n\nexport function createXRInteractorComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof XRInteractorComponent>\n): XRInteractorComponent {\n const component = new XRInteractorComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { XRInteractorSideComponent } from \"../../components/XRInteractor\";\nimport type { World } from \"../../World\";\n\nexport function createXRInteractorSideComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof XRInteractorSideComponent>\n): XRInteractorSideComponent {\n const component = new XRInteractorSideComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { UIButtonComponent } from \"../../components/UIButton\";\nimport type { World } from \"../../World\";\n\nexport function createUIButtonComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof UIButtonComponent>\n): UIButtonComponent {\n const component = new UIButtonComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { UIPanelComponent } from \"../../components/UIPanel\";\nimport type { World } from \"../../World\";\n\nexport function createUIPanelComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof UIPanelComponent>\n): UIPanelComponent {\n const component = new UIPanelComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { UISliderComponent } from \"../../components/UISlider\";\nimport type { World } from \"../../World\";\n\nexport function createUISliderComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof UISliderComponent>\n): UISliderComponent {\n const component = new UISliderComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { UITextComponent } from \"../../components/UIText\";\nimport type { World } from \"../../World\";\n\nexport function createUITextComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof UITextComponent>\n): UITextComponent {\n const component = new UITextComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import { UIToggleComponent } from \"../../components/UIToggle\";\nimport type { World } from \"../../World\";\n\nexport function createUIToggleComponent(\n world: World,\n entityId: number,\n ...args: ConstructorParameters<typeof UIToggleComponent>\n): UIToggleComponent {\n const component = new UIToggleComponent(...args);\n world.addComponent(entityId, component);\n return component;\n}\n","import * as THREE from \"three\";\n\nimport { detectRig, type HumanoidBone, skeletonFromObject3D } from \"./humanoid\";\n\n/** A bone of a loaded model, for bone pickers and attachment. */\nexport type ModelBoneInfo = {\n /** Node name as three.js has it (glTF names are sanitized: `mixamorig:Hips` → `mixamorigHips`). */\n name: string;\n /** Humanoid name when the rig is a recognisable humanoid, else `null`. */\n humanoid: HumanoidBone | null;\n /** Parent bone's name, or `null` for a root bone. */\n parent: string | null;\n /** Depth below the topmost bone (for indenting a tree). */\n depth: number;\n};\n\n/** Bones of `root`: objects flagged `isBone`, plus every joint a skinned mesh binds to. */\nfunction collectBones(root: THREE.Object3D): Set<THREE.Object3D> {\n const bones = new Set<THREE.Object3D>();\n root.traverse((o) => {\n if ((o as THREE.Bone).isBone) bones.add(o);\n const skinned = o as THREE.SkinnedMesh;\n if (skinned.isSkinnedMesh && skinned.skeleton) {\n for (const b of skinned.skeleton.bones) bones.add(b);\n }\n });\n return bones;\n}\n\n/** humanoid name ← node name, for `root`'s rig (empty when it isn't a humanoid). */\nfunction humanoidNames(root: THREE.Object3D): Map<string, HumanoidBone> {\n try {\n return detectRig(skeletonFromObject3D(root)).byName;\n } catch {\n return new Map();\n }\n}\n\n/** Every bone of a loaded model, parents before children. */\nexport function listModelBones(root: THREE.Object3D): ModelBoneInfo[] {\n const bones = collectBones(root);\n const humanoid = humanoidNames(root);\n const out: ModelBoneInfo[] = [];\n const visit = (o: THREE.Object3D, parent: THREE.Object3D | null, depth: number) => {\n const isBone = bones.has(o);\n if (isBone) {\n out.push({ name: o.name, humanoid: humanoid.get(o.name) ?? null, parent: parent?.name ?? null, depth });\n }\n for (const c of o.children) visit(c, isBone ? o : parent, isBone ? depth + 1 : depth);\n };\n visit(root, null, 0);\n return out;\n}\n\n/**\n * The bone an attachment names in `root`: by node name, then by its\n * sanitized form (a name saved from a source file), then by humanoid name\n * (the same body part on another rig). `null` when none matches.\n */\nexport function findModelBone(\n root: THREE.Object3D,\n ref: { bone?: string | null; humanoid?: string | null },\n): THREE.Object3D | null {\n const bones = collectBones(root);\n const byName = new Map<string, THREE.Object3D>();\n for (const b of bones) if (!byName.has(b.name)) byName.set(b.name, b);\n const name = ref.bone ?? \"\";\n if (name) {\n const hit = byName.get(name) ?? byName.get(THREE.PropertyBinding.sanitizeNodeName(name));\n if (hit) return hit;\n }\n if (ref.humanoid) {\n for (const [node, human] of humanoidNames(root)) {\n if (human === ref.humanoid) return byName.get(node) ?? root.getObjectByName(node) ?? null;\n }\n }\n return null;\n}\n","const LOCAL_DRACO_DECODER_RELATIVE_PATH = \"./assets/draco/\";\nexport const DRACO_DECODER_CDN_PATH =\n \"https://www.gstatic.com/draco/versioned/decoders/1.5.7/\";\n\nlet dracoDecoderPathOverride: string | null = null;\n\n/**\n * Override where the DRACO decoder files (draco_wasm_wrapper.js,\n * draco_decoder.wasm, draco_decoder.js) are fetched from. Embedding apps\n * whose bundlers relocate this package's chunks — making the default\n * import.meta.url resolution point at a location that is never populated —\n * should call this before any model loads. The path must end with \"/\".\n * Pass null to restore the default resolution.\n */\nexport function setDracoDecoderPath(path: string | null): void {\n dracoDecoderPathOverride = path;\n}\n\nfunction isBlockedBrowserFileUrl(url: string): boolean {\n return url.startsWith(\"file://\");\n}\n\nexport function resolveDracoDecoderPath(): string {\n if (dracoDecoderPathOverride) {\n return dracoDecoderPathOverride;\n }\n\n try {\n // Prefer vendored decoder assets shipped with this package.\n const resolvedPath = new URL(\n LOCAL_DRACO_DECODER_RELATIVE_PATH,\n import.meta.url,\n ).toString();\n\n // Browser loaders cannot fetch file:// resources from package install paths.\n // Fall back to CDN decoders when bundlers emit file URLs for node_modules assets.\n if (isBlockedBrowserFileUrl(resolvedPath)) {\n return DRACO_DECODER_CDN_PATH;\n }\n\n return resolvedPath;\n } catch {\n // Fallback keeps compatibility in runtimes that cannot resolve package-relative URLs.\n return DRACO_DECODER_CDN_PATH;\n }\n}\n","import { DRACOLoader } from \"three/examples/jsm/loaders/DRACOLoader.js\";\nimport { GLTFLoader } from \"three/examples/jsm/loaders/GLTFLoader.js\";\nimport { MeshoptDecoder } from \"three/examples/jsm/libs/meshopt_decoder.module.js\";\nimport { resolveDracoDecoderPath } from \"./dracoDecoderPath\";\n\n/**\n * The one GLTFLoader setup for every model and clip the engine loads.\n *\n * - Draco (`KHR_draco_mesh_compression`): decoder files resolved per loader,\n * so a `setDracoDecoderPath()` override made after module load still\n * applies.\n * - meshopt (`EXT_meshopt_compression`): what the editor's model optimiser\n * writes (gltf-transform + meshoptimizer, the pipeline the Akofena\n * characters shipped with). The decoder carries its wasm inline, so there\n * is no path to configure.\n *\n * Quantized meshes (`KHR_mesh_quantization`) and WebP textures\n * (`EXT_texture_webp`) need no decoder: GLTFLoader reads them natively.\n */\nexport function createGLTFLoader(): GLTFLoader {\n const loader = new GLTFLoader();\n try {\n const dracoLoader = new DRACOLoader();\n dracoLoader.setDecoderPath(resolveDracoDecoderPath());\n loader.setDRACOLoader(dracoLoader);\n } catch (error) {\n // GLTFLoader still throws if a file actually needs Draco.\n console.warn(\"DRACOLoader could not be configured. Loading non-Draco models only.\", error);\n }\n loader.setMeshoptDecoder(MeshoptDecoder);\n return loader;\n}\n","import * as THREE from \"three\";\nimport type { GLTF } from \"three/examples/jsm/loaders/GLTFLoader.js\";\nimport { clone as cloneWithSkeleton } from \"three/examples/jsm/utils/SkeletonUtils.js\";\n\n/**\n * userData flag set on geometries/materials that back shared (cached) model\n * scenes. Entity disposal must skip these — other live clones and future\n * spawns reference the same GPU resources.\n */\nexport const SHARED_MODEL_RESOURCE_FLAG = \"spatialEcsSharedModelResource\";\n\nconst modelCache = new Map<string, Promise<GLTF>>();\n\nfunction markSharedResources(root: THREE.Object3D): void {\n root.traverse((child) => {\n if (!(child instanceof THREE.Mesh)) {\n return;\n }\n if (child.geometry) {\n child.geometry.userData[SHARED_MODEL_RESOURCE_FLAG] = true;\n }\n const materials = Array.isArray(child.material)\n ? child.material\n : [child.material];\n for (const material of materials) {\n if (material) {\n material.userData[SHARED_MODEL_RESOURCE_FLAG] = true;\n }\n }\n });\n}\n\n/**\n * Load a GLTF once per URL and share the parsed result, so repeated spawns of\n * the same model skip both the fetch and the parse. The cached scene must\n * never be mounted directly (an Object3D has a single parent) — mount a\n * cloneModelScene() of it. Failed loads are evicted so a retry re-fetches.\n */\nexport function loadSharedGltf(\n url: string,\n load: () => Promise<GLTF>,\n): Promise<GLTF> {\n let pending = modelCache.get(url);\n if (!pending) {\n pending = load().then((gltf) => {\n markSharedResources(gltf.scene);\n return gltf;\n });\n pending.catch(() => {\n modelCache.delete(url);\n });\n modelCache.set(url, pending);\n }\n return pending;\n}\n\n/**\n * Skeleton-aware clone of a cached model scene for mounting. Geometries and\n * materials are shared with the cached original (marked via\n * SHARED_MODEL_RESOURCE_FLAG); the object hierarchy — including rebound\n * skeletons for skinned meshes — is fresh per call.\n */\nexport function cloneModelScene(scene: THREE.Object3D): THREE.Object3D {\n return cloneWithSkeleton(scene);\n}\n\n/**\n * Forget cached models (one URL, or everything). Subsequent loads fetch and\n * parse anew. Does not dispose GPU resources — live clones may still use them.\n */\nexport function clearModelCache(url?: string): void {\n if (typeof url === \"string\") {\n modelCache.delete(url);\n return;\n }\n modelCache.clear();\n}\n","import type * as THREE from \"three\";\n\nimport type { TransformData } from \"../../components/Transform\";\nimport {\n createEntityTypeComponent,\n createNameComponent,\n createObject3DRefComponent,\n createParentIdComponent,\n createSelectableComponent,\n} from \"../components\";\n\nimport {\n applyTransform,\n createTransform,\n} from \"../../systems/ObjectManagementSystem\";\nimport type { EcsEntityKind, EntityId } from \"../../types\";\nimport type { World } from \"../../World\";\n\ntype CreateBaseEntityOptions = {\n label: string;\n entityType: EcsEntityKind;\n transformInput?: TransformData;\n parentId?: EntityId | null;\n};\n\nexport function createBaseEntity(\n world: World,\n object: THREE.Object3D,\n options: CreateBaseEntityOptions,\n): number {\n const entityId = world.createEntity();\n object.userData.entityId = entityId;\n\n const transform = createTransform(options.transformInput);\n applyTransform(object, transform);\n\n world.addComponent(entityId, transform);\n createObject3DRefComponent(world, entityId, object);\n createNameComponent(world, entityId, options.label);\n createEntityTypeComponent(world, entityId, options.entityType);\n createParentIdComponent(world, entityId, options.parentId ?? null);\n createSelectableComponent(world, entityId, true);\n\n return entityId;\n}\n","import * as THREE from \"three\";\nimport type { GLTF, GLTFLoader } from \"three/examples/jsm/loaders/GLTFLoader.js\";\nimport { createGLTFLoader } from \"../../utils/gltfLoader\";\nimport { cloneModelScene, loadSharedGltf, SHARED_MODEL_RESOURCE_FLAG } from \"../../utils/modelCache\";\n\nimport {\n createAnimationComponent,\n createMeshGeometryComponent,\n createModelComponent,\n} from \"../components\";\nimport { AnimationComponent, MeshGeometryComponent, ModelComponent, Object3DRef, setModelLoadState } from \"../../components\";\nimport type { CreateContext } from \"../../systems/ObjectManagementSystem\";\nimport { createBaseEntity } from \"./shared\";\n\nfunction getModelFileName(path: string): string {\n const segments = path.split(/[\\\\/]/).filter(Boolean);\n return segments[segments.length - 1] ?? \"\";\n}\n\nfunction createModelLoader(): GLTFLoader {\n return createGLTFLoader();\n}\n\nfunction collectModelMaterials(rootObject: THREE.Object3D): THREE.Material[] {\n const materialSet = new Set<THREE.Material>();\n\n rootObject.traverse((child) => {\n const asMesh = child as THREE.Mesh;\n if (!asMesh.material) {\n return;\n }\n\n if (Array.isArray(asMesh.material)) {\n for (const material of asMesh.material) {\n if (material) {\n materialSet.add(material);\n }\n }\n return;\n }\n\n materialSet.add(asMesh.material);\n });\n\n return [...materialSet];\n}\n\nexport function createModel({\n world,\n scene,\n payload,\n isEditor,\n}: CreateContext): number {\n const anchor = new THREE.Object3D();\n\n const modelPath = payload.path ?? \"\";\n\n const entityId = createBaseEntity(world, anchor, {\n label: payload.name ?? \"Model\",\n entityType: \"model\",\n transformInput: payload.transform,\n });\n\n const model = createModelComponent(world, entityId, modelPath);\n createMeshGeometryComponent(world, entityId, \"model\", anchor, {}, {\n modelName: getModelFileName(modelPath),\n castShadow: false,\n receiveShadow: false,\n });\n\n model.object = anchor;\n scene.add(anchor);\n\n // An empty path has nothing to load; the component already reports\n // `\"error\"` with MODEL_NO_PATH_MESSAGE.\n if (!modelPath) {\n return entityId;\n }\n setModelLoadState(model, \"loading\");\n loadModelInto({ world, entityId, anchor, modelPath, isEditor: Boolean(isEditor) });\n\n return entityId;\n}\n\n/**\n * Load `modelPath` and hang it under the entity's anchor: the shared half of\n * creating a model entity and reloading one (a model file rewritten in the\n * editor). The loaded scene becomes `ModelComponent.object` and the mesh\n * geometry's object; its clips feed the entity's AnimationComponent.\n */\nfunction loadModelInto({\n world,\n entityId,\n anchor,\n modelPath,\n isEditor,\n}: {\n world: CreateContext[\"world\"];\n entityId: number;\n anchor: THREE.Object3D;\n modelPath: string;\n isEditor: boolean;\n}): void {\n const model = world.getComponent(entityId, ModelComponent);\n const meshGeometry = world.getComponent(entityId, MeshGeometryComponent);\n if (!model) return;\n\n const attachLoadedModel = (gltf: GLTF, object: THREE.Object3D) => {\n if (!world.hasEntity(entityId) || world.getComponent(entityId, ModelComponent) !== model) {\n return;\n }\n\n object.userData.entityId = entityId;\n object.traverse((child) => {\n child.userData.entityId = entityId;\n });\n\n anchor.add(object);\n model.object = object;\n if (meshGeometry) meshGeometry.object = object;\n\n if (gltf.animations.length > 0) {\n let animation = world.getComponent(entityId, AnimationComponent);\n\n if (!animation) {\n animation = createAnimationComponent(world, entityId, {\n clips: gltf.animations,\n externalClipSources: [],\n paused: false,\n reverse: false,\n timeScale: 1,\n crossFadeDuration: 0,\n });\n }\n\n animation.setModelClips(gltf.animations);\n }\n\n setModelLoadState(model, \"loaded\");\n };\n\n const onLoadError = (error: unknown) => {\n const message =\n error instanceof Error && error.message\n ? error.message\n : typeof error === \"string\" && error\n ? error\n : `Failed to load model: ${modelPath}`;\n setModelLoadState(model, \"error\", message);\n console.error(`Failed to load model: ${modelPath}`, error);\n };\n\n if (isEditor) {\n // Editor sessions can re-import an asset under the same URL, which a\n // shared cache would mask with stale content — load fresh per spawn.\n createModelLoader().load(\n modelPath,\n (gltf) => attachLoadedModel(gltf, gltf.scene),\n undefined,\n onLoadError,\n );\n } else {\n // Runtime: parse each model URL once and mount skeleton-aware clones, so\n // repeated spawns (and script-driven respawns) skip fetch and parse.\n loadSharedGltf(\n modelPath,\n () =>\n new Promise<GLTF>((resolve, reject) => {\n createModelLoader().load(modelPath, resolve, undefined, reject);\n }),\n )\n .then((gltf) => attachLoadedModel(gltf, cloneModelScene(gltf.scene)))\n .catch(onLoadError);\n }\n}\n\n/**\n * Load a model entity's file again (it was rewritten: optimised, re-rigged,\n * its animations edited) and swap it in. The old loaded scene is removed and\n * its own geometry and materials disposed; the entity, its components and its\n * children stay, and objects attached to its bones move onto the new ones.\n * Returns false when the entity has no model to reload.\n */\nexport function reloadModelEntity(\n world: CreateContext[\"world\"],\n entityId: number,\n isEditor: boolean,\n): boolean {\n const model = world.getComponent(entityId, ModelComponent);\n const anchor = world.getComponent(entityId, Object3DRef)?.object;\n if (!model || !anchor || !model.path) return false;\n const old = model.object;\n if (old && old !== anchor) {\n old.removeFromParent();\n old.traverse((child) => {\n const mesh = child as THREE.Mesh;\n if (mesh.geometry && !mesh.geometry.userData?.[SHARED_MODEL_RESOURCE_FLAG]) mesh.geometry.dispose();\n const mats = Array.isArray(mesh.material) ? mesh.material : mesh.material ? [mesh.material] : [];\n for (const m of mats) if (!m.userData?.[SHARED_MODEL_RESOURCE_FLAG]) m.dispose();\n });\n }\n model.object = anchor;\n setModelLoadState(model, \"loading\");\n loadModelInto({ world, entityId, anchor, modelPath: model.path, isEditor });\n return true;\n}\n","import * as THREE from \"three\";\n\nimport { findModelBone, listModelBones, type ModelBoneInfo } from \"../animation/bones\";\nimport { reloadModelEntity } from \"../factories/objects/ModelFactory\";\nimport { BoneAttachmentComponent } from \"../components/BoneAttachment\";\nimport { ModelComponent } from \"../components/Model\";\nimport { Object3DRef } from \"../components/Object3DRef\";\nimport { ParentId } from \"../components/ParentId\";\nimport type { TransformData } from \"../components/Transform\";\nimport { TransformComponent } from \"../components/Transform\";\nimport type { EcsSystem } from \"../System\";\nimport { SHARED_MODEL_RESOURCE_FLAG } from \"../utils/modelCache\";\nimport type { World } from \"../World\";\nimport type { EntityId, EcsEntityKind } from \"../types\";\n\nexport type CreatePayload = {\n name?: string;\n transform?: TransformData;\n parentId?: EntityId | null;\n path?: string;\n options?: Record<string, unknown>;\n camera?: Record<string, unknown>;\n useWorldCamera?: boolean;\n /**\n * Suppress the default child entities a factory would otherwise create.\n *\n * Set during hydration: the snapshot already contains those children, so\n * letting the factory add its own too duplicates them on every load.\n */\n skipDefaultChildren?: boolean;\n};\n\n/** Marks the socket object a bone attachment adds under a bone (value: the attached entity's id). */\nexport const BONE_SOCKET_FLAG = \"__reluBoneSocket\";\n\n/** A bone attachment's socket: the object it hangs under on its bone. */\ntype BoneSocket = {\n bone: THREE.Object3D;\n socket: THREE.Object3D;\n /** The parent's model root it was resolved in (a reload re-resolves). */\n modelUuid: string;\n /** bone|humanoid|compensateScale it was resolved for. */\n key: string;\n};\n\nconst _boneScale = new THREE.Vector3();\nconst _anchorScale = new THREE.Vector3();\n\nexport type CreateContext = {\n world: World;\n scene: THREE.Scene;\n camera: THREE.PerspectiveCamera;\n payload: CreatePayload;\n isEditor?: boolean;\n};\n\nexport type EntityFactory = (context: CreateContext) => EntityId;\n\nexport type EcsComponentFactoryKind =\n | \"animation\"\n | \"audio\"\n | \"camera\"\n | \"environment\"\n | \"entityType\"\n | \"image\"\n | \"imageTargetAnchor\"\n | \"imageTarget\"\n | \"light\"\n | \"material\"\n | \"mesh\"\n | \"meshGeometry\"\n | \"model\"\n | \"name\"\n | \"object3DRef\"\n | \"parentId\"\n | \"physics\"\n | \"postprocessing\"\n | \"script\"\n | \"scriptObject\"\n | \"selectable\"\n | \"selectionTransformState\"\n | \"sprite\"\n | \"transform\"\n | \"video\"\n | \"instancedMesh\"\n | \"xrRig\"\n | \"vrTeleportArea\"\n | \"xrHandPose\"\n | \"xrAnchor\"\n | \"boneAttachment\"\n | \"ik\"\n | \"networkIdentity\"\n | \"networkTransform\"\n | \"networkedProps\"\n | \"networkSpawner\"\n | \"uiPanel\"\n | \"uiText\"\n | \"uiButton\"\n | \"uiToggle\"\n | \"uiSlider\"\n | \"xrInteractable\"\n | \"xrInteractor\"\n | \"xrInteractorSide\";\n\nexport type ComponentFactory = (\n world: World,\n entityId: EntityId,\n ...args: any[]\n) => unknown;\n\ntype CreateRequest = {\n kind: EcsEntityKind;\n payload: CreatePayload;\n onCreated?: (entityId: EntityId) => void;\n};\n\nexport function createTransform(input?: TransformData): TransformComponent {\n return new TransformComponent(input);\n}\n\nexport function applyTransform(\n object: THREE.Object3D,\n transform: TransformComponent,\n): void {\n object.position.set(\n transform.position.x,\n transform.position.y,\n transform.position.z,\n );\n object.rotation.set(\n transform.rotation.x,\n transform.rotation.y,\n transform.rotation.z,\n );\n object.scale.set(transform.scale.x, transform.scale.y, transform.scale.z);\n}\n\nexport class ObjectManagementSystem implements EcsSystem {\n private readonly scene: THREE.Scene;\n private readonly camera: THREE.PerspectiveCamera;\n private readonly isEditor: boolean;\n private readonly registry = new Map<EcsEntityKind, EntityFactory>();\n private readonly componentRegistry = new Map<\n EcsComponentFactoryKind,\n ComponentFactory\n >();\n private readonly createQueue: CreateRequest[] = [];\n private readonly boneSockets = new Map<EntityId, BoneSocket>();\n /** Attachments whose bone wasn't found in a given model (skip re-searching every frame). */\n private readonly boneMisses = new Map<EntityId, string>();\n\n constructor(\n scene: THREE.Scene,\n camera: THREE.PerspectiveCamera,\n isEditor = false,\n ) {\n this.scene = scene;\n this.camera = camera;\n this.isEditor = isEditor;\n }\n\n register(kind: EcsEntityKind, factory: EntityFactory): void {\n this.registry.set(kind, factory);\n }\n\n registerComponentFactory(\n kind: EcsComponentFactoryKind,\n factory: ComponentFactory,\n ): void {\n this.componentRegistry.set(kind, factory);\n }\n\n getOrCreateAudioListener(): THREE.AudioListener {\n const existing = this.camera.userData.ecsAudioListener;\n if (existing instanceof THREE.AudioListener) {\n return existing;\n }\n\n const listener = new THREE.AudioListener();\n this.camera.add(listener);\n this.camera.userData.ecsAudioListener = listener;\n return listener;\n }\n\n isEditorMode(): boolean {\n return this.isEditor;\n }\n\n getComponentFactory(kind: EcsComponentFactoryKind): ComponentFactory | null {\n return this.componentRegistry.get(kind) ?? null;\n }\n\n createComponentNow(\n kind: EcsComponentFactoryKind,\n world: World,\n entityId: EntityId,\n ...args: any[]\n ): unknown {\n const factory = this.componentRegistry.get(kind);\n if (!factory) {\n throw new Error(`Unknown component kind: ${kind}`);\n }\n\n return factory(world, entityId, ...args);\n }\n\n requestCreate(\n kind: EcsEntityKind,\n payload: CreatePayload = {},\n onCreated?: (entityId: EntityId) => void,\n ): void {\n this.createQueue.push({ kind, payload, onCreated });\n }\n\n createNow(\n kind: EcsEntityKind,\n world: World,\n payload: CreatePayload = {},\n ): EntityId {\n const factory = this.registry.get(kind);\n if (!factory) {\n throw new Error(`Unknown object kind: ${kind}`);\n }\n\n const entityId = factory({\n world,\n scene: this.scene,\n camera: this.camera,\n payload,\n isEditor: this.isEditor,\n });\n\n const object = world.getComponent(entityId, Object3DRef)?.object;\n if (object) {\n object.userData.ecsKind = kind;\n }\n\n if (payload.parentId !== undefined) {\n world.addComponent(entityId, new ParentId(payload.parentId));\n }\n\n return entityId;\n }\n\n /**\n * Removes an entity from the ECS world and its associated `Object3D` from the\n * THREE.js scene graph.\n *\n * @param world - The world the entity belongs to.\n * @param entityId - The entity to remove.\n * @param dispose - When `true`, traverses the entity's `Object3D` subtree and\n * calls `.dispose()` on every `BufferGeometry` and `Material` found. Pass\n * `true` when the entity will not be reused and you want to free GPU memory\n * immediately (e.g. dynamically spawned objects). Defaults to `false`.\n * @returns `true` if the entity existed and was removed; `false` if the entity\n * was not found.\n *\n * @example\n * ```ts\n * // Remove from scene, keep GPU resources (safe if geometry is shared)\n * objects.deleteEntity(world, entityId);\n *\n * // Remove from scene and free GPU memory (use for one-off spawned objects)\n * objects.deleteEntity(world, entityId, true);\n * ```\n */\n deleteEntity(world: World, entityId: EntityId, dispose = false): boolean {\n if (!world.hasEntity(entityId)) {\n return false;\n }\n\n const object3d = world.getComponent(entityId, Object3DRef)?.object;\n if (object3d?.parent) {\n object3d.parent.remove(object3d);\n }\n\n if (dispose && object3d) {\n object3d.traverse((child) => {\n if (child instanceof THREE.Mesh) {\n // Resources backing shared (cached) model scenes are skipped —\n // other live clones and future spawns reference the same objects.\n if (!child.geometry?.userData?.[SHARED_MODEL_RESOURCE_FLAG]) {\n child.geometry?.dispose();\n }\n const materials = Array.isArray(child.material)\n ? child.material\n : [child.material];\n for (const mat of materials) {\n if (mat && !mat.userData?.[SHARED_MODEL_RESOURCE_FLAG]) {\n mat.dispose();\n }\n }\n }\n });\n }\n\n world.destroyEntity(entityId);\n return true;\n }\n\n setParent(\n world: World,\n entityId: EntityId,\n parentId: EntityId | null,\n options?: {\n preserveWorldTransform?: boolean;\n },\n ): boolean {\n if (!world.hasEntity(entityId)) {\n return false;\n }\n\n if (parentId !== null && !world.hasEntity(parentId)) {\n return false;\n }\n\n if (parentId === entityId) {\n return false;\n }\n\n let ancestor = parentId;\n while (ancestor !== null) {\n if (ancestor === entityId) {\n return false;\n }\n\n ancestor = world.getComponent(ancestor, ParentId)?.value ?? null;\n }\n\n const parentComponent = world.getComponent(entityId, ParentId);\n if (parentComponent) {\n if (parentComponent.value === parentId) {\n return false;\n }\n\n parentComponent.value = parentId;\n } else {\n world.addComponent(entityId, new ParentId(parentId));\n }\n // Moving it to another parent ends a bone attachment (the bone belonged to the old parent).\n if (world.getComponent(entityId, BoneAttachmentComponent)) {\n world.removeComponent(entityId, BoneAttachmentComponent);\n }\n\n const preserveWorldTransform = options?.preserveWorldTransform ?? true;\n if (preserveWorldTransform) {\n const object = world.getComponent(entityId, Object3DRef)?.object;\n const parentObject =\n parentId !== null\n ? world.getComponent(parentId, Object3DRef)?.object ?? null\n : null;\n\n if (object) {\n // Refresh matrixWorld before attach so world-space preservation is accurate.\n this.scene.updateMatrixWorld(true);\n\n if (parentObject && parentObject !== object) {\n parentObject.attach(object);\n } else {\n this.scene.attach(object);\n }\n\n object.updateMatrixWorld(true);\n this.syncTransformComponentFromObject(world, entityId, object);\n }\n }\n\n this.reconcileSceneFromWorld(world);\n return true;\n }\n\n private syncTransformComponentFromObject(\n world: World,\n entityId: EntityId,\n object: THREE.Object3D,\n ): void {\n const transform = world.getComponent(entityId, TransformComponent);\n if (!transform) {\n return;\n }\n\n transform.position.x = object.position.x;\n transform.position.y = object.position.y;\n transform.position.z = object.position.z;\n\n transform.rotation.x = object.rotation.x;\n transform.rotation.y = object.rotation.y;\n transform.rotation.z = object.rotation.z;\n\n transform.scale.x = object.scale.x;\n transform.scale.y = object.scale.y;\n transform.scale.z = object.scale.z;\n }\n\n reconcileSceneFromWorld(world: World): void {\n const worldObjects = new Map<EntityId, THREE.Object3D>();\n const entityIds = world.query(Object3DRef);\n\n for (const entityId of entityIds) {\n const object = world.getComponent(entityId, Object3DRef)?.object;\n if (!object) {\n continue;\n }\n\n worldObjects.set(entityId, object);\n }\n\n for (const child of [...this.scene.children]) {\n const entityId = child.userData?.entityId;\n if (typeof entityId === \"number\" && !world.hasEntity(entityId)) {\n this.scene.remove(child);\n }\n }\n\n for (const entityId of [...this.boneSockets.keys()]) {\n if (!world.hasEntity(entityId)) this.dropBoneSocket(entityId);\n }\n\n for (const [entityId, object] of worldObjects.entries()) {\n const parentEntityId = world.getComponent(entityId, ParentId)?.value;\n const parentObject =\n typeof parentEntityId === \"number\"\n ? worldObjects.get(parentEntityId)\n : undefined;\n // A bone attachment hangs the object under its bone's socket instead.\n const expectedParent =\n this.resolveBoneSocket(world, entityId, typeof parentEntityId === \"number\" ? parentEntityId : null) ??\n parentObject;\n\n if (expectedParent && expectedParent !== object) {\n if (object.parent !== expectedParent) {\n // Reconcile hierarchy from ParentId while keeping Transform as local source of truth.\n expectedParent.add(object);\n object.updateMatrixWorld(true);\n }\n continue;\n }\n\n if (object.parent !== this.scene) {\n // Reconcile hierarchy from ParentId while keeping Transform as local source of truth.\n this.scene.add(object);\n object.updateMatrixWorld(true);\n }\n }\n }\n\n private dropBoneSocket(entityId: EntityId): void {\n const s = this.boneSockets.get(entityId);\n if (!s) return;\n s.socket.removeFromParent();\n this.boneSockets.delete(entityId);\n }\n\n /**\n * The socket an attached entity hangs under, or `null` (not attached, the\n * parent's model not loaded yet, or no such bone — the entity then sits\n * under its parent as an ordinary child).\n */\n private resolveBoneSocket(\n world: World,\n entityId: EntityId,\n parentEntityId: EntityId | null,\n ): THREE.Object3D | null {\n const attachment = world.getComponent(entityId, BoneAttachmentComponent);\n if (!attachment) {\n if (this.boneSockets.has(entityId)) this.dropBoneSocket(entityId);\n this.boneMisses.delete(entityId);\n return null;\n }\n const root =\n attachment.enabled && parentEntityId !== null\n ? world.getComponent(parentEntityId, ModelComponent)?.object ?? null\n : null;\n if (!root) {\n this.dropBoneSocket(entityId);\n return null;\n }\n const key = `${attachment.bone}|${attachment.humanoid ?? \"\"}|${attachment.compensateScale}`;\n const current = this.boneSockets.get(entityId);\n if (current && current.modelUuid === root.uuid && current.key === key && current.socket.parent === current.bone) {\n this.fitSocketScale(world, current, parentEntityId, attachment.compensateScale);\n return current.socket;\n }\n this.dropBoneSocket(entityId);\n const missKey = `${root.uuid}|${key}`;\n if (this.boneMisses.get(entityId) === missKey) return null;\n const bone = findModelBone(root, attachment);\n if (!bone) {\n this.boneMisses.set(entityId, missKey);\n return null;\n }\n this.boneMisses.delete(entityId);\n const socket = new THREE.Object3D();\n socket.name = `socket:${bone.name}`;\n socket.userData[BONE_SOCKET_FLAG] = entityId;\n bone.add(socket);\n const s: BoneSocket = { bone, socket, modelUuid: root.uuid, key };\n this.boneSockets.set(entityId, s);\n this.fitSocketScale(world, s, parentEntityId, attachment.compensateScale);\n return socket;\n }\n\n /**\n * Cancel the rig's own scale between the character and the bone (a\n * centimetre armature under a 0.01 node), so offsets are in the character's\n * units and the object keeps its size; the character entity's own scale\n * still applies, as it does to any child.\n */\n private fitSocketScale(\n world: World,\n s: BoneSocket,\n parentEntityId: EntityId | null,\n compensate: boolean,\n ): void {\n if (!compensate) {\n s.socket.scale.set(1, 1, 1);\n return;\n }\n const anchor =\n parentEntityId !== null ? world.getComponent(parentEntityId, Object3DRef)?.object : null;\n s.bone.updateWorldMatrix(true, false);\n _boneScale.setFromMatrixScale(s.bone.matrixWorld);\n if (anchor) _anchorScale.setFromMatrixScale(anchor.matrixWorld);\n else _anchorScale.set(1, 1, 1);\n const safe = (v: number) => (Math.abs(v) < 1e-9 ? 1 : v);\n s.socket.scale.set(\n _anchorScale.x / safe(_boneScale.x),\n _anchorScale.y / safe(_boneScale.y),\n _anchorScale.z / safe(_boneScale.z),\n );\n }\n\n /**\n * Load a model entity's file again and swap it in (the file was rewritten);\n * the entity, its components and children stay, attachments re-home.\n */\n reloadModel(world: World, entityId: EntityId): boolean {\n return reloadModelEntity(world, entityId, this.isEditor);\n }\n\n /** Reload every model entity whose path `matches` (returns how many). */\n reloadModelsAt(world: World, matches: (path: string) => boolean): number {\n let n = 0;\n for (const id of world.query(ModelComponent)) {\n const path = world.getComponent(id, ModelComponent)?.path ?? \"\";\n if (path && matches(path) && this.reloadModel(world, id)) n++;\n }\n return n;\n }\n\n /** The bones of an entity's loaded model (empty until it loads, or for a model without a skeleton). */\n listModelBones(world: World, entityId: EntityId): ModelBoneInfo[] {\n const root = world.getComponent(entityId, ModelComponent)?.object;\n return root ? listModelBones(root) : [];\n }\n\n /** The socket object an attached entity currently hangs under, if resolved. */\n getBoneSocket(entityId: EntityId): THREE.Object3D | null {\n return this.boneSockets.get(entityId)?.socket ?? null;\n }\n\n /**\n * Fix `entityId` to a bone of `parentEntityId`'s model (making it the\n * parent if it isn't). With `preserveWorldTransform` (default) it stays\n * where it is and its Transform becomes the offset from the bone; without,\n * it snaps onto the bone (zero offset). Returns whether the bone was found\n * (when the model is still loading, the attachment is stored and resolves\n * once it loads, without preserving the pose).\n */\n attachToBone(\n world: World,\n entityId: EntityId,\n parentEntityId: EntityId,\n ref: { bone?: string; humanoid?: string | null },\n options?: { preserveWorldTransform?: boolean; compensateScale?: boolean },\n ): { ok: boolean; resolved: boolean; bone: string | null } {\n if (!world.hasEntity(entityId) || !world.hasEntity(parentEntityId) || entityId === parentEntityId) {\n return { ok: false, resolved: false, bone: null };\n }\n for (let a: EntityId | null = parentEntityId; a !== null; a = world.getComponent(a, ParentId)?.value ?? null) {\n if (a === entityId) return { ok: false, resolved: false, bone: null };\n }\n const object = world.getComponent(entityId, Object3DRef)?.object ?? null;\n this.scene.updateMatrixWorld(true);\n const worldMatrix = object ? object.matrixWorld.clone() : null;\n\n // fill in the other half of the bone reference, so it resolves on another rig too\n const bones = this.listModelBones(world, parentEntityId);\n let bone = ref.bone ?? \"\";\n let humanoid = ref.humanoid ?? null;\n const info = bones.find((b) => (bone ? b.name === bone : b.humanoid === humanoid));\n if (info) {\n bone = info.name;\n humanoid = info.humanoid ?? humanoid;\n }\n\n const parent = world.getComponent(entityId, ParentId);\n if (parent) parent.value = parentEntityId;\n else world.addComponent(entityId, new ParentId(parentEntityId));\n let attachment = world.getComponent(entityId, BoneAttachmentComponent);\n if (!attachment) {\n attachment = new BoneAttachmentComponent();\n world.addComponent(entityId, attachment);\n }\n attachment.bone = bone;\n attachment.humanoid = humanoid;\n attachment.compensateScale = options?.compensateScale ?? true;\n attachment.enabled = true;\n this.boneMisses.delete(entityId);\n\n this.reconcileSceneFromWorld(world);\n const socket = this.getBoneSocket(entityId);\n if (object && socket) {\n if (options?.preserveWorldTransform ?? true) {\n socket.updateWorldMatrix(true, false);\n const local = socket.matrixWorld.clone().invert().multiply(worldMatrix as THREE.Matrix4);\n local.decompose(object.position, object.quaternion, object.scale);\n } else {\n object.position.set(0, 0, 0);\n object.quaternion.identity();\n object.scale.set(1, 1, 1);\n }\n object.updateMatrixWorld(true);\n this.syncTransformComponentFromObject(world, entityId, object);\n }\n return { ok: true, resolved: Boolean(socket), bone: bone || humanoid };\n }\n\n /**\n * Release a bone attachment. The entity stays a child of the character\n * (or moves to the root with `toRoot`), and by default keeps its place in\n * the world.\n */\n detachFromBone(\n world: World,\n entityId: EntityId,\n options?: { preserveWorldTransform?: boolean; toRoot?: boolean },\n ): boolean {\n if (!world.getComponent(entityId, BoneAttachmentComponent)) return false;\n const object = world.getComponent(entityId, Object3DRef)?.object ?? null;\n this.scene.updateMatrixWorld(true);\n const worldMatrix = object ? object.matrixWorld.clone() : null;\n world.removeComponent(entityId, BoneAttachmentComponent);\n this.boneMisses.delete(entityId);\n if (options?.toRoot) {\n const parent = world.getComponent(entityId, ParentId);\n if (parent) parent.value = null;\n }\n const parentId = world.getComponent(entityId, ParentId)?.value ?? null;\n const home = (parentId !== null ? world.getComponent(parentId, Object3DRef)?.object : null) ?? this.scene;\n this.dropBoneSocket(entityId);\n if (object) {\n home.add(object);\n if (worldMatrix && (options?.preserveWorldTransform ?? true)) {\n home.updateWorldMatrix(true, false);\n home.matrixWorld.clone().invert().multiply(worldMatrix).decompose(object.position, object.quaternion, object.scale);\n }\n object.updateMatrixWorld(true);\n this.syncTransformComponentFromObject(world, entityId, object);\n }\n this.reconcileSceneFromWorld(world);\n return true;\n }\n\n update(world: World): void {\n for (const request of this.createQueue.splice(0)) {\n const entityId = this.createNow(request.kind, world, request.payload);\n request.onCreated?.(entityId);\n }\n\n this.reconcileSceneFromWorld(world);\n }\n}\n"]}