@needle-tools/engine 4.12.5 → 4.13.0-next.1eca7a7
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.
- package/CHANGELOG.md +5 -0
- package/README.md +38 -1
- package/components.needle.json +1 -1
- package/custom-elements.json +156 -5
- package/dist/{gltf-progressive-BqUnxvCx.umd.cjs → gltf-progressive-BURrJW0U.umd.cjs} +1 -1
- package/dist/{gltf-progressive-CSaX5HQb.min.js → gltf-progressive-DHLDFNvQ.min.js} +1 -1
- package/dist/{gltf-progressive-ChnIhDXx.js → gltf-progressive-eiJCrjLb.js} +3 -3
- package/dist/materialx-B9ddsHcF.min.js +90 -0
- package/dist/materialx-BF23AVE8.umd.cjs +90 -0
- package/dist/materialx-fkoFuRh3.js +4636 -0
- package/dist/{needle-engine.bundle-Cnemui9H.umd.cjs → needle-engine.bundle-BfrDWglE.umd.cjs} +124 -124
- package/dist/{needle-engine.bundle-B_IGIr6Z.min.js → needle-engine.bundle-Bx_Lq_3v.min.js} +131 -131
- package/dist/{needle-engine.bundle-Cj66livk.js → needle-engine.bundle-MQyZGnMF.js} +3754 -3374
- package/dist/needle-engine.d.ts +2791 -309
- package/dist/needle-engine.js +415 -414
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-12-UW7je.min.js → postprocessing-BVNrgYZK.min.js} +1 -1
- package/dist/{postprocessing-B3Hu0Ryi.umd.cjs → postprocessing-CI2TjWpu.umd.cjs} +1 -1
- package/dist/{postprocessing-R535krvT.js → postprocessing-DdM-tz1j.js} +2 -2
- package/dist/{three-BzxwLtUE.umd.cjs → three-BW2s1Yl-.umd.cjs} +25 -25
- package/dist/{three-DMvLgxja.min.js → three-I__hSXzr.min.js} +26 -26
- package/dist/{three-D9pcFbxc.js → three-VvRoMeIN.js} +22 -0
- package/dist/{three-examples-F0MJj0vr.js → three-examples-BhfOE7NG.js} +1 -1
- package/dist/{three-examples-CjSwCv_b.umd.cjs → three-examples-Bpfu6ke_.umd.cjs} +1 -1
- package/dist/{three-examples-CIv2roOA.min.js → three-examples-D8zAE_7t.min.js} +1 -1
- package/dist/{three-mesh-ui-BLnJQzMl.umd.cjs → three-mesh-ui-BU55xDxJ.umd.cjs} +1 -1
- package/dist/{three-mesh-ui-BllgajJz.min.js → three-mesh-ui-C3QbemOV.min.js} +1 -1
- package/dist/{three-mesh-ui-DYyiRn5Y.js → three-mesh-ui-CcMp-FQm.js} +1 -1
- package/dist/{vendor-BIFy-gRe.js → vendor-BiyIZ61v.js} +1 -1
- package/dist/{vendor-BFgQSG2m.umd.cjs → vendor-COVQl0b8.umd.cjs} +1 -1
- package/dist/{vendor-ChgmXMYr.min.js → vendor-DW7zqjuT.min.js} +1 -1
- package/lib/engine/engine_context.d.ts +16 -0
- package/lib/engine/engine_context.js +16 -0
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_gameobject.d.ts +72 -0
- package/lib/engine/engine_gameobject.js +38 -0
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_input.d.ts +80 -4
- package/lib/engine/engine_input.js +78 -2
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_loaders.js +7 -1
- package/lib/engine/engine_loaders.js.map +1 -1
- package/lib/engine/engine_math.d.ts +81 -2
- package/lib/engine/engine_math.js +68 -2
- package/lib/engine/engine_math.js.map +1 -1
- package/lib/engine/engine_modules.d.ts +9 -0
- package/lib/engine/engine_modules.js +25 -0
- package/lib/engine/engine_modules.js.map +1 -1
- package/lib/engine/engine_networking.d.ts +181 -14
- package/lib/engine/engine_networking.js +181 -14
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_networking_auto.d.ts +35 -8
- package/lib/engine/engine_networking_auto.js +35 -8
- package/lib/engine/engine_networking_auto.js.map +1 -1
- package/lib/engine/engine_physics.d.ts +35 -1
- package/lib/engine/engine_physics.js +35 -1
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.d.ts +76 -0
- package/lib/engine/engine_physics_rapier.js +76 -0
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_serialization_decorator.d.ts +28 -2
- package/lib/engine/engine_serialization_decorator.js +28 -2
- package/lib/engine/engine_serialization_decorator.js.map +1 -1
- package/lib/engine/engine_time.d.ts +23 -3
- package/lib/engine/engine_time.js +23 -3
- package/lib/engine/engine_time.js.map +1 -1
- package/lib/engine/engine_util_decorator.d.ts +31 -1
- package/lib/engine/engine_util_decorator.js +31 -1
- package/lib/engine/engine_util_decorator.js.map +1 -1
- package/lib/engine/engine_utils.d.ts +21 -5
- package/lib/engine/engine_utils.js +21 -5
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/engine_utils_format.d.ts +1 -1
- package/lib/engine/engine_utils_format.js +4 -1
- package/lib/engine/engine_utils_format.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_materialx.d.ts +29 -0
- package/lib/engine/extensions/NEEDLE_materialx.js +115 -0
- package/lib/engine/extensions/NEEDLE_materialx.js.map +1 -0
- package/lib/engine/extensions/extensions.js +2 -0
- package/lib/engine/extensions/extensions.js.map +1 -1
- package/lib/engine/extensions/index.d.ts +1 -0
- package/lib/engine/extensions/index.js +1 -0
- package/lib/engine/extensions/index.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +23 -3
- package/lib/engine-components/AlignmentConstraint.js +23 -3
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animation.d.ts +42 -0
- package/lib/engine-components/Animation.js +36 -0
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/Animator.d.ts +37 -4
- package/lib/engine-components/Animator.js +37 -4
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AudioSource.d.ts +32 -10
- package/lib/engine-components/AudioSource.js +32 -10
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/AxesHelper.d.ts +22 -3
- package/lib/engine-components/AxesHelper.js +22 -3
- package/lib/engine-components/AxesHelper.js.map +1 -1
- package/lib/engine-components/BasicIKConstraint.d.ts +27 -4
- package/lib/engine-components/BasicIKConstraint.js +27 -4
- package/lib/engine-components/BasicIKConstraint.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +31 -1
- package/lib/engine-components/Camera.js +31 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CharacterController.d.ts +67 -3
- package/lib/engine-components/CharacterController.js +67 -3
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +69 -12
- package/lib/engine-components/Collider.js +69 -12
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/ContactShadows.d.ts +26 -6
- package/lib/engine-components/ContactShadows.js +46 -8
- package/lib/engine-components/ContactShadows.js.map +1 -1
- package/lib/engine-components/DeleteBox.d.ts +43 -2
- package/lib/engine-components/DeleteBox.js +43 -2
- package/lib/engine-components/DeleteBox.js.map +1 -1
- package/lib/engine-components/DeviceFlag.d.ts +21 -2
- package/lib/engine-components/DeviceFlag.js +21 -2
- package/lib/engine-components/DeviceFlag.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +32 -2
- package/lib/engine-components/DragControls.js +32 -2
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +33 -21
- package/lib/engine-components/DropListener.js +33 -21
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.d.ts +36 -5
- package/lib/engine-components/Duplicatable.js +36 -5
- package/lib/engine-components/Duplicatable.js.map +1 -1
- package/lib/engine-components/EventList.d.ts +38 -10
- package/lib/engine-components/EventList.js +38 -10
- package/lib/engine-components/EventList.js.map +1 -1
- package/lib/engine-components/Fog.d.ts +23 -1
- package/lib/engine-components/Fog.js +23 -1
- package/lib/engine-components/Fog.js.map +1 -1
- package/lib/engine-components/GridHelper.d.ts +18 -2
- package/lib/engine-components/GridHelper.js +18 -2
- package/lib/engine-components/GridHelper.js.map +1 -1
- package/lib/engine-components/GroundProjection.d.ts +24 -2
- package/lib/engine-components/GroundProjection.js +24 -2
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/Interactable.d.ts +17 -2
- package/lib/engine-components/Interactable.js +17 -2
- package/lib/engine-components/Interactable.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +50 -7
- package/lib/engine-components/Joints.js +50 -7
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/LODGroup.d.ts +36 -14
- package/lib/engine-components/LODGroup.js +43 -11
- package/lib/engine-components/LODGroup.js.map +1 -1
- package/lib/engine-components/Light.d.ts +27 -5
- package/lib/engine-components/Light.js +27 -5
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/LookAtConstraint.d.ts +22 -7
- package/lib/engine-components/LookAtConstraint.js +22 -7
- package/lib/engine-components/LookAtConstraint.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +27 -5
- package/lib/engine-components/NeedleMenu.js +27 -5
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/NestedGltf.d.ts +39 -4
- package/lib/engine-components/NestedGltf.js +42 -4
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/OffsetConstraint.d.ts +27 -3
- package/lib/engine-components/OffsetConstraint.js +27 -3
- package/lib/engine-components/OffsetConstraint.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +41 -3
- package/lib/engine-components/OrbitControls.js +41 -3
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +17 -2
- package/lib/engine-components/ReflectionProbe.js +28 -10
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/Renderer.d.ts +34 -0
- package/lib/engine-components/Renderer.js +35 -2
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.d.ts +11 -0
- package/lib/engine-components/SceneSwitcher.js +11 -0
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/ScreenCapture.d.ts +38 -6
- package/lib/engine-components/ScreenCapture.js +38 -6
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/Skybox.js +1 -1
- package/lib/engine-components/Skybox.js.map +1 -1
- package/lib/engine-components/SmoothFollow.d.ts +66 -7
- package/lib/engine-components/SmoothFollow.js +66 -7
- package/lib/engine-components/SmoothFollow.js.map +1 -1
- package/lib/engine-components/SpatialTrigger.d.ts +48 -1
- package/lib/engine-components/SpatialTrigger.js +48 -1
- package/lib/engine-components/SpatialTrigger.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +21 -3
- package/lib/engine-components/SpectatorCamera.js +21 -3
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SyncedRoom.d.ts +6 -0
- package/lib/engine-components/SyncedRoom.js +6 -0
- package/lib/engine-components/SyncedRoom.js.map +1 -1
- package/lib/engine-components/SyncedTransform.d.ts +55 -6
- package/lib/engine-components/SyncedTransform.js +55 -6
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/TransformGizmo.d.ts +30 -3
- package/lib/engine-components/TransformGizmo.js +30 -3
- package/lib/engine-components/TransformGizmo.js.map +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +33 -6
- package/lib/engine-components/VideoPlayer.js +45 -6
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/Voip.d.ts +33 -2
- package/lib/engine-components/Voip.js +33 -2
- package/lib/engine-components/Voip.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +47 -13
- package/lib/engine-components/export/usdz/USDZExporter.js +47 -13
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.d.ts +82 -3
- package/lib/engine-components/particlesystem/ParticleSystem.js +82 -3
- package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
- package/lib/engine-components/timeline/PlayableDirector.d.ts +99 -14
- package/lib/engine-components/timeline/PlayableDirector.js +91 -25
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/ui/Button.d.ts +29 -3
- package/lib/engine-components/ui/Button.js +29 -3
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +28 -3
- package/lib/engine-components/ui/Canvas.js +28 -3
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/Image.d.ts +22 -3
- package/lib/engine-components/ui/Image.js +22 -3
- package/lib/engine-components/ui/Image.js.map +1 -1
- package/lib/engine-components/ui/Raycaster.d.ts +55 -6
- package/lib/engine-components/ui/Raycaster.js +55 -6
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +23 -1
- package/lib/engine-components/ui/Text.js +23 -1
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/webxr/TeleportTarget.d.ts +21 -2
- package/lib/engine-components/webxr/TeleportTarget.js +21 -2
- package/lib/engine-components/webxr/TeleportTarget.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +10 -2
- package/lib/engine-components/webxr/WebXR.js +10 -2
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/lib/engine-components/webxr/WebXRAvatar.d.ts +39 -2
- package/lib/engine-components/webxr/WebXRAvatar.js +35 -3
- package/lib/engine-components/webxr/WebXRAvatar.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.d.ts +266 -30
- package/lib/engine-components/webxr/WebXRImageTracking.js +266 -30
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/lib/engine-components/webxr/XRFlag.d.ts +29 -2
- package/lib/engine-components/webxr/XRFlag.js +29 -2
- package/lib/engine-components/webxr/XRFlag.js.map +1 -1
- package/package.json +3 -2
- package/plugins/vite/custom-element-data.js +128 -19
- package/plugins/vite/dependencies.js +9 -4
- package/plugins/vite/index.js +0 -2
- package/src/engine/engine_context.ts +16 -0
- package/src/engine/engine_gameobject.ts +73 -0
- package/src/engine/engine_input.ts +83 -7
- package/src/engine/engine_loaders.ts +9 -2
- package/src/engine/engine_math.ts +81 -2
- package/src/engine/engine_modules.ts +24 -0
- package/src/engine/engine_networking.ts +187 -17
- package/src/engine/engine_networking_auto.ts +36 -9
- package/src/engine/engine_physics.ts +37 -1
- package/src/engine/engine_physics_rapier.ts +77 -0
- package/src/engine/engine_serialization_decorator.ts +28 -2
- package/src/engine/engine_time.ts +23 -3
- package/src/engine/engine_util_decorator.ts +31 -1
- package/src/engine/engine_utils.ts +21 -5
- package/src/engine/engine_utils_format.ts +6 -2
- package/src/engine/extensions/NEEDLE_materialx.ts +143 -0
- package/src/engine/extensions/extensions.ts +2 -0
- package/src/engine/extensions/index.ts +1 -0
- package/src/engine-components/AlignmentConstraint.ts +24 -4
- package/src/engine-components/Animation.ts +44 -2
- package/src/engine-components/Animator.ts +40 -7
- package/src/engine-components/AudioSource.ts +37 -15
- package/src/engine-components/AxesHelper.ts +23 -4
- package/src/engine-components/BasicIKConstraint.ts +28 -5
- package/src/engine-components/Camera.ts +33 -3
- package/src/engine-components/CharacterController.ts +73 -6
- package/src/engine-components/Collider.ts +78 -21
- package/src/engine-components/ContactShadows.ts +51 -11
- package/src/engine-components/DeleteBox.ts +43 -2
- package/src/engine-components/DeviceFlag.ts +22 -3
- package/src/engine-components/DragControls.ts +32 -2
- package/src/engine-components/DropListener.ts +42 -29
- package/src/engine-components/Duplicatable.ts +37 -6
- package/src/engine-components/EventList.ts +41 -13
- package/src/engine-components/Fog.ts +23 -1
- package/src/engine-components/GridHelper.ts +18 -2
- package/src/engine-components/GroundProjection.ts +25 -3
- package/src/engine-components/Interactable.ts +17 -2
- package/src/engine-components/Joints.ts +51 -8
- package/src/engine-components/LODGroup.ts +45 -11
- package/src/engine-components/Light.ts +30 -8
- package/src/engine-components/LookAtConstraint.ts +26 -8
- package/src/engine-components/NeedleMenu.ts +29 -7
- package/src/engine-components/NestedGltf.ts +40 -4
- package/src/engine-components/OffsetConstraint.ts +27 -3
- package/src/engine-components/OrbitControls.ts +41 -3
- package/src/engine-components/ReflectionProbe.ts +31 -13
- package/src/engine-components/Renderer.ts +34 -1
- package/src/engine-components/SceneSwitcher.ts +11 -0
- package/src/engine-components/ScreenCapture.ts +41 -9
- package/src/engine-components/Skybox.ts +1 -1
- package/src/engine-components/SmoothFollow.ts +69 -7
- package/src/engine-components/SpatialTrigger.ts +51 -4
- package/src/engine-components/SpectatorCamera.ts +23 -5
- package/src/engine-components/SyncedRoom.ts +6 -0
- package/src/engine-components/SyncedTransform.ts +59 -10
- package/src/engine-components/TransformGizmo.ts +31 -4
- package/src/engine-components/VideoPlayer.ts +48 -6
- package/src/engine-components/Voip.ts +33 -2
- package/src/engine-components/export/usdz/USDZExporter.ts +47 -13
- package/src/engine-components/particlesystem/ParticleSystem.ts +84 -5
- package/src/engine-components/timeline/PlayableDirector.ts +104 -27
- package/src/engine-components/ui/Button.ts +29 -3
- package/src/engine-components/ui/Canvas.ts +28 -3
- package/src/engine-components/ui/Image.ts +22 -3
- package/src/engine-components/ui/Raycaster.ts +57 -8
- package/src/engine-components/ui/Text.ts +24 -2
- package/src/engine-components/webxr/TeleportTarget.ts +23 -4
- package/src/engine-components/webxr/WebXR.ts +11 -3
- package/src/engine-components/webxr/WebXRAvatar.ts +41 -4
- package/src/engine-components/webxr/WebXRImageTracking.ts +282 -38
- package/src/engine-components/webxr/XRFlag.ts +30 -3
- package/plugins/vite/materialx.js +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine_math.js","sourceRoot":"","sources":["../../src/engine/engine_math.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"engine_math.js","sourceRoot":"","sources":["../../src/engine/engine_math.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU;IAiBZ,MAAM,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EAAE,IAAI,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG;QAChE,IAAI,CAAC,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,KAAW,EAAE,MAAY,EAAE,OAAsB,IAAI;QACxD,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACxC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACxC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,KAAK,CAAC,KAAY;QACd,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;CACJ"}
|
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
* If a module is already loaded it's also available in the `MODULE` variable.
|
|
7
7
|
*/
|
|
8
8
|
export declare namespace MODULES {
|
|
9
|
+
namespace MaterialX {
|
|
10
|
+
type TYPE = typeof import("@needle-tools/materialx");
|
|
11
|
+
let MODULE: TYPE;
|
|
12
|
+
let MAYBEMODULE: TYPE | null;
|
|
13
|
+
/** Wait for the module to be loaded (doesn't trigger a load) */
|
|
14
|
+
function ready(): Promise<TYPE>;
|
|
15
|
+
/** Load the module */
|
|
16
|
+
function load(): Promise<TYPE>;
|
|
17
|
+
}
|
|
9
18
|
namespace RAPIER_PHYSICS {
|
|
10
19
|
type TYPE = typeof import("@dimforge/rapier3d-compat");
|
|
11
20
|
let MODULE: TYPE;
|
|
@@ -7,6 +7,31 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export var MODULES;
|
|
9
9
|
(function (MODULES) {
|
|
10
|
+
let MaterialX;
|
|
11
|
+
(function (MaterialX) {
|
|
12
|
+
MaterialX.MAYBEMODULE = null;
|
|
13
|
+
const callbacks = [];
|
|
14
|
+
/** Wait for the module to be loaded (doesn't trigger a load) */
|
|
15
|
+
function ready() {
|
|
16
|
+
if (MaterialX.MODULE)
|
|
17
|
+
return Promise.resolve(MaterialX.MODULE);
|
|
18
|
+
return new Promise((resolve) => { callbacks.push(resolve); });
|
|
19
|
+
}
|
|
20
|
+
MaterialX.ready = ready;
|
|
21
|
+
;
|
|
22
|
+
/** Load the module */
|
|
23
|
+
async function load() {
|
|
24
|
+
if (MaterialX.MODULE)
|
|
25
|
+
return MaterialX.MODULE;
|
|
26
|
+
const module = await import("@needle-tools/materialx");
|
|
27
|
+
MaterialX.MODULE = module;
|
|
28
|
+
MaterialX.MAYBEMODULE = module;
|
|
29
|
+
callbacks.forEach((callback) => callback(module));
|
|
30
|
+
callbacks.length = 0;
|
|
31
|
+
return module;
|
|
32
|
+
}
|
|
33
|
+
MaterialX.load = load;
|
|
34
|
+
})(MaterialX = MODULES.MaterialX || (MODULES.MaterialX = {}));
|
|
10
35
|
let RAPIER_PHYSICS;
|
|
11
36
|
(function (RAPIER_PHYSICS) {
|
|
12
37
|
RAPIER_PHYSICS.MAYBEMODULE = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine_modules.js","sourceRoot":"","sources":["../../src/engine/engine_modules.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,MAAM,KAAW,OAAO,
|
|
1
|
+
{"version":3,"file":"engine_modules.js","sourceRoot":"","sources":["../../src/engine/engine_modules.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,MAAM,KAAW,OAAO,CAmGvB;AAnGD,WAAiB,OAAO;IAEpB,IAAiB,SAAS,CAsBzB;IAtBD,WAAiB,SAAS;QAGX,qBAAW,GAAgB,IAAI,CAAC;QAE3C,MAAM,SAAS,GAAkC,EAAE,CAAC;QACpD,gEAAgE;QAChE,SAAgB,KAAK;YACjB,IAAI,UAAA,MAAM;gBAAE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAA,MAAM,CAAC,CAAC;YAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,CAAC;QAHe,eAAK,QAGpB,CAAA;QAAA,CAAC;QACF,sBAAsB;QACf,KAAK,UAAU,IAAI;YACtB,IAAI,UAAA,MAAM;gBAAE,OAAO,UAAA,MAAM,CAAC;YAC1B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;YACvD,UAAA,MAAM,GAAG,MAAM,CAAC;YAChB,UAAA,WAAW,GAAG,MAAM,CAAC;YACrB,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YAClD,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAClB,CAAC;QARqB,cAAI,OAQzB,CAAA;IAEL,CAAC,EAtBgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAsBzB;IAED,IAAiB,cAAc,CAsB9B;IAtBD,WAAiB,cAAc;QAGhB,0BAAW,GAAgB,IAAI,CAAC;QAE3C,MAAM,SA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AC,CAAC;YAClD,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAClB,CAAC;QARqB,sBAAI,OAQzB,CAAA;IACL,CAAC,EAvBgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAuBjC;AACL,CAAC,EAnGgB,OAAO,KAAP,OAAO,QAmGvB"}
|
|
@@ -74,13 +74,81 @@ export declare enum OwnershipEvent {
|
|
|
74
74
|
}
|
|
75
75
|
type OwnershipEventNamesIncoming = Exclude<`${OwnershipEvent}`, "request-has-owner" | "request-is-owner" | "request-ownership" | "remove-ownership">;
|
|
76
76
|
declare type WebsocketSendType = IModel | object | boolean | null | string | number;
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
77
|
+
/**
|
|
78
|
+
* Manages ownership of networked objects or components.
|
|
79
|
+
*
|
|
80
|
+
* In multiplayer scenarios, ownership determines which client has authority to modify an object.
|
|
81
|
+
* The networking server rejects changes from clients that don't own an object. This prevents conflicts
|
|
82
|
+
* when multiple users try to manipulate the same object simultaneously.
|
|
83
|
+
*
|
|
84
|
+
* **Ownership states:**
|
|
85
|
+
* - `hasOwnership`: This client owns the object and can modify it
|
|
86
|
+
* - `isOwned`: Some client (could be local or remote) owns the object
|
|
87
|
+
* - `undefined`: Ownership state is unknown (not yet queried)
|
|
88
|
+
*
|
|
89
|
+
* **Typical workflow:**
|
|
90
|
+
* 1. Request ownership before modifying an object
|
|
91
|
+
* 2. Make your changes while you have ownership
|
|
92
|
+
* 3. Free ownership when done (or keep it if still interacting)
|
|
93
|
+
*
|
|
94
|
+
* @example Basic usage
|
|
95
|
+
* ```ts
|
|
96
|
+
* export class MyComponent extends Behaviour {
|
|
97
|
+
* private ownership?: OwnershipModel;
|
|
98
|
+
*
|
|
99
|
+
* awake() {
|
|
100
|
+
* this.ownership = new OwnershipModel(this.context.connection, this.guid);
|
|
101
|
+
* }
|
|
102
|
+
*
|
|
103
|
+
* onClick() {
|
|
104
|
+
* // Request ownership before modifying the object
|
|
105
|
+
* this.ownership.requestOwnership();
|
|
106
|
+
* }
|
|
107
|
+
*
|
|
108
|
+
* update() {
|
|
109
|
+
* if (this.ownership.hasOwnership) {
|
|
110
|
+
* // Safe to modify and sync the object
|
|
111
|
+
* this.gameObject.position.y += 0.01;
|
|
112
|
+
* }
|
|
113
|
+
* }
|
|
114
|
+
*
|
|
115
|
+
* onDisable() {
|
|
116
|
+
* // Release ownership when done
|
|
117
|
+
* this.ownership.freeOwnership();
|
|
118
|
+
* this.ownership.destroy();
|
|
119
|
+
* }
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @example Async ownership
|
|
124
|
+
* ```ts
|
|
125
|
+
* async modifyObject() {
|
|
126
|
+
* try {
|
|
127
|
+
* await this.ownership.requestOwnershipAsync();
|
|
128
|
+
* // Now guaranteed to have ownership
|
|
129
|
+
* this.transform.position.x = 5;
|
|
130
|
+
* } catch(e) {
|
|
131
|
+
* console.log("Failed to gain ownership");
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @see {@link SyncedTransform} for a complete example of ownership in action
|
|
137
|
+
* @link https://engine.needle.tools/docs/networking.html
|
|
138
|
+
*/
|
|
79
139
|
export declare class OwnershipModel {
|
|
140
|
+
/** The unique identifier (GUID) of the object this ownership model manages */
|
|
80
141
|
guid: string;
|
|
81
142
|
private connection;
|
|
143
|
+
/**
|
|
144
|
+
* Checks if the local client has ownership of this object.
|
|
145
|
+
* @returns `true` if this client owns the object and can modify it, `false` otherwise
|
|
146
|
+
*/
|
|
82
147
|
get hasOwnership(): boolean;
|
|
83
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Checks if anyone (local or remote client) has ownership of this object.
|
|
150
|
+
* @returns `true` if someone owns the object, `false` if no one owns it, `undefined` if unknown
|
|
151
|
+
*/
|
|
84
152
|
get isOwned(): boolean | undefined;
|
|
85
153
|
/**
|
|
86
154
|
* Checks if Needle Engine networking is connected to a websocket. Note that this is **not equal** to being connected to a *room*. If you want to check if Needle Engine is connected to a networking room use the `isInRoom` property.
|
|
@@ -94,13 +162,50 @@ export declare class OwnershipModel {
|
|
|
94
162
|
private _hasOwnerResponse;
|
|
95
163
|
constructor(connection: NetworkConnection, guid: string);
|
|
96
164
|
private _isWaitingForOwnershipResponseCallback;
|
|
165
|
+
/**
|
|
166
|
+
* Queries the server to update the `isOwned` state.
|
|
167
|
+
* Call this to check if anyone currently has ownership.
|
|
168
|
+
*/
|
|
97
169
|
updateIsOwned(): void;
|
|
98
170
|
private onHasOwnerResponse;
|
|
171
|
+
/**
|
|
172
|
+
* Requests ownership only if the object is not currently owned by anyone.
|
|
173
|
+
* Internally checks ownership state first, then requests ownership if free.
|
|
174
|
+
* @returns this OwnershipModel instance for method chaining
|
|
175
|
+
*/
|
|
99
176
|
requestOwnershipIfNotOwned(): OwnershipModel;
|
|
100
177
|
private waitForHasOwnershipRequestResponse;
|
|
178
|
+
/**
|
|
179
|
+
* Requests ownership and waits asynchronously until ownership is granted or timeout occurs.
|
|
180
|
+
* @returns Promise that resolves with this OwnershipModel when ownership is gained
|
|
181
|
+
* @throws Rejects with "Timeout" if ownership is not gained within ~1 second
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* try {
|
|
185
|
+
* await ownership.requestOwnershipAsync();
|
|
186
|
+
* // Ownership granted, safe to modify object
|
|
187
|
+
* } catch(e) {
|
|
188
|
+
* console.warn("Could not gain ownership:", e);
|
|
189
|
+
* }
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
101
192
|
requestOwnershipAsync(): Promise<OwnershipModel>;
|
|
193
|
+
/**
|
|
194
|
+
* Requests ownership of this object from the networking server.
|
|
195
|
+
* Ownership may not be granted immediately - check `hasOwnership` property or use `requestOwnershipAsync()`.
|
|
196
|
+
* @returns this OwnershipModel instance for method chaining
|
|
197
|
+
*/
|
|
102
198
|
requestOwnership(): OwnershipModel;
|
|
199
|
+
/**
|
|
200
|
+
* Releases ownership of this object, allowing others to take control.
|
|
201
|
+
* Call this when you're done modifying an object to allow other users to interact with it.
|
|
202
|
+
* @returns this OwnershipModel instance for method chaining
|
|
203
|
+
*/
|
|
103
204
|
freeOwnership(): OwnershipModel;
|
|
205
|
+
/**
|
|
206
|
+
* Cleans up event listeners and resources.
|
|
207
|
+
* Call this when the OwnershipModel is no longer needed (e.g., in `onDestroy()`).
|
|
208
|
+
*/
|
|
104
209
|
destroy(): void;
|
|
105
210
|
private onGainedOwnership;
|
|
106
211
|
private onLostOwnership;
|
|
@@ -108,10 +213,46 @@ export declare class OwnershipModel {
|
|
|
108
213
|
export declare type BinaryCallback = {
|
|
109
214
|
(data: any | flatbuffers.ByteBuffer): void;
|
|
110
215
|
};
|
|
111
|
-
/**
|
|
112
|
-
*
|
|
216
|
+
/**
|
|
217
|
+
* Main class for multiuser networking. Access via `this.context.connection` from any component.
|
|
218
|
+
*
|
|
219
|
+
* **About GUIDs:**
|
|
220
|
+
* In Needle Engine networking, GUIDs (Globally Unique Identifiers) are used to identify objects and components across the network.
|
|
221
|
+
* Every GameObject and Component has a unique `guid` property that remains consistent across all clients.
|
|
222
|
+
* GUIDs are automatically assigned (e.g. during export from Unity/Blender) and are essential for:
|
|
223
|
+
* - Object ownership management (see {@link OwnershipModel})
|
|
224
|
+
* - State synchronization (storing and retrieving object state)
|
|
225
|
+
* - Identifying which object received a network message
|
|
226
|
+
*
|
|
227
|
+
* When working with networking, you'll typically use `this.guid` to identify your component or `this.gameObject.guid` for the GameObject.
|
|
113
228
|
*
|
|
114
|
-
|
|
229
|
+
* @example Joining a room
|
|
230
|
+
* ```ts
|
|
231
|
+
* this.context.connection.connect();
|
|
232
|
+
* this.context.connection.joinRoom("my-room");
|
|
233
|
+
* ```
|
|
234
|
+
* @example Listening to events
|
|
235
|
+
* ```ts
|
|
236
|
+
* this.context.connection.beginListen("my-event", (data) => {
|
|
237
|
+
* console.log("Received:", data);
|
|
238
|
+
* });
|
|
239
|
+
* ```
|
|
240
|
+
* @example Sending data
|
|
241
|
+
* ```ts
|
|
242
|
+
* this.context.connection.send("my-event", { message: "Hello" });
|
|
243
|
+
* ```
|
|
244
|
+
* @example Using GUIDs for object identification
|
|
245
|
+
* ```ts
|
|
246
|
+
* // Get state for a specific object by its GUID
|
|
247
|
+
* const state = this.context.connection.tryGetState(this.guid);
|
|
248
|
+
*
|
|
249
|
+
* // Delete remote state for an object
|
|
250
|
+
* this.context.connection.sendDeleteRemoteState(this.guid);
|
|
251
|
+
* ```
|
|
252
|
+
* @see {@link RoomEvents} for room lifecycle events
|
|
253
|
+
* @see {@link OwnershipModel} for object ownership
|
|
254
|
+
* @link https://engine.needle.tools/docs/how-to-guides/networking/
|
|
255
|
+
*/
|
|
115
256
|
export declare class NetworkConnection implements INetworkConnection {
|
|
116
257
|
private context;
|
|
117
258
|
private _peer;
|
|
@@ -119,7 +260,18 @@ export declare class NetworkConnection implements INetworkConnection {
|
|
|
119
260
|
/** Experimental: networking via peerjs */
|
|
120
261
|
get peer(): PeerNetworking;
|
|
121
262
|
/**
|
|
122
|
-
* Returns the state
|
|
263
|
+
* Returns the cached network state for a given GUID.
|
|
264
|
+
* The state is stored locally whenever network updates are received for that object.
|
|
265
|
+
* @param guid The unique identifier of the object whose state you want to retrieve
|
|
266
|
+
* @returns The cached state object, or `null` if no state exists for this GUID
|
|
267
|
+
* @example
|
|
268
|
+
* ```ts
|
|
269
|
+
* // Get the last known state for this component
|
|
270
|
+
* const myState = this.context.connection.tryGetState(this.guid);
|
|
271
|
+
* if (myState) {
|
|
272
|
+
* console.log("Found cached state:", myState);
|
|
273
|
+
* }
|
|
274
|
+
* ```
|
|
123
275
|
*/
|
|
124
276
|
tryGetState(guid: string): IModel | null;
|
|
125
277
|
/** The connection id of the local user - it is given by the networking backend and can not be changed */
|
|
@@ -129,7 +281,7 @@ export declare class NetworkConnection implements INetworkConnection {
|
|
|
129
281
|
*/
|
|
130
282
|
get isDebugEnabled(): boolean;
|
|
131
283
|
/**
|
|
132
|
-
* Checks if Needle Engine networking is connected to a websocket. Note that this is **not equal** to being connected to a *room*. If you want to check if Needle Engine is connected to a networking room use the `isInRoom` property.
|
|
284
|
+
* Checks if Needle Engine networking is connected to a websocket. Note that this is **not equal** to being connected to a *room*. If you want to check if Needle Engine is connected to a networking room use the `{@link isInRoom}` property.
|
|
133
285
|
* @returns true if connected to the websocket.
|
|
134
286
|
*/
|
|
135
287
|
get isConnected(): boolean;
|
|
@@ -162,13 +314,24 @@ export declare class NetworkConnection implements INetworkConnection {
|
|
|
162
314
|
private _usersInRoomCopy;
|
|
163
315
|
/** Returns a list of all user ids in the current room */
|
|
164
316
|
usersInRoom(target?: string[] | null): string[];
|
|
165
|
-
/** Joins a networked room. If you don't want to manage a connection yourself you can use a `SyncedRoom` component as well */
|
|
317
|
+
/** Joins a networked room. If you don't want to manage a connection yourself you can use a `{@link SyncedRoom}` component as well */
|
|
166
318
|
joinRoom(room: string, viewOnly?: boolean): boolean;
|
|
167
319
|
/** Use to leave a room that you are currently connected to (use `leaveRoom()` to disconnect from the currently active room but you can also specify a room name) */
|
|
168
320
|
leaveRoom(room?: string | null): boolean;
|
|
169
321
|
/** Send a message to the networking backend - it will broadcasted to all connected users in the same room by default */
|
|
170
322
|
send<T extends WebsocketSendType>(key: string | OwnershipEvent, data?: T | null, queue?: SendQueue): void;
|
|
171
|
-
/**
|
|
323
|
+
/**
|
|
324
|
+
* Deletes the network state for a specific object on the server.
|
|
325
|
+
* This removes the object's state from the room, preventing it from being sent to newly joining users.
|
|
326
|
+
* @param guid The unique identifier of the object whose state should be deleted
|
|
327
|
+
* @example
|
|
328
|
+
* ```ts
|
|
329
|
+
* // When destroying a networked object, clean up its server state
|
|
330
|
+
* onDestroy() {
|
|
331
|
+
* this.context.connection.sendDeleteRemoteState(this.guid);
|
|
332
|
+
* }
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
172
335
|
sendDeleteRemoteState(guid: string): void;
|
|
173
336
|
/** Use to delete all state in the currently connected room on the server */
|
|
174
337
|
sendDeleteRemoteStateAll(): void;
|
|
@@ -178,7 +341,7 @@ export declare class NetworkConnection implements INetworkConnection {
|
|
|
178
341
|
private _defaultMessagesBufferArray;
|
|
179
342
|
sendBufferedMessagesNow(): void;
|
|
180
343
|
/** Use to start listening to networking events.
|
|
181
|
-
* To unsubscribe from events use the `stopListen` method.
|
|
344
|
+
* To unsubscribe from events use the `{@link stopListen}` method.
|
|
182
345
|
* See the example below for typical usage:
|
|
183
346
|
*
|
|
184
347
|
* ### Component Example
|
|
@@ -203,7 +366,7 @@ export declare class NetworkConnection implements INetworkConnection {
|
|
|
203
366
|
/**@deprecated please use stopListen instead (2.65.2-pre) */
|
|
204
367
|
stopListening(key: (string & {}) | OwnershipEvent | OwnershipEventNamesIncoming | RoomEventsIncoming | RoomEvents, callback: Function | null): void;
|
|
205
368
|
/** Use to stop listening to networking events
|
|
206
|
-
* To subscribe to events use the `beginListen` method.
|
|
369
|
+
* To subscribe to events use the `{@link beginListen}` method.
|
|
207
370
|
* See the example below for typical usage:
|
|
208
371
|
*
|
|
209
372
|
* ### Component Example
|
|
@@ -228,9 +391,13 @@ export declare class NetworkConnection implements INetworkConnection {
|
|
|
228
391
|
/** Use to stop listening to networking binary events */
|
|
229
392
|
stopListenBinary(identifier: string, callback: any): void;
|
|
230
393
|
private netWebSocketUrlProvider?;
|
|
231
|
-
/** Use to override the networking server backend url.
|
|
394
|
+
/** Use to override the networking server backend url.
|
|
395
|
+
* This is what the `{@link Networking}` component uses to modify the backend url.
|
|
396
|
+
**/
|
|
232
397
|
registerProvider(prov: INetworkingWebsocketUrlProvider): void;
|
|
233
|
-
/** Used to connect to the networking server
|
|
398
|
+
/** Used to connect to the networking server
|
|
399
|
+
* @param url Optional url to connect to. If not provided, it will use the url from the registered `INetworkingWebsocketUrlProvider` or the default backend networking url. If you want to change the url after connecting, you need to disconnect first and then connect again with the new url.
|
|
400
|
+
*/
|
|
234
401
|
connect(url?: string): Promise<boolean>;
|
|
235
402
|
/** Disconnect from the networking backend + reset internal state */
|
|
236
403
|
disconnect(): void;
|