@relu-interactives/spatial-ecs 0.2.24 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/{Video-ppAXaKt0.d.cts → Video-AIQYTAAr.d.cts} +15 -3
  2. package/dist/{Video-C1IOat7L.d.ts → Video-DlZ4G9ig.d.ts} +15 -3
  3. package/dist/{chunk-JHCPRVBC.js → chunk-7BPHZWQ6.js} +59 -17
  4. package/dist/chunk-7BPHZWQ6.js.map +1 -0
  5. package/dist/{chunk-CCE5K2TU.js → chunk-7JFSEV7A.js} +18 -13
  6. package/dist/chunk-7JFSEV7A.js.map +1 -0
  7. package/dist/{chunk-52CHDPRQ.js → chunk-AT5SPSPM.js} +4 -4
  8. package/dist/{chunk-52CHDPRQ.js.map → chunk-AT5SPSPM.js.map} +1 -1
  9. package/dist/{chunk-ZXGHKX7N.js → chunk-OWQSESTO.js} +12 -2
  10. package/dist/chunk-OWQSESTO.js.map +1 -0
  11. package/dist/{chunk-WKGCC7YL.js → chunk-PZ4CAALA.js} +3 -3
  12. package/dist/{chunk-WKGCC7YL.js.map → chunk-PZ4CAALA.js.map} +1 -1
  13. package/dist/components/index.cjs +55 -13
  14. package/dist/components/index.cjs.map +1 -1
  15. package/dist/components/index.d.cts +2 -2
  16. package/dist/components/index.d.ts +2 -2
  17. package/dist/components/index.js +1 -1
  18. package/dist/docs/api/Behaviour/classes/Behaviour.md +98 -51
  19. package/dist/docs/api/Component/classes/Component.md +4 -1
  20. package/dist/docs/api/components/classes/AnimationComponent.md +26 -26
  21. package/dist/docs/api/components/classes/AudioComponent.md +19 -19
  22. package/dist/docs/api/components/classes/CameraComponent.md +14 -14
  23. package/dist/docs/api/components/classes/EntityType.md +4 -4
  24. package/dist/docs/api/components/classes/Environment.md +3 -3
  25. package/dist/docs/api/components/classes/ImageComponent.md +7 -7
  26. package/dist/docs/api/components/classes/ImageTarget.md +7 -7
  27. package/dist/docs/api/components/classes/ImageTargetAnchor.md +4 -4
  28. package/dist/docs/api/components/classes/InstanceSlotComponent.md +4 -4
  29. package/dist/docs/api/components/classes/InstancedMeshComponent.md +10 -10
  30. package/dist/docs/api/components/classes/LightComponent.md +6 -6
  31. package/dist/docs/api/components/classes/MaterialComponent.md +57 -11
  32. package/dist/docs/api/components/classes/MeshComponent.md +3 -3
  33. package/dist/docs/api/components/classes/MeshGeometryComponent.md +9 -9
  34. package/dist/docs/api/components/classes/ModelComponent.md +4 -4
  35. package/dist/docs/api/components/classes/Name.md +3 -3
  36. package/dist/docs/api/components/classes/Object3DRef.md +4 -4
  37. package/dist/docs/api/components/classes/ParentId.md +3 -3
  38. package/dist/docs/api/components/classes/PhysicsComponent.md +12 -13
  39. package/dist/docs/api/components/classes/Postprocessing.md +3 -3
  40. package/dist/docs/api/components/classes/PrefabInstance.md +80 -0
  41. package/dist/docs/api/components/classes/PrefabNode.md +54 -0
  42. package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
  43. package/dist/docs/api/components/classes/ScriptObjectComponent.md +55 -0
  44. package/dist/docs/api/components/classes/Selectable.md +3 -3
  45. package/dist/docs/api/components/classes/SelectionTransformState.md +5 -5
  46. package/dist/docs/api/components/classes/SpriteComponent.md +7 -7
  47. package/dist/docs/api/components/classes/TransformComponent.md +12 -12
  48. package/dist/docs/api/components/classes/VideoComponent.md +28 -28
  49. package/dist/docs/api/components/functions/defaultMaterialValue.md +17 -0
  50. package/dist/docs/api/components/functions/normalizePhysicsState.md +1 -1
  51. package/dist/docs/api/components/functions/setPhysicsLiveRef.md +34 -0
  52. package/dist/docs/api/components/index.md +8 -1
  53. package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +9 -9
  54. package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +13 -13
  55. package/dist/docs/api/components/type-aliases/CameraProjection.md +1 -1
  56. package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +1 -1
  57. package/dist/docs/api/components/type-aliases/ColliderShape.md +1 -1
  58. package/dist/docs/api/components/type-aliases/ColliderState.md +20 -20
  59. package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +4 -4
  60. package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +1 -1
  61. package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +8 -8
  62. package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +1 -1
  63. package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +1 -1
  64. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +7 -7
  65. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +1 -1
  66. package/dist/docs/api/components/type-aliases/EnvironmentState.md +5 -5
  67. package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +3 -3
  68. package/dist/docs/api/components/type-aliases/ImageTargetReference.md +7 -7
  69. package/dist/docs/api/components/type-aliases/InstanceTransform.md +13 -13
  70. package/dist/docs/api/components/type-aliases/InstancedMeshKind.md +1 -1
  71. package/dist/docs/api/components/type-aliases/LightValueState.md +11 -11
  72. package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +1 -1
  73. package/dist/docs/api/components/type-aliases/MaterialValueState.md +28 -28
  74. package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +1 -1
  75. package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +7 -7
  76. package/dist/docs/api/components/type-aliases/PhysicsState.md +3 -3
  77. package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +3 -3
  78. package/dist/docs/api/components/type-aliases/PostprocessingState.md +62 -62
  79. package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +3 -3
  80. package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +2 -2
  81. package/dist/docs/api/components/type-aliases/RigidbodyState.md +17 -17
  82. package/dist/docs/api/components/type-aliases/RigidbodyType.md +1 -1
  83. package/dist/docs/api/components/type-aliases/ScriptEntry.md +8 -10
  84. package/dist/docs/api/components/type-aliases/ScriptObjectComponentInput.md +20 -0
  85. package/dist/docs/api/components/type-aliases/ScriptObjectRuntimeState.md +13 -0
  86. package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +1 -1
  87. package/dist/docs/api/components/type-aliases/TransformData.md +4 -4
  88. package/dist/docs/api/components/type-aliases/TransformModeValue.md +1 -1
  89. package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +1 -1
  90. package/dist/docs/api/components/type-aliases/Vec3.md +4 -4
  91. package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +1 -1
  92. package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +1 -1
  93. package/dist/docs/api/components/variables/DEFAULT_INSTANCED_MESH_PARAMETERS.md +1 -1
  94. package/dist/docs/api/components/variables/DEFAULT_INSTANCE_TRANSFORM.md +1 -1
  95. package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +1 -1
  96. package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +1 -1
  97. package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +1 -1
  98. package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +1 -1
  99. package/dist/docs/api/index/classes/AnimationStateMachine.md +16 -16
  100. package/dist/docs/api/index/classes/AnimationStateManager.md +13 -13
  101. package/dist/docs/api/index/classes/AnimationSystem.md +3 -3
  102. package/dist/docs/api/index/classes/AudioSystem.md +4 -4
  103. package/dist/docs/api/index/classes/CameraSyncSystem.md +2 -2
  104. package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +4 -4
  105. package/dist/docs/api/index/classes/InputSystem.md +33 -33
  106. package/dist/docs/api/index/classes/InstancedMeshSystem.md +2 -2
  107. package/dist/docs/api/index/classes/LightSyncSystem.md +2 -2
  108. package/dist/docs/api/index/classes/MaterialSyncSystem.md +3 -3
  109. package/dist/docs/api/index/classes/MeshGeometrySystem.md +2 -2
  110. package/dist/docs/api/index/classes/ObjectManagementSystem.md +14 -14
  111. package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +2 -2
  112. package/dist/docs/api/index/classes/PhysicsSyncSystem.md +4 -4
  113. package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +4 -4
  114. package/dist/docs/api/index/classes/RenderSystem.md +3 -3
  115. package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +5 -5
  116. package/dist/docs/api/index/classes/ScriptObject.md +156 -0
  117. package/dist/docs/api/index/classes/ScriptObjectSystem.md +129 -0
  118. package/dist/docs/api/index/classes/TransformSyncSystem.md +2 -2
  119. package/dist/docs/api/index/classes/VideoSystem.md +4 -4
  120. package/dist/docs/api/index/classes/World.md +183 -86
  121. package/dist/docs/api/index/functions/applyPrefabToSnapshotInstances.md +32 -0
  122. package/dist/docs/api/index/functions/buildComponentValueMaps.md +23 -0
  123. package/dist/docs/api/index/functions/buildNodeKeyMapsFromSnapshot.md +25 -0
  124. package/dist/docs/api/index/functions/buildNodeMapsFromSnapshot.md +23 -0
  125. package/dist/docs/api/index/functions/canonicalizeComponentValue.md +38 -0
  126. package/dist/docs/api/index/functions/clearModelCache.md +26 -0
  127. package/dist/docs/api/index/functions/clearPrefabCache.md +25 -0
  128. package/dist/docs/api/index/functions/collectDiffPaths.md +38 -0
  129. package/dist/docs/api/index/functions/collectDirectPrefabDependencies.md +27 -0
  130. package/dist/docs/api/index/functions/collectEntitySubtree.md +29 -0
  131. package/dist/docs/api/index/functions/collectSnapshotSubtreeIds.md +26 -0
  132. package/dist/docs/api/index/functions/computeInstanceOverrides.md +44 -0
  133. package/dist/docs/api/index/functions/createAnimationComponent.md +1 -1
  134. package/dist/docs/api/index/functions/createAudioComponent.md +1 -1
  135. package/dist/docs/api/index/functions/createCameraComponent.md +1 -1
  136. package/dist/docs/api/index/functions/createEntityTypeComponent.md +2 -2
  137. package/dist/docs/api/index/functions/createEnvironmentComponent.md +1 -1
  138. package/dist/docs/api/index/functions/createImageComponent.md +1 -1
  139. package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +1 -1
  140. package/dist/docs/api/index/functions/createImageTargetComponent.md +1 -1
  141. package/dist/docs/api/index/functions/createInstanceSlotComponent.md +1 -1
  142. package/dist/docs/api/index/functions/createInstancedMeshComponent.md +1 -1
  143. package/dist/docs/api/index/functions/createLightComponent.md +1 -1
  144. package/dist/docs/api/index/functions/createMaterialComponent.md +1 -1
  145. package/dist/docs/api/index/functions/createMeshComponent.md +1 -1
  146. package/dist/docs/api/index/functions/createMeshGeometryComponent.md +1 -1
  147. package/dist/docs/api/index/functions/createModelComponent.md +1 -1
  148. package/dist/docs/api/index/functions/createNameComponent.md +1 -1
  149. package/dist/docs/api/index/functions/createObject3DRefComponent.md +1 -1
  150. package/dist/docs/api/index/functions/createParentIdComponent.md +1 -1
  151. package/dist/docs/api/index/functions/createPhysicsComponent.md +2 -4
  152. package/dist/docs/api/index/functions/createPostprocessingComponent.md +1 -1
  153. package/dist/docs/api/index/functions/createScriptComponent.md +1 -1
  154. package/dist/docs/api/index/functions/createScriptObjectComponent.md +28 -0
  155. package/dist/docs/api/index/functions/createSelectableComponent.md +1 -1
  156. package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +1 -1
  157. package/dist/docs/api/index/functions/createSpriteComponent.md +1 -1
  158. package/dist/docs/api/index/functions/createTransformComponent.md +1 -1
  159. package/dist/docs/api/index/functions/createVideoComponent.md +1 -1
  160. package/dist/docs/api/index/functions/decanonicalizeComponentValue.md +28 -0
  161. package/dist/docs/api/index/functions/despawnPrefab.md +32 -0
  162. package/dist/docs/api/index/functions/encodeOverride.md +28 -0
  163. package/dist/docs/api/index/functions/findSnapshotRootEntityIds.md +25 -0
  164. package/dist/docs/api/index/functions/findTopLevelNestedRegions.md +28 -0
  165. package/dist/docs/api/index/functions/groupOverridePaths.md +25 -0
  166. package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +1 -1
  167. package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +4 -2
  168. package/dist/docs/api/index/functions/indexSnapshotByEntity.md +25 -0
  169. package/dist/docs/api/index/functions/instantiateSubtree.md +32 -0
  170. package/dist/docs/api/index/functions/loadPrefab.md +28 -0
  171. package/dist/docs/api/index/functions/loadSharedGltf.md +29 -0
  172. package/dist/docs/api/index/functions/mergeComponentValue.md +32 -0
  173. package/dist/docs/api/index/functions/parseOverride.md +34 -0
  174. package/dist/docs/api/index/functions/parsePrefabAsset.md +25 -0
  175. package/dist/docs/api/index/functions/prefabFileVersionFor.md +25 -0
  176. package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +1 -1
  177. package/dist/docs/api/index/functions/registerDefaultFactories.md +1 -1
  178. package/dist/docs/api/index/functions/remapSnapshotEntityIds.md +46 -0
  179. package/dist/docs/api/index/functions/resolveDracoDecoderPath.md +17 -0
  180. package/dist/docs/api/index/functions/restoreComponentState.md +34 -0
  181. package/dist/docs/api/index/functions/restorePostCreateComponents.md +36 -0
  182. package/dist/docs/api/index/functions/serializeEntitySubtree.md +35 -0
  183. package/dist/docs/api/index/functions/setDracoDecoderPath.md +30 -0
  184. package/dist/docs/api/index/functions/setPrefabAssetUrlResolver.md +30 -0
  185. package/dist/docs/api/index/functions/spawnPrefab.md +36 -0
  186. package/dist/docs/api/index/index.md +65 -0
  187. package/dist/docs/api/index/interfaces/EcsSystem.md +3 -3
  188. package/dist/docs/api/index/interfaces/StateMachine.md +13 -13
  189. package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +4 -4
  190. package/dist/docs/api/index/type-aliases/ApplyPrefabToSnapshotResult.md +23 -0
  191. package/dist/docs/api/index/type-aliases/ComponentFactory.md +1 -1
  192. package/dist/docs/api/index/type-aliases/ComponentValueMaps.md +69 -0
  193. package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +2 -1
  194. package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +3 -3
  195. package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +4 -4
  196. package/dist/docs/api/index/type-aliases/ExternalRefWarning.md +27 -0
  197. package/dist/docs/api/index/type-aliases/HydrateOptions.md +27 -0
  198. package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +7 -5
  199. package/dist/docs/api/index/type-aliases/InstantiateSubtreeResult.md +23 -0
  200. package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
  201. package/dist/docs/api/index/type-aliases/ModuleLoader.md +25 -0
  202. package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
  203. package/dist/docs/api/index/type-aliases/NestedRegion.md +27 -0
  204. package/dist/docs/api/index/type-aliases/NodeKeyMaps.md +30 -0
  205. package/dist/docs/api/index/type-aliases/NodeMaps.md +25 -0
  206. package/dist/docs/api/index/type-aliases/PrefabAsset.md +32 -0
  207. package/dist/docs/api/index/type-aliases/RemapSnapshotOptions.md +21 -0
  208. package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
  209. package/dist/docs/api/index/type-aliases/SerializeEntitySubtreeResult.md +25 -0
  210. package/dist/docs/api/index/type-aliases/SpawnPrefabOptions.md +27 -0
  211. package/dist/docs/api/index/type-aliases/SpawnPrefabSource.md +19 -0
  212. package/dist/docs/api/index/type-aliases/SubtreeSnapshot.md +43 -0
  213. package/dist/docs/api/index/variables/ADDED_NODE_MARKER_COMPONENT.md +19 -0
  214. package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +1 -1
  215. package/dist/docs/api/index/variables/KeyboardKeys.md +89 -89
  216. package/dist/docs/api/index/variables/NODE_KEY_SEPARATOR.md +13 -0
  217. package/dist/docs/api/index/variables/OVERRIDE_DIFF_EXCLUDED_COMPONENTS.md +15 -0
  218. package/dist/docs/api/index/variables/OVERRIDE_ROOT_EXCLUDED_COMPONENTS.md +16 -0
  219. package/dist/docs/api/index/variables/PREFAB_FILE_VERSION.md +13 -0
  220. package/dist/docs/api/index/variables/PREFAB_FILE_VERSION_NESTED.md +15 -0
  221. package/dist/docs/api/index/variables/SCRIPT_OBJECT_ROOT_FLAG.md +15 -0
  222. package/dist/docs/api/index/variables/SHARED_MODEL_RESOURCE_FLAG.md +17 -0
  223. package/dist/docs/api/typedoc-sidebar.json +1 -1
  224. package/dist/docs/api/types/type-aliases/AssetInput.md +3 -3
  225. package/dist/docs/api/types/type-aliases/CheckboxInput.md +3 -3
  226. package/dist/docs/api/types/type-aliases/ColorInput.md +1 -1
  227. package/dist/docs/api/types/type-aliases/ComponentInput.md +4 -4
  228. package/dist/docs/api/types/type-aliases/ComponentKind.md +2 -1
  229. package/dist/docs/api/types/type-aliases/DropdownInput.md +3 -3
  230. package/dist/docs/api/types/type-aliases/DropdownOption.md +3 -3
  231. package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +1 -1
  232. package/dist/docs/api/types/type-aliases/EcsEntityKind.md +3 -2
  233. package/dist/docs/api/types/type-aliases/EntityId.md +1 -1
  234. package/dist/docs/api/types/type-aliases/EntityInput.md +3 -3
  235. package/dist/docs/api/types/type-aliases/FloatInput.md +1 -1
  236. package/dist/docs/api/types/type-aliases/IntersectionResult.md +3 -3
  237. package/dist/docs/api/types/type-aliases/ParentLookup.md +3 -3
  238. package/dist/docs/api/types/type-aliases/SelectionListener.md +1 -1
  239. package/dist/docs/api/types/type-aliases/SliderInput.md +5 -5
  240. package/dist/docs/api/types/type-aliases/TextInput.md +1 -1
  241. package/dist/docs/api/types/type-aliases/ToggleInput.md +1 -1
  242. package/dist/docs/api/types/type-aliases/Vec3.md +1 -1
  243. package/dist/docs/api/types/type-aliases/Vector2Input.md +3 -3
  244. package/dist/docs/api/types/type-aliases/Vector3Input.md +4 -4
  245. package/dist/docs/api/types/type-aliases/WorldEntityView.md +1 -1
  246. package/dist/docs/guide/components/_sidebar.json +4 -0
  247. package/dist/docs/guide/components/material.md +1 -0
  248. package/dist/docs/guide/components/script-object.md +32 -0
  249. package/dist/factories/index.cjs +54 -13
  250. package/dist/factories/index.cjs.map +1 -1
  251. package/dist/factories/index.d.cts +1 -1
  252. package/dist/factories/index.d.ts +1 -1
  253. package/dist/factories/index.js +3 -3
  254. package/dist/{index-DdiWu1b6.d.ts → index-BwiRJNIT.d.ts} +3 -2
  255. package/dist/{index-Cu2Pt7wN.d.cts → index-Gr8aCPRM.d.cts} +3 -2
  256. package/dist/index.cjs +80 -23
  257. package/dist/index.cjs.map +1 -1
  258. package/dist/index.d.cts +3 -3
  259. package/dist/index.d.ts +3 -3
  260. package/dist/index.js +9 -9
  261. package/dist/systems/index.cjs +68 -22
  262. package/dist/systems/index.cjs.map +1 -1
  263. package/dist/systems/index.js +3 -3
  264. package/dist/worldSnapshotUtils.cjs +10 -0
  265. package/dist/worldSnapshotUtils.cjs.map +1 -1
  266. package/dist/worldSnapshotUtils.js +1 -1
  267. package/package.json +4 -4
  268. package/dist/chunk-CCE5K2TU.js.map +0 -1
  269. package/dist/chunk-JHCPRVBC.js.map +0 -1
  270. package/dist/chunk-ZXGHKX7N.js.map +0 -1
