@needle-tools/engine 4.11.4 → 4.11.5-next.4201116
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 +8 -0
- package/components.needle.json +1 -1
- package/dist/generateMeshBVH.worker-mO20N_b8.js +21 -0
- package/dist/{gltf-progressive-GwdQV1Qx.umd.cjs → gltf-progressive-DWcmTMCh.umd.cjs} +1 -1
- package/dist/{gltf-progressive-CftVUJy3.min.js → gltf-progressive-DZrY8VT6.min.js} +2 -2
- package/dist/{gltf-progressive-BvlZQAkt.js → gltf-progressive-DgYz5BYa.js} +19 -19
- package/dist/loader.worker-Dip-PthR.js +23 -0
- package/dist/{needle-engine.bundle-BxK1-fWD.umd.cjs → needle-engine.bundle-Cb9DQNr9.umd.cjs} +155 -160
- package/dist/{needle-engine.bundle-DmMrUPFQ.js → needle-engine.bundle-D2l0lwCn.js} +6509 -6332
- package/dist/{needle-engine.bundle-CQdk7IvU.min.js → needle-engine.bundle-DaoW7sFK.min.js} +162 -167
- package/dist/needle-engine.d.ts +18189 -1
- package/dist/needle-engine.js +336 -335
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-CJC0Npcd.js → postprocessing-BTW9pD_s.js} +1822 -1723
- package/dist/{postprocessing-DrM4PWU3.umd.cjs → postprocessing-CMgoN5t5.umd.cjs} +229 -158
- package/dist/{postprocessing-l7zsdO_Q.min.js → postprocessing-DYDtB188.min.js} +227 -156
- package/dist/rapier-B3oL1ap-.js +5217 -0
- package/dist/rapier-DJ-luMxr.min.js +1 -0
- package/dist/rapier-DQltNJbN.umd.cjs +1 -0
- package/dist/{three-BDW9I486.min.js → three-B7CT31Bt.min.js} +1 -5
- package/dist/{three-MHVqtJYj.js → three-DfMvBzXi.js} +0 -5
- package/dist/{three-examples-CgwGHSgz.umd.cjs → three-examples-CsW4_6LI.umd.cjs} +2 -7
- package/dist/{three-examples-fvEPSC8L.min.js → three-examples-D1P7eEhn.min.js} +2 -7
- package/dist/{three-examples-C5Ht-QFN.js → three-examples-D1SK93ek.js} +1 -7
- package/dist/{three-mesh-ui-BjWTTk1R.js → three-mesh-ui-C_uSB5dD.js} +1 -1
- package/dist/{three-mesh-ui-Bm32sS2a.umd.cjs → three-mesh-ui-DpATDXwU.umd.cjs} +1 -1
- package/dist/{three-mesh-ui-CLdkp21K.min.js → three-mesh-ui-LQ44s0AL.min.js} +1 -1
- package/dist/{three-iFaDq9U3.umd.cjs → three-qj71I7J3.umd.cjs} +2 -6
- package/dist/{vendor-CsyK1CFs.min.js → vendor-BKGa4GE0.min.js} +34 -39
- package/dist/{vendor-petGQl0N.js → vendor-D0zoswDa.js} +1626 -1605
- package/dist/{vendor-6kAXU6fm.umd.cjs → vendor-UCpFAwt1.umd.cjs} +30 -35
- package/lib/engine/api.d.ts +1 -1
- package/lib/engine/api.js +1 -1
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/debug/debug_spector.d.ts +16 -0
- package/lib/engine/debug/debug_spector.js +28 -0
- package/lib/engine/debug/debug_spector.js.map +1 -0
- package/lib/engine/engine_addressables.d.ts +74 -11
- package/lib/engine/engine_addressables.js +74 -11
- package/lib/engine/engine_addressables.js.map +1 -1
- package/lib/engine/engine_application.d.ts +7 -0
- package/lib/engine/engine_application.js +8 -1
- package/lib/engine/engine_application.js.map +1 -1
- package/lib/engine/engine_camera.fit.d.ts +48 -3
- package/lib/engine/engine_camera.fit.js +29 -0
- package/lib/engine/engine_camera.fit.js.map +1 -1
- package/lib/engine/engine_context.d.ts +33 -8
- package/lib/engine/engine_context.js +47 -8
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_loaders.d.ts +0 -6
- package/lib/engine/engine_loaders.js +5 -5
- package/lib/engine/engine_loaders.js.map +1 -1
- package/lib/engine/engine_physics.js +6 -2
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.d.ts +11 -2
- package/lib/engine/engine_physics_rapier.js +9 -0
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_scenelighting.d.ts +12 -1
- package/lib/engine/engine_scenelighting.js +21 -1
- package/lib/engine/engine_scenelighting.js.map +1 -1
- package/lib/engine/engine_texture.d.ts +1 -1
- package/lib/engine/engine_tonemapping.d.ts +1 -1
- package/lib/engine/engine_types.d.ts +16 -0
- package/lib/engine/engine_typestore.d.ts +1 -0
- package/lib/engine/engine_typestore.js +5 -6
- package/lib/engine/engine_typestore.js.map +1 -1
- package/lib/engine/engine_utils_qrcode.js +1 -1
- package/lib/engine/engine_utils_qrcode.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_components.d.ts +4 -4
- package/lib/engine/extensions/NEEDLE_components.js +36 -17
- package/lib/engine/extensions/NEEDLE_components.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lightmaps.js +2 -2
- package/lib/engine/extensions/NEEDLE_lightmaps.js.map +1 -1
- package/lib/engine/extensions/extensions.d.ts +2 -2
- package/lib/engine/extensions/extensions.js +11 -5
- package/lib/engine/extensions/extensions.js.map +1 -1
- package/lib/engine/webcomponents/buttons.d.ts +3 -1
- package/lib/engine/webcomponents/buttons.js +3 -1
- package/lib/engine/webcomponents/buttons.js.map +1 -1
- package/lib/engine/webcomponents/logo-element.d.ts +11 -0
- package/lib/engine/webcomponents/logo-element.js +6 -0
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +63 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js +57 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.d.ts +5 -0
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.attributes.d.ts +11 -2
- package/lib/engine/webcomponents/needle-engine.d.ts +162 -8
- package/lib/engine/webcomponents/needle-engine.js +33 -7
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.js +2 -1
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +9 -0
- package/lib/engine-components/AlignmentConstraint.js +9 -0
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animator.d.ts +1 -0
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AudioListener.d.ts +2 -0
- package/lib/engine-components/AudioListener.js +2 -0
- package/lib/engine-components/AudioListener.js.map +1 -1
- package/lib/engine-components/AudioSource.d.ts +1 -0
- package/lib/engine-components/AudioSource.js +1 -0
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/AxesHelper.d.ts +2 -0
- package/lib/engine-components/AxesHelper.js +2 -0
- package/lib/engine-components/AxesHelper.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +1 -0
- package/lib/engine-components/Camera.js +1 -0
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CharacterController.d.ts +4 -1
- package/lib/engine-components/CharacterController.js +4 -1
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Component.d.ts +5 -0
- package/lib/engine-components/Component.js +7 -0
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DeleteBox.d.ts +2 -0
- package/lib/engine-components/DeleteBox.js +2 -0
- package/lib/engine-components/DeleteBox.js.map +1 -1
- package/lib/engine-components/DeviceFlag.d.ts +4 -0
- package/lib/engine-components/DeviceFlag.js +4 -0
- package/lib/engine-components/DeviceFlag.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +1 -0
- package/lib/engine-components/DragControls.js +1 -0
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +1 -0
- package/lib/engine-components/DropListener.js +1 -0
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.d.ts +1 -0
- package/lib/engine-components/Duplicatable.js +1 -0
- package/lib/engine-components/Duplicatable.js.map +1 -1
- package/lib/engine-components/EventTrigger.d.ts +2 -0
- package/lib/engine-components/EventTrigger.js +2 -0
- package/lib/engine-components/EventTrigger.js.map +1 -1
- package/lib/engine-components/GridHelper.d.ts +2 -0
- package/lib/engine-components/GridHelper.js +2 -0
- package/lib/engine-components/GridHelper.js.map +1 -1
- package/lib/engine-components/GroundProjection.d.ts +1 -0
- package/lib/engine-components/GroundProjection.js +1 -0
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/LODGroup.d.ts +2 -0
- package/lib/engine-components/LODGroup.js +2 -0
- package/lib/engine-components/LODGroup.js.map +1 -1
- package/lib/engine-components/Light.d.ts +1 -0
- package/lib/engine-components/Light.js +1 -0
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/LookAtConstraint.d.ts +1 -0
- package/lib/engine-components/LookAtConstraint.js +1 -0
- package/lib/engine-components/LookAtConstraint.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +1 -0
- package/lib/engine-components/NeedleMenu.js +1 -0
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/NestedGltf.d.ts +1 -0
- package/lib/engine-components/NestedGltf.js +1 -0
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/Networking.d.ts +1 -0
- package/lib/engine-components/Networking.js +1 -0
- package/lib/engine-components/Networking.js.map +1 -1
- package/lib/engine-components/OffsetConstraint.d.ts +7 -0
- package/lib/engine-components/OffsetConstraint.js +7 -0
- package/lib/engine-components/OffsetConstraint.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +1 -0
- package/lib/engine-components/OrbitControls.js +1 -0
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/PlayerColor.d.ts +2 -0
- package/lib/engine-components/PlayerColor.js +2 -0
- package/lib/engine-components/PlayerColor.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +1 -0
- package/lib/engine-components/ReflectionProbe.js +17 -10
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/Renderer.js +16 -42
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RendererInstancing.d.ts +5 -3
- package/lib/engine-components/RendererInstancing.js +64 -31
- package/lib/engine-components/RendererInstancing.js.map +1 -1
- package/lib/engine-components/RendererLightmap.d.ts +1 -0
- package/lib/engine-components/RendererLightmap.js +24 -18
- package/lib/engine-components/RendererLightmap.js.map +1 -1
- package/lib/engine-components/RigidBody.d.ts +1 -0
- package/lib/engine-components/RigidBody.js +1 -0
- package/lib/engine-components/RigidBody.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.d.ts +1 -0
- package/lib/engine-components/SceneSwitcher.js +1 -0
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/ScreenCapture.d.ts +1 -0
- package/lib/engine-components/ScreenCapture.js +1 -0
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/SeeThrough.d.ts +1 -0
- package/lib/engine-components/SeeThrough.js +1 -0
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/ShadowCatcher.d.ts +2 -0
- package/lib/engine-components/ShadowCatcher.js +2 -0
- package/lib/engine-components/ShadowCatcher.js.map +1 -1
- package/lib/engine-components/Skybox.d.ts +16 -5
- package/lib/engine-components/Skybox.js +38 -25
- package/lib/engine-components/Skybox.js.map +1 -1
- package/lib/engine-components/SmoothFollow.d.ts +1 -0
- package/lib/engine-components/SmoothFollow.js +1 -0
- package/lib/engine-components/SmoothFollow.js.map +1 -1
- package/lib/engine-components/SpatialTrigger.d.ts +1 -0
- package/lib/engine-components/SpatialTrigger.js +1 -0
- package/lib/engine-components/SpatialTrigger.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +1 -0
- package/lib/engine-components/SpectatorCamera.js +1 -0
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SpriteRenderer.d.ts +1 -0
- package/lib/engine-components/SpriteRenderer.js +1 -0
- package/lib/engine-components/SpriteRenderer.js.map +1 -1
- package/lib/engine-components/SyncedCamera.d.ts +2 -0
- package/lib/engine-components/SyncedCamera.js +2 -0
- package/lib/engine-components/SyncedCamera.js.map +1 -1
- package/lib/engine-components/SyncedRoom.d.ts +1 -0
- package/lib/engine-components/SyncedRoom.js +1 -0
- package/lib/engine-components/SyncedRoom.js.map +1 -1
- package/lib/engine-components/SyncedTransform.d.ts +2 -0
- package/lib/engine-components/SyncedTransform.js +2 -0
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/TransformGizmo.d.ts +2 -0
- package/lib/engine-components/TransformGizmo.js +2 -0
- package/lib/engine-components/TransformGizmo.js.map +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +1 -0
- package/lib/engine-components/VideoPlayer.js +1 -0
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/Voip.d.ts +1 -0
- package/lib/engine-components/Voip.js +1 -0
- package/lib/engine-components/Voip.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +24 -3
- package/lib/engine-components/export/usdz/USDZExporter.js +36 -2
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +18 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +18 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -0
- package/lib/engine-components/particlesystem/ParticleSystem.js +1 -0
- package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
- package/lib/engine-components/physics/Attractor.d.ts +3 -0
- package/lib/engine-components/physics/Attractor.js +3 -0
- package/lib/engine-components/physics/Attractor.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -0
- package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -0
- package/lib/engine-components/postprocessing/Effects/BloomEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +4 -0
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +3 -0
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +3 -0
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js +4 -0
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +3 -0
- package/lib/engine-components/postprocessing/Effects/Pixelation.js +3 -0
- package/lib/engine-components/postprocessing/Effects/Pixelation.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +4 -0
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/Sharpening.js +4 -0
- package/lib/engine-components/postprocessing/Effects/Sharpening.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +4 -0
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js +4 -0
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/Vignette.js +4 -0
- package/lib/engine-components/postprocessing/Effects/Vignette.js.map +1 -1
- package/lib/engine-components/postprocessing/Volume.d.ts +1 -0
- package/lib/engine-components/postprocessing/Volume.js +1 -0
- package/lib/engine-components/postprocessing/Volume.js.map +1 -1
- package/lib/engine-components/splines/Spline.d.ts +1 -0
- package/lib/engine-components/splines/Spline.js +1 -0
- package/lib/engine-components/splines/Spline.js.map +1 -1
- package/lib/engine-components/splines/SplineWalker.d.ts +1 -0
- package/lib/engine-components/splines/SplineWalker.js +1 -0
- package/lib/engine-components/splines/SplineWalker.js.map +1 -1
- package/lib/engine-components/timeline/PlayableDirector.d.ts +3 -1
- package/lib/engine-components/timeline/PlayableDirector.js +17 -9
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/timeline/SignalAsset.d.ts +1 -0
- package/lib/engine-components/timeline/SignalAsset.js +1 -0
- package/lib/engine-components/timeline/SignalAsset.js.map +1 -1
- package/lib/engine-components/ui/Button.d.ts +4 -0
- package/lib/engine-components/ui/Button.js +4 -0
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +5 -0
- package/lib/engine-components/ui/Canvas.js +5 -0
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/CanvasGroup.d.ts +4 -0
- package/lib/engine-components/ui/CanvasGroup.js +4 -0
- package/lib/engine-components/ui/CanvasGroup.js.map +1 -1
- package/lib/engine-components/ui/EventSystem.d.ts +2 -0
- package/lib/engine-components/ui/EventSystem.js +2 -0
- package/lib/engine-components/ui/EventSystem.js.map +1 -1
- package/lib/engine-components/ui/Image.d.ts +4 -0
- package/lib/engine-components/ui/Image.js +4 -0
- package/lib/engine-components/ui/Image.js.map +1 -1
- package/lib/engine-components/ui/InputField.d.ts +4 -0
- package/lib/engine-components/ui/InputField.js +4 -0
- package/lib/engine-components/ui/InputField.js.map +1 -1
- package/lib/engine-components/ui/Outline.d.ts +7 -0
- package/lib/engine-components/ui/Outline.js +7 -0
- package/lib/engine-components/ui/Outline.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +1 -0
- package/lib/engine-components/ui/Text.js +1 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +1 -0
- package/lib/engine-components/utils/LookAt.js +1 -0
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/web/Clickthrough.d.ts +1 -1
- package/lib/engine-components/web/Clickthrough.js +1 -1
- package/lib/engine-components/web/CursorFollow.d.ts +2 -0
- package/lib/engine-components/web/CursorFollow.js +3 -0
- package/lib/engine-components/web/CursorFollow.js.map +1 -1
- package/lib/engine-components/web/HoverAnimation.d.ts +1 -0
- package/lib/engine-components/web/HoverAnimation.js +1 -0
- package/lib/engine-components/web/HoverAnimation.js.map +1 -1
- package/lib/engine-components/web/ScrollFollow.d.ts +2 -0
- package/lib/engine-components/web/ScrollFollow.js +2 -0
- package/lib/engine-components/web/ScrollFollow.js.map +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +1 -0
- package/lib/engine-components/web/ViewBox.js +1 -0
- package/lib/engine-components/web/ViewBox.js.map +1 -1
- package/lib/engine-components/webxr/Avatar.d.ts +5 -0
- package/lib/engine-components/webxr/Avatar.js +5 -0
- package/lib/engine-components/webxr/Avatar.js.map +1 -1
- package/lib/engine-components/webxr/WebARCameraBackground.d.ts +1 -0
- package/lib/engine-components/webxr/WebARCameraBackground.js +1 -0
- package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
- package/lib/engine-components/webxr/WebARSessionRoot.d.ts +1 -0
- package/lib/engine-components/webxr/WebARSessionRoot.js +1 -0
- package/lib/engine-components/webxr/WebARSessionRoot.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +1 -1
- package/lib/engine-components/webxr/WebXR.js +5 -1
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerFollow.d.ts +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerModel.d.ts +4 -0
- package/lib/engine-components/webxr/controllers/XRControllerModel.js +5 -1
- package/lib/engine-components/webxr/controllers/XRControllerModel.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerMovement.d.ts +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerMovement.js +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
- package/lib/engine-components-experimental/networking/PlayerSync.d.ts +2 -0
- package/lib/engine-components-experimental/networking/PlayerSync.js +2 -0
- package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -1
- package/lib/needle-engine.js +2 -1
- package/lib/needle-engine.js.map +1 -1
- package/package.json +18 -12
- package/plugins/types/needleConfig.d.ts +1 -1
- package/plugins/types/next.d.ts +1 -1
- package/plugins/types/userconfig.d.ts +1 -1
- package/src/engine/api.ts +1 -1
- package/src/engine/debug/debug_spector.ts +43 -0
- package/src/engine/engine_addressables.ts +75 -11
- package/src/engine/engine_application.ts +16 -1
- package/src/engine/engine_camera.fit.ts +49 -4
- package/src/engine/engine_context.ts +59 -10
- package/src/engine/engine_loaders.ts +6 -6
- package/src/engine/engine_physics.ts +6 -2
- package/src/engine/engine_physics_rapier.ts +11 -2
- package/src/engine/engine_scenelighting.ts +30 -8
- package/src/engine/engine_texture.ts +1 -1
- package/src/engine/engine_tonemapping.ts +1 -1
- package/src/engine/engine_types.ts +17 -0
- package/src/engine/engine_typestore.ts +5 -6
- package/src/engine/engine_utils_qrcode.ts +1 -1
- package/src/engine/extensions/NEEDLE_components.ts +47 -26
- package/src/engine/extensions/NEEDLE_lightmaps.ts +2 -2
- package/src/engine/extensions/extensions.ts +11 -5
- package/src/engine/webcomponents/buttons.ts +3 -1
- package/src/engine/webcomponents/logo-element.ts +12 -0
- package/src/engine/webcomponents/needle menu/needle-menu.ts +64 -6
- package/src/engine/webcomponents/needle-button.ts +6 -0
- package/src/engine/webcomponents/needle-engine.attributes.ts +12 -3
- package/src/engine/webcomponents/needle-engine.ts +165 -13
- package/src/engine/xr/NeedleXRSession.ts +3 -1
- package/src/engine-components/AlignmentConstraint.ts +9 -0
- package/src/engine-components/Animator.ts +1 -0
- package/src/engine-components/AudioListener.ts +2 -0
- package/src/engine-components/AudioSource.ts +1 -0
- package/src/engine-components/AxesHelper.ts +2 -0
- package/src/engine-components/Camera.ts +1 -0
- package/src/engine-components/CharacterController.ts +4 -1
- package/src/engine-components/Component.ts +9 -1
- package/src/engine-components/DeleteBox.ts +2 -0
- package/src/engine-components/DeviceFlag.ts +4 -0
- package/src/engine-components/DragControls.ts +1 -0
- package/src/engine-components/DropListener.ts +1 -0
- package/src/engine-components/Duplicatable.ts +1 -0
- package/src/engine-components/EventTrigger.ts +2 -0
- package/src/engine-components/GridHelper.ts +2 -0
- package/src/engine-components/GroundProjection.ts +1 -0
- package/src/engine-components/LODGroup.ts +2 -0
- package/src/engine-components/Light.ts +1 -0
- package/src/engine-components/LookAtConstraint.ts +1 -0
- package/src/engine-components/NeedleMenu.ts +1 -0
- package/src/engine-components/NestedGltf.ts +1 -0
- package/src/engine-components/Networking.ts +1 -0
- package/src/engine-components/OffsetConstraint.ts +7 -0
- package/src/engine-components/OrbitControls.ts +1 -0
- package/src/engine-components/PlayerColor.ts +2 -0
- package/src/engine-components/ReflectionProbe.ts +19 -10
- package/src/engine-components/Renderer.ts +16 -44
- package/src/engine-components/RendererInstancing.ts +69 -33
- package/src/engine-components/RendererLightmap.ts +27 -17
- package/src/engine-components/RigidBody.ts +1 -0
- package/src/engine-components/SceneSwitcher.ts +1 -0
- package/src/engine-components/ScreenCapture.ts +1 -0
- package/src/engine-components/SeeThrough.ts +1 -0
- package/src/engine-components/ShadowCatcher.ts +2 -0
- package/src/engine-components/Skybox.ts +48 -36
- package/src/engine-components/SmoothFollow.ts +1 -0
- package/src/engine-components/SpatialTrigger.ts +1 -0
- package/src/engine-components/SpectatorCamera.ts +1 -0
- package/src/engine-components/SpriteRenderer.ts +1 -0
- package/src/engine-components/SyncedCamera.ts +2 -0
- package/src/engine-components/SyncedRoom.ts +1 -0
- package/src/engine-components/SyncedTransform.ts +2 -0
- package/src/engine-components/TransformGizmo.ts +2 -0
- package/src/engine-components/VideoPlayer.ts +1 -0
- package/src/engine-components/Voip.ts +1 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +52 -5
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +18 -0
- package/src/engine-components/particlesystem/ParticleSystem.ts +1 -0
- package/src/engine-components/physics/Attractor.ts +3 -0
- package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -0
- package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +4 -0
- package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +3 -0
- package/src/engine-components/postprocessing/Effects/DepthOfField.ts +4 -0
- package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
- package/src/engine-components/postprocessing/Effects/Pixelation.ts +3 -0
- package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +4 -0
- package/src/engine-components/postprocessing/Effects/Sharpening.ts +4 -0
- package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +4 -0
- package/src/engine-components/postprocessing/Effects/Tonemapping.ts +4 -0
- package/src/engine-components/postprocessing/Effects/Vignette.ts +4 -0
- package/src/engine-components/postprocessing/Volume.ts +1 -0
- package/src/engine-components/splines/Spline.ts +1 -0
- package/src/engine-components/splines/SplineWalker.ts +1 -0
- package/src/engine-components/timeline/PlayableDirector.ts +17 -10
- package/src/engine-components/timeline/SignalAsset.ts +1 -0
- package/src/engine-components/ui/Button.ts +4 -0
- package/src/engine-components/ui/Canvas.ts +5 -0
- package/src/engine-components/ui/CanvasGroup.ts +4 -0
- package/src/engine-components/ui/EventSystem.ts +2 -0
- package/src/engine-components/ui/Image.ts +4 -0
- package/src/engine-components/ui/InputField.ts +4 -0
- package/src/engine-components/ui/Outline.ts +7 -0
- package/src/engine-components/ui/Text.ts +1 -0
- package/src/engine-components/utils/LookAt.ts +1 -0
- package/src/engine-components/web/Clickthrough.ts +1 -1
- package/src/engine-components/web/CursorFollow.ts +4 -0
- package/src/engine-components/web/HoverAnimation.ts +1 -0
- package/src/engine-components/web/ScrollFollow.ts +2 -0
- package/src/engine-components/web/ViewBox.ts +1 -0
- package/src/engine-components/webxr/Avatar.ts +5 -0
- package/src/engine-components/webxr/WebARCameraBackground.ts +1 -0
- package/src/engine-components/webxr/WebARSessionRoot.ts +1 -0
- package/src/engine-components/webxr/WebXR.ts +5 -1
- package/src/engine-components/webxr/controllers/XRControllerFollow.ts +1 -0
- package/src/engine-components/webxr/controllers/XRControllerModel.ts +5 -1
- package/src/engine-components/webxr/controllers/XRControllerMovement.ts +1 -0
- package/src/engine-components-experimental/networking/PlayerSync.ts +2 -0
- package/src/needle-engine.ts +4 -2
- package/dist/generateMeshBVH.worker-B9bjdr6J.js +0 -25
- package/dist/loader.worker-CiTwpNPW.js +0 -27
- package/dist/rapier-BqdcSmKY.umd.cjs +0 -1
- package/dist/rapier-Cg3w3nFI.min.js +0 -1
- package/dist/rapier-sU12SWAs.js +0 -5217
|
@@ -16,6 +16,12 @@ import { arContainerClassName, AROverlayHandler } from "./needle-engine.ar-overl
|
|
|
16
16
|
import { NeedleEngineAttributes, TonemappingAttributeOptions } from "./needle-engine.attributes.js";
|
|
17
17
|
import { calculateProgress01, EngineLoadingView, type ILoadingViewHandler } from "./needle-engine.loading.js";
|
|
18
18
|
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
"needle-engine": NeedleEngineWebComponent;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
// registering loader here too to make sure it's imported when using engine via vanilla js
|
|
20
26
|
registerLoader(NeedleLoader);
|
|
21
27
|
|
|
@@ -55,17 +61,17 @@ const observedAttributes = [
|
|
|
55
61
|
// https://developers.google.com/web/fundamentals/web-components/customelements
|
|
56
62
|
|
|
57
63
|
/**
|
|
58
|
-
*
|
|
59
|
-
* The
|
|
60
|
-
* The
|
|
61
|
-
* The
|
|
64
|
+
* The `<needle-engine>` web component. See {@link NeedleEngineAttributes} attributes for supported attributes
|
|
65
|
+
* The web component creates and manages a Needle Engine context, which is responsible for rendering a 3D scene using threejs.
|
|
66
|
+
* The context is created when the `src` attribute is set, and disposed when the element is removed from the DOM. You can prevent cleanup by setting the `keep-alive` attribute to `true`.
|
|
67
|
+
* The context is accessible from the `<needle-engine>` element: `document.querySelector("needle-engine").context`.
|
|
62
68
|
* See {@link https://engine.needle.tools/docs/reference/needle-engine-attributes}
|
|
63
69
|
*
|
|
64
70
|
* @example
|
|
65
71
|
* <needle-engine src="https://example.com/scene.glb"></needle-engine>
|
|
66
72
|
* @example
|
|
67
73
|
* <needle-engine src="https://example.com/scene.glb" camera-controls="false"></needle-engine>
|
|
68
|
-
*/
|
|
74
|
+
*/
|
|
69
75
|
export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngineComponent {
|
|
70
76
|
|
|
71
77
|
static get observedAttributes() {
|
|
@@ -100,7 +106,6 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
100
106
|
else this.setAttribute("camera-controls", value ? "true" : "false");
|
|
101
107
|
}
|
|
102
108
|
|
|
103
|
-
|
|
104
109
|
/**
|
|
105
110
|
* Get the current context for this web component instance. The context is created when the src attribute is set and the loading has finished.
|
|
106
111
|
* The context is disposed when the needle engine is removed from the document (you can prevent this by setting the keep-alive attribute to true).
|
|
@@ -133,7 +138,7 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
133
138
|
private _loadingProgress01: number = 0;
|
|
134
139
|
private _loadingView?: ILoadingViewHandler;
|
|
135
140
|
private _previousSrc: string | null | string[] = null;
|
|
136
|
-
/** set to true after <needle-engine> did load completely at least once. Set to false when <needle-engine> is removed from the document */
|
|
141
|
+
/** @private set to true after <needle-engine> did load completely at least once. Set to false when < to false when <needle-engine> is removed from the document removed from the document */
|
|
137
142
|
private _didFullyLoad: boolean = false;
|
|
138
143
|
|
|
139
144
|
constructor() {
|
|
@@ -296,6 +301,10 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
296
301
|
}
|
|
297
302
|
}
|
|
298
303
|
|
|
304
|
+
connectedMoveCallback() {
|
|
305
|
+
// we dont want needle-engine to cleanup JUST because the element is moved in the DOM. See https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#custom_element_lifecycle_callbacks
|
|
306
|
+
}
|
|
307
|
+
|
|
299
308
|
/**
|
|
300
309
|
* @internal
|
|
301
310
|
*/
|
|
@@ -317,7 +326,7 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
317
326
|
case "loadfinished":
|
|
318
327
|
if (typeof newValue === "string" && newValue.length > 0) {
|
|
319
328
|
if (debug) console.log(name + " attribute changed", newValue);
|
|
320
|
-
this.registerEventFromAttribute(
|
|
329
|
+
this.registerEventFromAttribute("loadfinished", newValue);
|
|
321
330
|
}
|
|
322
331
|
break;
|
|
323
332
|
case "dracoDecoderPath":
|
|
@@ -441,7 +450,7 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
441
450
|
if (allowOverridingDefaultLoading) {
|
|
442
451
|
// Handle the <needle-engine hide-loading-overlay> attribute
|
|
443
452
|
const hideOverlay = this.getAttribute("hide-loading-overlay");
|
|
444
|
-
if (hideOverlay !== null && hideOverlay !== undefined && hideOverlay !== "0") {
|
|
453
|
+
if (hideOverlay !== null && hideOverlay !== undefined && (hideOverlay as any) !== "0") {
|
|
445
454
|
useDefaultLoading = false;
|
|
446
455
|
}
|
|
447
456
|
}
|
|
@@ -668,7 +677,7 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
668
677
|
if (attributeValue)
|
|
669
678
|
this.registerEventFromAttribute("loadstart", attributeValue);
|
|
670
679
|
}
|
|
671
|
-
private registerEventFromAttribute(eventName:
|
|
680
|
+
private registerEventFromAttribute(eventName: 'loadfinished' | 'loadstart', code: string) {
|
|
672
681
|
const prev = this._previouslyRegisteredMap.get(eventName);
|
|
673
682
|
if (prev) {
|
|
674
683
|
this._previouslyRegisteredMap.delete(eventName);
|
|
@@ -681,6 +690,7 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
681
690
|
// const fn = new Function(newValue);
|
|
682
691
|
if (typeof fn === "function") {
|
|
683
692
|
this._previouslyRegisteredMap.set(eventName, fn);
|
|
693
|
+
// @ts-ignore // not sure how to type this properly
|
|
684
694
|
this.addEventListener(eventName, evt => fn?.call(globalThis, this._context, evt));
|
|
685
695
|
}
|
|
686
696
|
}
|
|
@@ -828,15 +838,157 @@ export class NeedleEngineWebComponent extends HTMLElement implements INeedleEngi
|
|
|
828
838
|
setKtx2TranscoderPath(customKtx2DecoderPath);
|
|
829
839
|
}
|
|
830
840
|
}
|
|
841
|
+
|
|
842
|
+
/** Change which model gets loaded. This will trigger a reload of the model. */
|
|
843
|
+
setAttribute(name: 'src', value: string | string[]): void;
|
|
844
|
+
/** Optional string that will be applied to the context as a hash and can influence caching/identification. */
|
|
845
|
+
setAttribute(name: 'hash', value: string): void;
|
|
846
|
+
/** Public key used for licensing and feature gating (read-only on runtime if compiled-in). */
|
|
847
|
+
setAttribute(name: 'public-key', value: string): void;
|
|
848
|
+
/** Engine version string — usually set by the build/runtime. */
|
|
849
|
+
setAttribute(name: 'version', value: string): void;
|
|
850
|
+
/** If set to false the camera controls are disabled. Accepted values: true/false/none. Default behaviour is enabled. */
|
|
851
|
+
setAttribute(name: 'camera-controls', value: string): void;
|
|
852
|
+
/** Override path for the Draco decoder files. */
|
|
853
|
+
setAttribute(name: 'dracoDecoderPath', value: string): void;
|
|
854
|
+
/** Choose Draco decoder type: 'wasm' or 'js'. */
|
|
855
|
+
setAttribute(name: 'dracoDecoderType', value: 'wasm' | 'js'): void;
|
|
856
|
+
/** Override path for the KTX2 transcoder/decoder files. */
|
|
857
|
+
setAttribute(name: 'ktx2DecoderPath', value: string): void;
|
|
858
|
+
/** Tonemapping mode. Accepted values: 'none' | 'linear' | 'agx' | 'neutral'. */
|
|
859
|
+
setAttribute(name: 'tone-mapping', value: 'none' | 'linear' | 'agx' | 'neutral'): void;
|
|
860
|
+
/** Numeric exposure multiplier for tonemapping; accepts number or stringified number. */
|
|
861
|
+
setAttribute(name: 'tone-mapping-exposure', value: string | number): void;
|
|
862
|
+
/** Background image blur strength (0..1). Accepts number or string value. */
|
|
863
|
+
setAttribute(name: 'background-blurriness', value: string | number): void;
|
|
864
|
+
/** CSS color for the background; string color value expected (e.g. '#fff', 'rgba()' etc). */
|
|
865
|
+
setAttribute(name: 'background-color', value: string): void;
|
|
866
|
+
/** Intensity multiplier for environment lighting; accepts numeric value or string. */
|
|
867
|
+
setAttribute(name: 'environment-intensity', value: string | number): void;
|
|
868
|
+
/** When true the engine context is kept alive after the element is removed from DOM. Use 'true' or 'false'. */
|
|
869
|
+
setAttribute(name: 'keep-alive', value: 'true' | 'false'): void;
|
|
870
|
+
/** Generic typed setter for known Needle Engine attributes (useful from TS):
|
|
871
|
+
* setAttribute<T extends keyof NeedleEngineAttributes>(name, value) will type-check against the declared attribute shape.
|
|
872
|
+
*/
|
|
873
|
+
setAttribute<T extends keyof NeedleEngineAttributes>(qualifiedName: T, value: NeedleEngineAttributes[T]): void;
|
|
874
|
+
setAttribute(qualifiedName: ({} & string), value: string): void;
|
|
875
|
+
setAttribute(qualifiedName: string, value: string): void {
|
|
876
|
+
super.setAttribute(qualifiedName, value);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/** Read the `src` attribute. Returns string, string[] (if codegen provided an array) or null if unset. */
|
|
880
|
+
getAttribute(name: 'src'): string | string[] | null;
|
|
881
|
+
/** Read the `hash` attribute — an optional string attached to the context for caching/identification. */
|
|
882
|
+
getAttribute(name: 'hash'): string | null;
|
|
883
|
+
/** Read the `public-key` attribute used for licensing/feature gating. */
|
|
884
|
+
getAttribute(name: 'public-key'): string | null;
|
|
885
|
+
/** Read the `version` attribute — the engine build/version string. */
|
|
886
|
+
getAttribute(name: 'version'): string | null;
|
|
887
|
+
/** Read the `camera-controls` attribute; string values include 'true'|'false'|'none' or null if unset. */
|
|
888
|
+
getAttribute(name: 'camera-controls'): string | null;
|
|
889
|
+
/** Read custom Draco decoder path if configured. */
|
|
890
|
+
getAttribute(name: 'dracoDecoderPath'): string | null;
|
|
891
|
+
/** Read Draco decoder type ('wasm'|'js') if configured. */
|
|
892
|
+
getAttribute(name: 'dracoDecoderType'): string | null;
|
|
893
|
+
/** Read custom KTX2 decoder/transcoder path if configured. */
|
|
894
|
+
getAttribute(name: 'ktx2DecoderPath'): string | null;
|
|
895
|
+
/** Read configured tone-mapping value, as a string matching accepted modes (none, linear, neutral, agx). */
|
|
896
|
+
getAttribute(name: 'tone-mapping'): string | null;
|
|
897
|
+
/** Read tone-mapping exposure multiplier (string or numeric string). */
|
|
898
|
+
getAttribute(name: 'tone-mapping-exposure'): string | null;
|
|
899
|
+
/** Read background-blurriness value (0..1) as string or null. */
|
|
900
|
+
getAttribute(name: 'background-blurriness'): string | null;
|
|
901
|
+
/** Read CSS background-color string value (e.g. '#fff', 'rgba()'). */
|
|
902
|
+
getAttribute(name: 'background-color'): string | null;
|
|
903
|
+
/** Read environment-intensity (numeric) as string or null. */
|
|
904
|
+
getAttribute(name: 'environment-intensity'): string | null;
|
|
905
|
+
/** Read keep-alive attribute; presence ("true") prevents the context from being disposed on disconnect. */
|
|
906
|
+
getAttribute(name: 'keep-alive'): string | null;
|
|
907
|
+
/** Defines a CSS selector or HTMLElement used to define the camera focus rectangle. */
|
|
908
|
+
getAttribute(name: 'focus-rect'): string | null;
|
|
909
|
+
/** @private */
|
|
910
|
+
getAttribute(name: 'loading-blur'): string | null;
|
|
911
|
+
/** @private */
|
|
912
|
+
getAttribute(name: 'alias'): string | null;
|
|
913
|
+
/** Typed getter for known NeedleEngine attribute names; returns the typed shape declared in NeedleEngineAttributes or null. */
|
|
914
|
+
getAttribute<T extends keyof NeedleEngineAttributes>(qualifiedName: T): NeedleEngineAttributes[T] | null;
|
|
915
|
+
// getAttribute(qualifiedName: ({} & string)): string | null
|
|
916
|
+
getAttribute(qualifiedName: ({} & string)): string | null;
|
|
917
|
+
getAttribute(qualifiedName: string): string | null {
|
|
918
|
+
return super.getAttribute(qualifiedName);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Emitted when loading begins for the engine/scene. The event is cancelable — calling preventDefault()
|
|
923
|
+
* will stop the default loading UI behavior (apps can implement custom loading flows).
|
|
924
|
+
* Event contains a small detail object with context and optional alias.
|
|
925
|
+
*/
|
|
926
|
+
addEventListener(type: 'loadstart', listener: (ev: CustomEvent<{ context: Context; alias: string | null }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
927
|
+
/**
|
|
928
|
+
* Emitted repeatedly while loading resources. Use the event detail to show progress:
|
|
929
|
+
* Event contains progress metadata to report loader state.
|
|
930
|
+
*/
|
|
931
|
+
addEventListener(type: 'progress', listener: (ev: CustomEvent<{ context: Context; name: string; progress: ProgressEvent<EventTarget>; index: number; count: number; totalProgress01: number }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
932
|
+
/**
|
|
933
|
+
* Emitted when the initial loading has finished. detail contains the context, the source alias (if available) and a list of loaded models.
|
|
934
|
+
* Emitted when the initial load completes; contains helpful summary data.
|
|
935
|
+
*/
|
|
936
|
+
addEventListener(type: 'loadfinished', listener: (ev: CustomEvent<{ context: Context; src: string | null; loadedFiles: LoadedModel[] }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
937
|
+
/**
|
|
938
|
+
* Emitted when an XR session ends.
|
|
939
|
+
*/
|
|
940
|
+
addEventListener(type: 'xr-session-ended', listener: (ev: CustomEvent<{ session: XRSession | null; context: Context; sessionMode: XRSessionMode | undefined }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
941
|
+
/**
|
|
942
|
+
* Emitted when entering AR.
|
|
943
|
+
*/
|
|
944
|
+
addEventListener(type: 'enter-ar', listener: (ev: CustomEvent<{ session: XRSession; context: Context; htmlContainer: HTMLElement | null }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
945
|
+
/**
|
|
946
|
+
* Emitted when exiting AR.
|
|
947
|
+
*/
|
|
948
|
+
addEventListener(type: 'exit-ar', listener: (ev: CustomEvent<{ session: XRSession; context: Context; htmlContainer: HTMLElement | null }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
949
|
+
/**
|
|
950
|
+
* Emitted when entering VR.
|
|
951
|
+
*/
|
|
952
|
+
addEventListener(type: 'enter-vr', listener: (ev: CustomEvent<{ session: XRSession; context: Context }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
953
|
+
/**
|
|
954
|
+
* Emitted when exiting VR.
|
|
955
|
+
*/
|
|
956
|
+
addEventListener(type: 'exit-vr', listener: (ev: CustomEvent<{ session: XRSession; context: Context }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
957
|
+
/** Emitted when the engine has rendered its first frame and is ready. */
|
|
958
|
+
addEventListener(type: 'ready', listener: (ev: Event) => void, options?: boolean | AddEventListenerOptions): void;
|
|
959
|
+
/** Emitted when an XR session is started — useful to prepare AR/VR UI. */
|
|
960
|
+
addEventListener(type: 'xr-session-started', listener: (ev: CustomEvent<{ session: XRSession; context: Context }>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
961
|
+
|
|
962
|
+
// Sadly not enough to make types work (see comment below)
|
|
963
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: ({} & K), listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
964
|
+
// These are from the super type. Not sure how we can remove intellisense for the "regular" events while still making the types work...
|
|
965
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
966
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
967
|
+
|
|
968
|
+
addEventListener(type: string, listener: any, options?: boolean | AddEventListenerOptions): void
|
|
969
|
+
{
|
|
970
|
+
return super.addEventListener(type, listener as EventListenerOrEventListenerObject, options);
|
|
971
|
+
}
|
|
831
972
|
}
|
|
832
973
|
|
|
833
974
|
if (typeof window !== "undefined" && !window.customElements.get(htmlTagName))
|
|
834
975
|
window.customElements.define(htmlTagName, NeedleEngineWebComponent);
|
|
835
976
|
|
|
977
|
+
/** Usage of the types declared above */
|
|
836
978
|
|
|
979
|
+
const elem = document.querySelector("needle-engine")!;
|
|
980
|
+
elem.setAttribute("src", "model.glb");
|
|
981
|
+
elem.addEventListener("loadfinished", (ev) => {
|
|
982
|
+
const context = ev.detail.context;
|
|
983
|
+
});
|
|
984
|
+
elem.setAttribute("dracoDecoderType", "wasm");
|
|
985
|
+
elem.addEventListener("enter-ar", (ev) => {
|
|
986
|
+
const session = ev.detail.session;
|
|
987
|
+
});
|
|
837
988
|
|
|
838
|
-
|
|
839
|
-
|
|
989
|
+
elem.addEventListener("mousedown", (ev) => {
|
|
990
|
+
console.log("regular mousedown event", ev);
|
|
991
|
+
});
|
|
840
992
|
|
|
841
993
|
function getDisplayName(str: string) {
|
|
842
994
|
if (str.startsWith("blob:")) {
|
|
@@ -956,4 +1108,4 @@ function handleLoadingBlur(needleEngineElement: NeedleEngineWebComponent) {
|
|
|
956
1108
|
}
|
|
957
1109
|
}
|
|
958
1110
|
}, { once: true });
|
|
959
|
-
}
|
|
1111
|
+
}
|
|
@@ -527,7 +527,9 @@ export class NeedleXRSession implements INeedleXRSession {
|
|
|
527
527
|
else
|
|
528
528
|
console.log("%c" + `Requesting ${mode} session`, "font-weight:bold;");
|
|
529
529
|
for (const script of scripts) {
|
|
530
|
-
if (script.onBeforeXR
|
|
530
|
+
if (script.onBeforeXR && script.activeAndEnabled && !script.destroyed) {
|
|
531
|
+
script.onBeforeXR(mode, init);
|
|
532
|
+
}
|
|
531
533
|
}
|
|
532
534
|
for (const listener of this._sessionRequestStartListeners) {
|
|
533
535
|
listener({ mode, init });
|
|
@@ -4,6 +4,15 @@ import { serializable } from "../engine/engine_serialization_decorator.js";
|
|
|
4
4
|
import * as utils from "./../engine/engine_three_utils.js";
|
|
5
5
|
import { Behaviour, GameObject } from "./Component.js";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Aligns this GameObject between two other GameObjects, scaling it to fit the distance.
|
|
9
|
+
* You can use this to create dynamic beams or connectors between objects.
|
|
10
|
+
*
|
|
11
|
+
* @summary Aligns and scales the object between two target GameObjects
|
|
12
|
+
* @category Utility
|
|
13
|
+
* @group Components
|
|
14
|
+
|
|
15
|
+
**/
|
|
7
16
|
export class AlignmentConstraint extends Behaviour {
|
|
8
17
|
|
|
9
18
|
@serializable(GameObject)
|
|
@@ -8,6 +8,8 @@ import { Behaviour, GameObject } from "./Component.js";
|
|
|
8
8
|
* AudioListener represents a listener that can hear audio sources in the scene.
|
|
9
9
|
* This component creates and manages a Three.js {@link three#AudioListener}, automatically connecting it
|
|
10
10
|
* to the main camera or a Camera in the parent hierarchy.
|
|
11
|
+
*
|
|
12
|
+
* @summary Audio listener for 3D audio capture
|
|
11
13
|
* @category Multimedia
|
|
12
14
|
* @group Components
|
|
13
15
|
*/
|
|
@@ -52,6 +52,7 @@ export enum AudioRolloffMode {
|
|
|
52
52
|
* is muted, the volume is set to 0. When unmuted, the volume
|
|
53
53
|
* returns to its previous value.
|
|
54
54
|
*
|
|
55
|
+
* @summary 3D audio source with spatial positioning and playback controls
|
|
55
56
|
* @category Multimedia
|
|
56
57
|
* @group Components
|
|
57
58
|
*/
|
|
@@ -7,6 +7,8 @@ import { Behaviour } from "./Component.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* Component that visualizes the axes of an object in the scene.
|
|
9
9
|
* Renders colored lines representing the X (red), Y (green) and Z (blue) axes.
|
|
10
|
+
*
|
|
11
|
+
* @summary Visualizes object axes in the scene
|
|
10
12
|
* @category Helpers
|
|
11
13
|
* @group Components
|
|
12
14
|
*/
|
|
@@ -36,6 +36,7 @@ const debugscreenpointtoray = getParam("debugscreenpointtoray");
|
|
|
36
36
|
* Supports both perspective and orthographic cameras with various rendering options.
|
|
37
37
|
* Internally, this component uses {@link PerspectiveCamera} and {@link OrthographicCamera} three.js objects.
|
|
38
38
|
*
|
|
39
|
+
* @summary Camera rendering scenes from a specific viewpoint
|
|
39
40
|
* @category Camera
|
|
40
41
|
* @group Components
|
|
41
42
|
*/
|
|
@@ -14,7 +14,10 @@ import { Rigidbody } from "./RigidBody.js";
|
|
|
14
14
|
const debug = getParam("debugcharactercontroller");
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* CharacterController adds a capsule collider and rigidbody to the object, constrains rotation, and provides movement and grounded state.
|
|
18
|
+
* It is designed for typical character movement in 3D environments.
|
|
19
|
+
* @summary Character Movement Controller
|
|
20
|
+
* @category Character
|
|
18
21
|
* @group Components
|
|
19
22
|
*/
|
|
20
23
|
export class CharacterController extends Behaviour {
|
|
@@ -11,6 +11,7 @@ import { syncDestroy, syncInstantiate, SyncInstantiateOptions } from "../engine/
|
|
|
11
11
|
import { Context, FrameEvent } from "../engine/engine_setup.js";
|
|
12
12
|
import * as threeutils from "../engine/engine_three_utils.js";
|
|
13
13
|
import type { Collision, ComponentInit, Constructor, ConstructorConcrete, GuidsMap, ICollider, IComponent, IGameObject, SourceIdentifier } from "../engine/engine_types.js";
|
|
14
|
+
import { TypeStore } from "../engine/engine_typestore.js";
|
|
14
15
|
import type { INeedleXRSessionEventReceiver, NeedleXRControllerEventArgs, NeedleXREventArgs } from "../engine/engine_xr.js";
|
|
15
16
|
import { type IPointerEventHandler, PointerEventData } from "./ui/PointerEvents.js";
|
|
16
17
|
|
|
@@ -540,7 +541,8 @@ export abstract class GameObject extends Object3D implements Object3D, IGameObje
|
|
|
540
541
|
}
|
|
541
542
|
}
|
|
542
543
|
|
|
543
|
-
|
|
544
|
+
// DO NOT CHANGE THE SYMBOL NAME
|
|
545
|
+
const $componentName = Symbol("component-name");
|
|
544
546
|
|
|
545
547
|
/**
|
|
546
548
|
* Needle Engine component's are the main building blocks of the Needle Engine.
|
|
@@ -581,6 +583,12 @@ export abstract class Component implements IComponent, EventTarget,
|
|
|
581
583
|
*/
|
|
582
584
|
get isComponent(): boolean { return true; }
|
|
583
585
|
|
|
586
|
+
/**
|
|
587
|
+
* Get the original component type name before minification (available if the component is registered in the TypeStore)
|
|
588
|
+
*/
|
|
589
|
+
get [$componentName]() { return TypeStore.getKey(this.constructor as any) || undefined; }
|
|
590
|
+
|
|
591
|
+
|
|
584
592
|
private __context: Context | undefined;
|
|
585
593
|
|
|
586
594
|
/**
|
|
@@ -11,6 +11,8 @@ import { UsageMarker } from "./Interactable.js";
|
|
|
11
11
|
const debug = getParam("debugdeletable");
|
|
12
12
|
/**
|
|
13
13
|
* A box-shaped area that can be used to delete objects that get into it. Useful for sandbox-style builders or physics simulations.
|
|
14
|
+
*
|
|
15
|
+
* @summary Box area that deletes objects entering it
|
|
14
16
|
* @category Interactivity
|
|
15
17
|
* @group Components
|
|
16
18
|
*/
|
|
@@ -11,6 +11,10 @@ export enum DeviceType {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
+
* Enables or disables the GameObject based on the device type (mobile or desktop).
|
|
15
|
+
* You can use this to show or hide objects depending on whether the user is on a mobile device or a desktop.
|
|
16
|
+
*
|
|
17
|
+
* @summary Show or hide GameObject based on device type
|
|
14
18
|
* @category Utilities
|
|
15
19
|
* @group Components
|
|
16
20
|
*/
|
|
@@ -46,6 +46,7 @@ export enum DragMode {
|
|
|
46
46
|
* DragControls allows you to drag objects around in the scene. It can be used to move objects in 2D (screen space) or 3D (world space).
|
|
47
47
|
* Debug mode can be enabled with the URL parameter `?debugdrag`, which shows visual helpers and logs drag operations.
|
|
48
48
|
*
|
|
49
|
+
* @summary Enables dragging of objects in 2D or 3D space
|
|
49
50
|
* @category Interactivity
|
|
50
51
|
* @group Components
|
|
51
52
|
*/
|
|
@@ -14,6 +14,7 @@ import { ObjectRaycaster } from "./ui/Raycaster.js";
|
|
|
14
14
|
/**
|
|
15
15
|
* The Duplicatable component is used to duplicate a assigned {@link GameObject} when a pointer event occurs on the object.
|
|
16
16
|
*
|
|
17
|
+
* @summary Duplicates a GameObject on pointer events
|
|
17
18
|
* @category Interactivity
|
|
18
19
|
* @group Components
|
|
19
20
|
*/
|
|
@@ -14,6 +14,8 @@ class TriggerEvent {
|
|
|
14
14
|
/**
|
|
15
15
|
* The EventTrigger component is used to trigger events when certain pointer events occur on the GameObject.
|
|
16
16
|
* It implements the {@link IPointerEventHandler} interface and can be used to expose events to the user in the editor without writing code.
|
|
17
|
+
*
|
|
18
|
+
* @summary Triggers events on pointer interactions
|
|
17
19
|
* @category Interactivity
|
|
18
20
|
* @group Components
|
|
19
21
|
*/
|
|
@@ -75,6 +75,7 @@ enum LightShadows {
|
|
|
75
75
|
* Debug mode can be enabled with the URL parameter `?debuglights`, which shows
|
|
76
76
|
* additional console output and visual helpers for lights.
|
|
77
77
|
*
|
|
78
|
+
* @summary Light component for various light types and shadow settings
|
|
78
79
|
* @category Rendering
|
|
79
80
|
* @group Components
|
|
80
81
|
*/
|
|
@@ -8,6 +8,7 @@ import type { OrbitControls } from "./OrbitControls.js";
|
|
|
8
8
|
* A LookAtConstraint is used by OrbitControls to make the camera look at a target.
|
|
9
9
|
* This component is used by {@link OrbitControls} internally.
|
|
10
10
|
*
|
|
11
|
+
* @summary Look At Constraint for OrbitControls
|
|
11
12
|
* @category Camera Controls
|
|
12
13
|
* @group Components
|
|
13
14
|
*/
|
|
@@ -10,6 +10,7 @@ import { Behaviour } from './Component.js';
|
|
|
10
10
|
* Controls display options, button visibility, and menu positioning.
|
|
11
11
|
* From code, you can access the menu via {@link Context.menu}.
|
|
12
12
|
*
|
|
13
|
+
* @summary Configuration component for the Needle Menu
|
|
13
14
|
* @category User Interface
|
|
14
15
|
* @group Components
|
|
15
16
|
**/
|
|
@@ -11,6 +11,7 @@ const debug = getParam("debugnestedgltf");
|
|
|
11
11
|
/** The nested gltf is a component that is used to load a gltf file when the component becomes active (start)
|
|
12
12
|
* It will load the gltf file and instantiate it as a child of the parent of the GameObject that has this component
|
|
13
13
|
*
|
|
14
|
+
* @summary Loads and instantiates a nested glTF file
|
|
14
15
|
* @category Asset Management
|
|
15
16
|
* @group Components
|
|
16
17
|
*/
|
|
@@ -11,6 +11,7 @@ const debug = getParam("debugnet");
|
|
|
11
11
|
* This component supplies websocket URLs for establishing connections.
|
|
12
12
|
* It implements the {@link INetworkingWebsocketUrlProvider} interface.
|
|
13
13
|
*
|
|
14
|
+
* @summary Networking configuration component
|
|
14
15
|
* @category Networking
|
|
15
16
|
* @group Components
|
|
16
17
|
*/
|
|
@@ -4,6 +4,13 @@ import { serializable } from "../engine/engine_serialization_decorator.js";
|
|
|
4
4
|
import * as utils from "./../engine/engine_three_utils.js";
|
|
5
5
|
import { Behaviour, GameObject } from "./Component.js";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* OffsetConstraint component allows an object to maintain a specified positional and rotational offset
|
|
9
|
+
* relative to another object, with options for alignment and leveling.
|
|
10
|
+
* @summary Maintains positional and rotational offset relative to another object
|
|
11
|
+
* @category Constraints
|
|
12
|
+
* @group Components
|
|
13
|
+
*/
|
|
7
14
|
export class OffsetConstraint extends Behaviour {
|
|
8
15
|
|
|
9
16
|
@serializable(GameObject)
|
|
@@ -63,6 +63,7 @@ declare module 'three/examples/jsm/controls/OrbitControls.js' {
|
|
|
63
63
|
/** The OrbitControls component is used to control a camera using the [OrbitControls from three.js](https://threejs.org/docs/#examples/en/controls/OrbitControls) library.
|
|
64
64
|
* The three OrbitControls object can be accessed via the `controls` property.
|
|
65
65
|
* The object being controlled by the OrbitControls (usually the camera) can be accessed via the `controllerObject` property.
|
|
66
|
+
* @summary Camera controller using three.js OrbitControls
|
|
66
67
|
* @category Camera
|
|
67
68
|
* @group Components
|
|
68
69
|
*/
|
|
@@ -9,6 +9,8 @@ import { AvatarMarker } from "./webxr/WebXRAvatar.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* PlayerColor assigns a unique color for each user in the room to the object it is attached to.
|
|
11
11
|
* The color is generated based on the user's ID.
|
|
12
|
+
*
|
|
13
|
+
* @summary Assigns a unique color to the player object
|
|
12
14
|
* @category Networking
|
|
13
15
|
* @group Components
|
|
14
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EquirectangularReflectionMapping, LinearSRGBColorSpace, Material, MeshBasicMaterial, Object3D, SRGBColorSpace, Texture, Vector3 } from "three";
|
|
1
|
+
import { CubeReflectionMapping, CubeTexture, EquirectangularReflectionMapping, LinearSRGBColorSpace, Material, MeshBasicMaterial, Object3D, SRGBColorSpace, Texture, Vector3 } from "three";
|
|
2
2
|
|
|
3
3
|
import { isDevEnvironment, showBalloonWarning } from "../engine/debug/index.js";
|
|
4
4
|
import { serializable } from "../engine/engine_serialization.js";
|
|
@@ -19,6 +19,7 @@ const $originalMaterial = Symbol("original material");
|
|
|
19
19
|
*
|
|
20
20
|
* - Sample: http://samples.needle.tools/reflection-probes
|
|
21
21
|
*
|
|
22
|
+
* @summary Provides reflection data to materials
|
|
22
23
|
* @category Rendering
|
|
23
24
|
* @group Components
|
|
24
25
|
*/
|
|
@@ -63,13 +64,19 @@ export class ReflectionProbe extends Behaviour {
|
|
|
63
64
|
|
|
64
65
|
// @serializable(Texture)
|
|
65
66
|
set texture(tex: Texture) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
67
|
+
|
|
68
|
+
if (this._texture === tex) return;
|
|
70
69
|
this._texture = tex;
|
|
70
|
+
|
|
71
|
+
if (debug) console.debug("[ReflectionProbe] Set reflection probe texture " + (tex?.name || "(removed)"));
|
|
72
|
+
|
|
71
73
|
if (tex) {
|
|
72
|
-
tex
|
|
74
|
+
if (tex instanceof CubeTexture) {
|
|
75
|
+
// cube textures use CubeReflectionMapping by default
|
|
76
|
+
}
|
|
77
|
+
else if (tex.mapping !== EquirectangularReflectionMapping) {
|
|
78
|
+
tex.mapping = EquirectangularReflectionMapping;
|
|
79
|
+
}
|
|
73
80
|
tex.colorSpace = LinearSRGBColorSpace;
|
|
74
81
|
tex.needsUpdate = true;
|
|
75
82
|
}
|
|
@@ -110,9 +117,8 @@ export class ReflectionProbe extends Behaviour {
|
|
|
110
117
|
}
|
|
111
118
|
}
|
|
112
119
|
start(): void {
|
|
113
|
-
if (!this._texture
|
|
120
|
+
if (!this._texture) {
|
|
114
121
|
console.warn(`[ReflectionProbe] Missing texture. Please assign a custom cubemap texture. To use reflection probes assign them to your renderer's "anchor" property.`);
|
|
115
|
-
showBalloonWarning("ReflectionProbe configuration hint: See browser console for details")
|
|
116
122
|
}
|
|
117
123
|
}
|
|
118
124
|
|
|
@@ -206,8 +212,11 @@ export class ReflectionProbe extends Behaviour {
|
|
|
206
212
|
/** this is the material that we copied and that has the reflection probe */
|
|
207
213
|
const copy = cached?.copy;
|
|
208
214
|
|
|
209
|
-
|
|
210
|
-
|
|
215
|
+
if ("envMap" in copy) {
|
|
216
|
+
// make sure the reflection probe is assigned
|
|
217
|
+
copy.envMap = this.texture;
|
|
218
|
+
copy.needsUpdate = true;
|
|
219
|
+
}
|
|
211
220
|
|
|
212
221
|
_rend.sharedMaterials[i] = copy;
|
|
213
222
|
}
|