@@ -598,12 +598,24 @@ declare function normalizePhysicsState(value: {
598
598
  *
599
599
  * @category Components
600
600
  */
601
+ /**
602
+ * Write a live Rapier ref as a NON-ENUMERABLE own property. Always via
603
+ * defineProperty (mirroring ScriptObjectComponent's `instance` ref): a
604
+ * history-restored clone that dropped the original slot would otherwise get an
605
+ * ENUMERABLE property from plain assignment, leaking Rapier objects — and for
606
+ * trimesh their huge vertex buffers — into snapshot/history/debug walks.
607
+ */
608
+ declare function setPhysicsLiveRef(component: PhysicsComponent, key: "rigidBody" | "collider", value: RapierRigidBody | RapierCollider | null): void;
601
609
  declare class PhysicsComponent extends Component {
602
610
  /** Authoring state. Saved with the project. */
603
611
  values: PhysicsState;
604
- /** Live Rapier rigid body. `null` until physics is initialized. */
612
+ /**
613
+ * Live Rapier rigid body. `null` until physics is initialized.
614
+ * NON-ENUMERABLE — Rapier wrappers (and, for trimesh, their vertex buffers)
615
+ * must never leak into snapshots/history/debug walks.
616
+ */
605
617
  rigidBody: RapierRigidBody | null;
606
- /** Live Rapier collider. `null` until physics is initialized. */
618
+ /** Live Rapier collider. `null` until physics is initialized. NON-ENUMERABLE. */
607
619
  collider: RapierCollider | null;
608
620
  constructor(values?: {
609
621
  rigidbody?: Partial<RigidbodyState>;
@@ -1156,4 +1168,4 @@ declare class VideoComponent extends Component {
1156
1168
  stop(): void;
1157
1169
  }
1158
1170
 
1159
- export { SpriteComponent as $, AnimationComponent as A, MeshGeometryComponent as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, type MeshGeometryParameters as F, type MeshGeometryParametersByKind as G, ModelComponent as H, ImageComponent as I, type PhysicsState as J, type PlaneMeshParameters as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type RadiusMeshParameters as Q, type RadiusHeightMeshParameters as R, type RigidbodyState as S, type RigidbodyType as T, ScriptComponent as U, type ScriptEntry as V, ScriptObjectComponent as W, type ScriptObjectComponentInput as X, type ScriptObjectRuntimeState as Y, Selectable as Z, SelectionTransformState as _, type AnimationComponentOptions as a, type TextureFilteringValue as a0, type TransformModeValue as a1, type TransformSpaceValue as a2, VideoComponent as a3, defaultMaterialValue as a4, normalizePhysicsState as a5, type AnimationStateCallbacks as a6, AnimationStateMachine as a7, AnimationStateManager as a8, type StateMachine as a9, AudioComponent as b, type CameraComponentOptions as c, type CameraProjection as d, type CameraRuntimeType as e, type ColliderShape as f, type ColliderState as g, type CubeMeshParameters as h, DEFAULT_INSTANCED_MESH_PARAMETERS as i, DEFAULT_INSTANCE_TRANSFORM as j, DEFAULT_MESH_GEOMETRY_PARAMETERS as k, DEFAULT_PHYSICS_STATE as l, DEFAULT_RIGIDBODY_STATE as m, EntityType as n, ImageTarget as o, ImageTargetAnchor as p, type ImageTargetAnchorOptions as q, type ImageTargetReference as r, InstanceSlotComponent as s, type InstanceTransform as t, InstancedMeshComponent as u, type InstancedMeshKind as v, type LightValueState as w, type MaterialTypeValue as x, type MaterialValueState as y, MeshComponent as z };
1171
+ export { SpriteComponent as $, AnimationComponent as A, MeshGeometryComponent as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, type MeshGeometryParameters as F, type MeshGeometryParametersByKind as G, ModelComponent as H, ImageComponent as I, type PhysicsState as J, type PlaneMeshParameters as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type RadiusMeshParameters as Q, type RadiusHeightMeshParameters as R, type RigidbodyState as S, type RigidbodyType as T, ScriptComponent as U, type ScriptEntry as V, ScriptObjectComponent as W, type ScriptObjectComponentInput as X, type ScriptObjectRuntimeState as Y, Selectable as Z, SelectionTransformState as _, type AnimationComponentOptions as a, type TextureFilteringValue as a0, type TransformModeValue as a1, type TransformSpaceValue as a2, VideoComponent as a3, defaultMaterialValue as a4, normalizePhysicsState as a5, setPhysicsLiveRef as a6, type AnimationStateCallbacks as a7, AnimationStateMachine as a8, AnimationStateManager as a9, type StateMachine as aa, AudioComponent as b, type CameraComponentOptions as c, type CameraProjection as d, type CameraRuntimeType as e, type ColliderShape as f, type ColliderState as g, type CubeMeshParameters as h, DEFAULT_INSTANCED_MESH_PARAMETERS as i, DEFAULT_INSTANCE_TRANSFORM as j, DEFAULT_MESH_GEOMETRY_PARAMETERS as k, DEFAULT_PHYSICS_STATE as l, DEFAULT_RIGIDBODY_STATE as m, EntityType as n, ImageTarget as o, ImageTargetAnchor as p, type ImageTargetAnchorOptions as q, type ImageTargetReference as r, InstanceSlotComponent as s, type InstanceTransform as t, InstancedMeshComponent as u, type InstancedMeshKind as v, type LightValueState as w, type MaterialTypeValue as x, type MaterialValueState as y, MeshComponent as z };
@@ -598,12 +598,24 @@ declare function normalizePhysicsState(value: {
598
598
  *
599
599
  * @category Components
600
600
  */
601
+ /**
602
+ * Write a live Rapier ref as a NON-ENUMERABLE own property. Always via
603
+ * defineProperty (mirroring ScriptObjectComponent's `instance` ref): a
604
+ * history-restored clone that dropped the original slot would otherwise get an
605
+ * ENUMERABLE property from plain assignment, leaking Rapier objects — and for
606
+ * trimesh their huge vertex buffers — into snapshot/history/debug walks.
607
+ */
608
+ declare function setPhysicsLiveRef(component: PhysicsComponent, key: "rigidBody" | "collider", value: RapierRigidBody | RapierCollider | null): void;
601
609
  declare class PhysicsComponent extends Component {
602
610
  /** Authoring state. Saved with the project. */
603
611
  values: PhysicsState;
604
- /** Live Rapier rigid body. `null` until physics is initialized. */
612
+ /**
613
+ * Live Rapier rigid body. `null` until physics is initialized.
614
+ * NON-ENUMERABLE — Rapier wrappers (and, for trimesh, their vertex buffers)
615
+ * must never leak into snapshots/history/debug walks.
616
+ */
605
617
  rigidBody: RapierRigidBody | null;
606
- /** Live Rapier collider. `null` until physics is initialized. */
618
+ /** Live Rapier collider. `null` until physics is initialized. NON-ENUMERABLE. */
607
619
  collider: RapierCollider | null;
608
620
  constructor(values?: {
609
621
  rigidbody?: Partial<RigidbodyState>;
@@ -1156,4 +1168,4 @@ declare class VideoComponent extends Component {
1156
1168
  stop(): void;
1157
1169
  }
1158
1170
 
1159
- export { SpriteComponent as $, AnimationComponent as A, MeshGeometryComponent as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, type MeshGeometryParameters as F, type MeshGeometryParametersByKind as G, ModelComponent as H, ImageComponent as I, type PhysicsState as J, type PlaneMeshParameters as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type RadiusMeshParameters as Q, type RadiusHeightMeshParameters as R, type RigidbodyState as S, type RigidbodyType as T, ScriptComponent as U, type ScriptEntry as V, ScriptObjectComponent as W, type ScriptObjectComponentInput as X, type ScriptObjectRuntimeState as Y, Selectable as Z, SelectionTransformState as _, type AnimationComponentOptions as a, type TextureFilteringValue as a0, type TransformModeValue as a1, type TransformSpaceValue as a2, VideoComponent as a3, defaultMaterialValue as a4, normalizePhysicsState as a5, type AnimationStateCallbacks as a6, AnimationStateMachine as a7, AnimationStateManager as a8, type StateMachine as a9, AudioComponent as b, type CameraComponentOptions as c, type CameraProjection as d, type CameraRuntimeType as e, type ColliderShape as f, type ColliderState as g, type CubeMeshParameters as h, DEFAULT_INSTANCED_MESH_PARAMETERS as i, DEFAULT_INSTANCE_TRANSFORM as j, DEFAULT_MESH_GEOMETRY_PARAMETERS as k, DEFAULT_PHYSICS_STATE as l, DEFAULT_RIGIDBODY_STATE as m, EntityType as n, ImageTarget as o, ImageTargetAnchor as p, type ImageTargetAnchorOptions as q, type ImageTargetReference as r, InstanceSlotComponent as s, type InstanceTransform as t, InstancedMeshComponent as u, type InstancedMeshKind as v, type LightValueState as w, type MaterialTypeValue as x, type MaterialValueState as y, MeshComponent as z };
1171
+ export { SpriteComponent as $, AnimationComponent as A, MeshGeometryComponent as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, type MeshGeometryParameters as F, type MeshGeometryParametersByKind as G, ModelComponent as H, ImageComponent as I, type PhysicsState as J, type PlaneMeshParameters as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type RadiusMeshParameters as Q, type RadiusHeightMeshParameters as R, type RigidbodyState as S, type RigidbodyType as T, ScriptComponent as U, type ScriptEntry as V, ScriptObjectComponent as W, type ScriptObjectComponentInput as X, type ScriptObjectRuntimeState as Y, Selectable as Z, SelectionTransformState as _, type AnimationComponentOptions as a, type TextureFilteringValue as a0, type TransformModeValue as a1, type TransformSpaceValue as a2, VideoComponent as a3, defaultMaterialValue as a4, normalizePhysicsState as a5, setPhysicsLiveRef as a6, type AnimationStateCallbacks as a7, AnimationStateMachine as a8, AnimationStateManager as a9, type StateMachine as aa, AudioComponent as b, type CameraComponentOptions as c, type CameraProjection as d, type CameraRuntimeType as e, type ColliderShape as f, type ColliderState as g, type CubeMeshParameters as h, DEFAULT_INSTANCED_MESH_PARAMETERS as i, DEFAULT_INSTANCE_TRANSFORM as j, DEFAULT_MESH_GEOMETRY_PARAMETERS as k, DEFAULT_PHYSICS_STATE as l, DEFAULT_RIGIDBODY_STATE as m, EntityType as n, ImageTarget as o, ImageTargetAnchor as p, type ImageTargetAnchorOptions as q, type ImageTargetReference as r, InstanceSlotComponent as s, type InstanceTransform as t, InstancedMeshComponent as u, type InstancedMeshKind as v, type LightValueState as w, type MaterialTypeValue as x, type MaterialValueState as y, MeshComponent as z };
@@ -43,7 +43,8 @@ __export(components_exports, {
43
43
  TransformComponent: () => TransformComponent,
44
44
  VideoComponent: () => VideoComponent,
45
45
  defaultMaterialValue: () => defaultMaterialValue,
46
- normalizePhysicsState: () => normalizePhysicsState
46
+ normalizePhysicsState: () => normalizePhysicsState,
47
+ setPhysicsLiveRef: () => setPhysicsLiveRef
47
48
  });
48
49
 
49
50
  // core/AnimationStateMachine.ts
@@ -1288,12 +1289,21 @@ function normalizePhysicsState(value) {
1288
1289
  };
1289
1290
  }
1290
1291
  __name(normalizePhysicsState, "normalizePhysicsState");
1292
+ function setPhysicsLiveRef(component, key, value) {
1293
+ Object.defineProperty(component, key, {
1294
+ value,
1295
+ writable: true,
1296
+ configurable: true,
1297
+ enumerable: false
1298
+ });
1299
+ }
1300
+ __name(setPhysicsLiveRef, "setPhysicsLiveRef");
1291
1301
  var _PhysicsComponent = class _PhysicsComponent extends Component {
1292
1302
  constructor(values) {
1293
1303
  super();
1294
1304
  this.values = normalizePhysicsState(values);
1295
- this.rigidBody = null;
1296
- this.collider = null;
1305
+ setPhysicsLiveRef(this, "rigidBody", null);
1306
+ setPhysicsLiveRef(this, "collider", null);
1297
1307
  }
1298
1308
  /**
1299
1309
  * Patch rigidbody and/or collider state. Each sub-object is deep-merged
@@ -1423,6 +1433,22 @@ function getMaterialType(material) {
1423
1433
  return "standard";
1424
1434
  }
1425
1435
  __name(getMaterialType, "getMaterialType");
1436
+ function textureImageSrc(texture) {
1437
+ const src = texture?.image?.src;
1438
+ return typeof src === "string" ? src : void 0;
1439
+ }
1440
+ __name(textureImageSrc, "textureImageSrc");
1441
+ function textureSourceUrl(texture) {
1442
+ if (!texture?.image) {
1443
+ return void 0;
1444
+ }
1445
+ const currentSrc = texture.source?.data?.currentSrc;
1446
+ if (typeof currentSrc === "string" && currentSrc) {
1447
+ return currentSrc;
1448
+ }
1449
+ return textureImageSrc(texture);
1450
+ }
1451
+ __name(textureSourceUrl, "textureSourceUrl");
1426
1452
  function createMaterialValue(material) {
1427
1453
  const materialRecord = material;
1428
1454
  const normalScale = materialRecord.normalScale;
@@ -1442,17 +1468,33 @@ function createMaterialValue(material) {
1442
1468
  depthWrite: materialRecord.depthWrite !== false,
1443
1469
  wireframe: Boolean(materialRecord.wireframe),
1444
1470
  transparent: Boolean(materialRecord.transparent),
1445
- textureMap: map?.image ? map.source?.data?.currentSrc || map.image?.src : void 0,
1446
- alphaTextureMap: materialRecord.alphaMap?.image?.src,
1447
- normalMap: materialRecord.normalMap?.image?.src,
1448
- roughnessMap: materialRecord.roughnessMap?.image?.src,
1449
- metalnessMap: materialRecord.metalnessMap?.image?.src,
1450
- aoMap: materialRecord.aoMap?.image?.src,
1451
- emissiveMap: materialRecord.emissiveMap?.image?.src,
1452
- bumpMap: materialRecord.bumpMap?.image?.src,
1453
- displacementMap: materialRecord.displacementMap?.image?.src,
1454
- lightMap: materialRecord.lightMap?.image?.src,
1455
- envMap: materialRecord.envMap?.image?.src,
1471
+ textureMap: textureSourceUrl(map),
1472
+ alphaTextureMap: textureImageSrc(
1473
+ materialRecord.alphaMap
1474
+ ),
1475
+ normalMap: textureImageSrc(
1476
+ materialRecord.normalMap
1477
+ ),
1478
+ roughnessMap: textureImageSrc(
1479
+ materialRecord.roughnessMap
1480
+ ),
1481
+ metalnessMap: textureImageSrc(
1482
+ materialRecord.metalnessMap
1483
+ ),
1484
+ aoMap: textureImageSrc(materialRecord.aoMap),
1485
+ emissiveMap: textureImageSrc(
1486
+ materialRecord.emissiveMap
1487
+ ),
1488
+ bumpMap: textureImageSrc(
1489
+ materialRecord.bumpMap
1490
+ ),
1491
+ displacementMap: textureImageSrc(
1492
+ materialRecord.displacementMap
1493
+ ),
1494
+ lightMap: textureImageSrc(
1495
+ materialRecord.lightMap
1496
+ ),
1497
+ envMap: textureImageSrc(materialRecord.envMap),
1456
1498
  textureFiltering: map?.magFilter === THREE5.NearestFilter ? "sharp" : "smooth",
1457
1499
  useMipmaps: map?.generateMipmaps !== false
1458
1500
  };
@@ -1869,6 +1911,6 @@ var _VideoComponent = class _VideoComponent extends Component {
1869
1911
  __name(_VideoComponent, "VideoComponent");
1870
1912
  var VideoComponent = _VideoComponent;
1871
1913
 
1872
- export { AnimationComponent, AnimationStateMachine, AnimationStateManager, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, InstanceSlotComponent, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, PrefabInstance, PrefabNode, ScriptComponent, ScriptObjectComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, components_exports, defaultMaterialValue, normalizePhysicsState };
1873
- //# sourceMappingURL=chunk-JHCPRVBC.js.map
1874
- //# sourceMappingURL=chunk-JHCPRVBC.js.map
1914
+ export { AnimationComponent, AnimationStateMachine, AnimationStateManager, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, InstanceSlotComponent, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, PrefabInstance, PrefabNode, ScriptComponent, ScriptObjectComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, components_exports, defaultMaterialValue, normalizePhysicsState, setPhysicsLiveRef };
1915
+ //# sourceMappingURL=chunk-7BPHZWQ6.js.map
1916
+ //# sourceMappingURL=chunk-7BPHZWQ6.js.map