@needle-tools/engine 4.11.5 → 4.12.0-next.ca2cebd
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 +14 -0
- package/components.needle.json +1 -1
- package/custom-elements.json +420 -0
- 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-DYdft7n9.min.js → needle-engine.bundle-4A5NjznD.min.js} +130 -135
- package/dist/{needle-engine.bundle-DMqWdPzL.umd.cjs → needle-engine.bundle-BJg4_HhU.umd.cjs} +138 -143
- package/dist/{needle-engine.bundle-DSm5itjo.js → needle-engine.bundle-CFkbGdL5.js} +4368 -4241
- package/dist/needle-engine.d.ts +18198 -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 +0 -1
- package/lib/engine/api.js +0 -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_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_context.js +4 -1
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_license.js +1 -1
- package/lib/engine/engine_license.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_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/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 +24 -3
- package/lib/engine/webcomponents/needle menu/needle-menu.js +18 -3
- 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.d.ts +220 -8
- package/lib/engine/webcomponents/needle-engine.js +94 -13
- 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 +8 -0
- package/lib/engine-components/AlignmentConstraint.js +8 -0
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animation.d.ts +2 -0
- package/lib/engine-components/Animation.js +2 -0
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/Animator.d.ts +2 -0
- package/lib/engine-components/Animator.js +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/BasicIKConstraint.d.ts +8 -0
- package/lib/engine-components/BasicIKConstraint.js +8 -0
- package/lib/engine-components/BasicIKConstraint.js.map +1 -1
- package/lib/engine-components/BoxHelperComponent.d.ts +1 -0
- package/lib/engine-components/BoxHelperComponent.js +1 -0
- package/lib/engine-components/BoxHelperComponent.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/Collider.d.ts +1 -1
- package/lib/engine-components/Collider.js +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/ContactShadows.d.ts +1 -1
- package/lib/engine-components/ContactShadows.js +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/Gizmos.d.ts +2 -0
- package/lib/engine-components/Gizmos.js +2 -0
- package/lib/engine-components/Gizmos.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/Joints.d.ts +6 -0
- package/lib/engine-components/Joints.js +6 -0
- package/lib/engine-components/Joints.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 +1 -0
- package/lib/engine-components/ReflectionProbe.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/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/gltf/GltfExport.d.ts +5 -0
- package/lib/engine-components/export/gltf/GltfExport.js +5 -0
- package/lib/engine-components/export/gltf/GltfExport.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +25 -3
- package/lib/engine-components/export/usdz/USDZExporter.js +37 -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 +1 -0
- package/lib/engine-components/timeline/PlayableDirector.js +1 -0
- 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/SpatialHtml.d.ts +7 -0
- package/lib/engine-components/ui/SpatialHtml.js +7 -0
- package/lib/engine-components/ui/SpatialHtml.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +3 -0
- package/lib/engine-components/ui/Text.js +3 -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 +4 -0
- 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 +20 -13
- package/plugins/types/needleConfig.d.ts +1 -1
- package/plugins/types/next.d.ts +1 -1
- package/plugins/types/userconfig.d.ts +4 -1
- package/plugins/vite/custom-element-data.js +80 -0
- package/plugins/vite/index.js +4 -0
- package/src/engine/api.ts +0 -1
- package/src/engine/debug/debug_spector.ts +43 -0
- package/src/engine/engine_application.ts +16 -1
- package/src/engine/engine_context.ts +5 -1
- package/src/engine/engine_license.ts +1 -1
- package/src/engine/engine_physics.ts +6 -2
- package/src/engine/engine_physics_rapier.ts +11 -2
- 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/webcomponents/logo-element.ts +12 -0
- package/src/engine/webcomponents/needle menu/needle-menu.ts +24 -3
- package/src/engine/webcomponents/needle-button.ts +6 -0
- package/src/engine/webcomponents/needle-engine.ts +331 -22
- package/src/engine/xr/NeedleXRSession.ts +3 -1
- package/src/engine-components/AlignmentConstraint.ts +8 -0
- package/src/engine-components/Animation.ts +2 -0
- package/src/engine-components/Animator.ts +2 -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/BasicIKConstraint.ts +8 -0
- package/src/engine-components/BoxHelperComponent.ts +1 -0
- package/src/engine-components/Camera.ts +1 -0
- package/src/engine-components/CharacterController.ts +4 -1
- package/src/engine-components/Collider.ts +1 -1
- package/src/engine-components/Component.ts +9 -1
- package/src/engine-components/ContactShadows.ts +1 -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/Gizmos.ts +2 -0
- package/src/engine-components/GridHelper.ts +2 -0
- package/src/engine-components/GroundProjection.ts +1 -0
- package/src/engine-components/Joints.ts +6 -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 +1 -0
- package/src/engine-components/RendererInstancing.ts +69 -33
- 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/gltf/GltfExport.ts +5 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +53 -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 +1 -0
- 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/SpatialHtml.ts +7 -0
- package/src/engine-components/ui/Text.ts +3 -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 +4 -0
- 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
- package/lib/engine/webcomponents/needle-engine.attributes.d.ts +0 -70
- package/lib/engine/webcomponents/needle-engine.attributes.js +0 -2
- package/lib/engine/webcomponents/needle-engine.attributes.js.map +0 -1
- package/src/engine/webcomponents/needle-engine.attributes.ts +0 -85
|
@@ -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,14 @@ 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
|
+
**/
|
|
7
15
|
export class AlignmentConstraint extends Behaviour {
|
|
8
16
|
|
|
9
17
|
@serializable(GameObject)
|
|
@@ -14,6 +14,7 @@ const debug = getParam("debuganimator");
|
|
|
14
14
|
/**
|
|
15
15
|
* Represents an event emitted by an animation mixer
|
|
16
16
|
* @category Animation and Sequencing
|
|
17
|
+
* @group Components
|
|
17
18
|
*/
|
|
18
19
|
export declare class MixerEvent {
|
|
19
20
|
/** The type of event that occurred */
|
|
@@ -42,6 +43,7 @@ export declare class PlayOptions {
|
|
|
42
43
|
* It works with an {@link AnimatorController} to handle state transitions and animation blending.
|
|
43
44
|
* A new AnimatorController can be created from code via `AnimatorController.createFromClips`.
|
|
44
45
|
*
|
|
46
|
+
* @summary Animation controller and playback component
|
|
45
47
|
* @category Animation and Sequencing
|
|
46
48
|
* @group Components
|
|
47
49
|
*/
|
|
@@ -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
|
*/
|
|
@@ -3,6 +3,14 @@ import { Vector3 } from "three";
|
|
|
3
3
|
import * as utils from "./../engine/engine_three_utils.js";
|
|
4
4
|
import { Behaviour, GameObject } from "./Component.js";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* BasicIKConstraint positions the GameObject between two target GameObjects (`from` and `to`) with an optional `hint` GameObject to guide the bending direction.
|
|
8
|
+
* This is useful for simple inverse kinematics setups, such as positioning a joint in a limb.
|
|
9
|
+
*
|
|
10
|
+
* @summary Simple Inverse Kinematics Constraint
|
|
11
|
+
* @category Animation
|
|
12
|
+
* @group Components
|
|
13
|
+
*/
|
|
6
14
|
export class BasicIKConstraint extends Behaviour {
|
|
7
15
|
|
|
8
16
|
private from!: GameObject;
|
|
@@ -14,6 +14,7 @@ const debug = getParam("debugboxhelper");
|
|
|
14
14
|
* Debug mode can be enabled with the URL parameter `?debugboxhelper`, which will visualize intersection tests.
|
|
15
15
|
* Helper visualization can be enabled with the URL parameter `?gizmos`.
|
|
16
16
|
*
|
|
17
|
+
* @summary Bounding box helper with intersection tests
|
|
17
18
|
* @category Helpers
|
|
18
19
|
* @group Components
|
|
19
20
|
*/
|
|
@@ -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 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 {
|
|
@@ -22,7 +22,7 @@ import { Rigidbody } from "./RigidBody.js";
|
|
|
22
22
|
* - Example: https://samples.needle.tools/physics-playground
|
|
23
23
|
* - Example: https://samples.needle.tools/physics-&-animation
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* @summary Physics collider
|
|
26
26
|
* @category Physics
|
|
27
27
|
* @group Components
|
|
28
28
|
*/
|
|
@@ -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
|
/**
|
|
@@ -53,7 +53,7 @@ type FitParameters = {
|
|
|
53
53
|
*
|
|
54
54
|
* ContactShadows can also be enabled on the `<needle-engine>` web component directly by adding the `contactshadows` attribute. The value of the attribute will be used as opacity and darkness of the shadows: `<needle-engine contactshadows="0.7">`.
|
|
55
55
|
*
|
|
56
|
-
*
|
|
56
|
+
* @summary Display contact shadows on the ground
|
|
57
57
|
* @category Rendering
|
|
58
58
|
* @group Components
|
|
59
59
|
*/
|
|
@@ -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
|
*/
|
|
@@ -8,6 +8,8 @@ import { Behaviour } from "./Component.js";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* BoxGizmo is a component that displays a box around the object in the scene. It can optionally expand to the object's bounds.
|
|
11
|
+
*
|
|
12
|
+
* @summary Display a box around the object
|
|
11
13
|
* @category Helpers
|
|
12
14
|
* @group Components
|
|
13
15
|
*/
|
|
@@ -4,6 +4,12 @@ import { serializable } from "../engine/engine_serialization.js";
|
|
|
4
4
|
import { Behaviour } from "./Component.js";
|
|
5
5
|
import { Rigidbody } from "./RigidBody.js";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Base class for physics joints connecting two rigid bodies.
|
|
9
|
+
* @summary Connect two Rigidbodies
|
|
10
|
+
* @category Physics
|
|
11
|
+
* @group Components
|
|
12
|
+
*/
|
|
7
13
|
export abstract class Joint extends Behaviour {
|
|
8
14
|
@serializable(Rigidbody)
|
|
9
15
|
connectedBody?: Rigidbody;
|
|
@@ -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
|
|
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
|
*/
|
|
@@ -29,8 +29,9 @@ export class InstancingHandler {
|
|
|
29
29
|
* (The instancing mesh renderer will grow x2 if the max instance count is reached)
|
|
30
30
|
* @default 4
|
|
31
31
|
* @returns The initial instance count
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
*/
|
|
33
|
+
// @ts-ignore (ignore the unused parameter warning)
|
|
34
|
+
static getStartInstanceCount = (obj: Object3D) => {
|
|
34
35
|
return 4;
|
|
35
36
|
};
|
|
36
37
|
|
|
@@ -45,20 +46,24 @@ export class InstancingHandler {
|
|
|
45
46
|
if (res) {
|
|
46
47
|
if (handlesArray === null) handlesArray = [];
|
|
47
48
|
handlesArray.push(res);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
NEEDLE_progressive.assignMeshLOD(mesh, 0).then(lod => {
|
|
57
|
-
if (lod && renderer.activeAndEnabled && geometry != lod) {
|
|
58
|
-
res.setGeometry(lod);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
49
|
+
|
|
50
|
+
// Load LOD for textures
|
|
51
|
+
const mat = res.object.material;
|
|
52
|
+
if(Array.isArray(mat)) {
|
|
53
|
+
mat.forEach(m => NEEDLE_progressive.assignTextureLOD(m, 0));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
NEEDLE_progressive.assignTextureLOD(mat, 0);
|
|
61
57
|
}
|
|
58
|
+
|
|
59
|
+
// Load LOD for geometry
|
|
60
|
+
const mesh = res.object;
|
|
61
|
+
const geometry = mesh.geometry;
|
|
62
|
+
NEEDLE_progressive.assignMeshLOD(mesh, 0).then(lod => {
|
|
63
|
+
if (lod && geometry != lod) {
|
|
64
|
+
res.setGeometry(lod);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
else if (level <= 0 && obj.type !== "Mesh") {
|
|
@@ -349,7 +354,7 @@ class InstancedMeshRenderer {
|
|
|
349
354
|
private _context: Context;
|
|
350
355
|
private _batchedMesh: BatchedMesh;
|
|
351
356
|
private _handles: (InstanceHandle | null)[] = [];
|
|
352
|
-
private
|
|
357
|
+
private _geometryIds = new WeakMap<BufferGeometry, number>();
|
|
353
358
|
private _maxInstanceCount: number;
|
|
354
359
|
|
|
355
360
|
private _currentInstanceCount = 0;
|
|
@@ -439,6 +444,10 @@ class InstancedMeshRenderer {
|
|
|
439
444
|
private _needUpdateBounds: boolean = false;
|
|
440
445
|
private _debugMaterial: MeshStandardMaterial | null = null;
|
|
441
446
|
|
|
447
|
+
private getBatchedMeshName() {
|
|
448
|
+
return this.name ? `${this.name} (BatchedMesh)` : "BatchedMesh";
|
|
449
|
+
}
|
|
450
|
+
|
|
442
451
|
constructor(name: string, geo: BufferGeometry, material: Material, initialMaxCount: number, context: Context) {
|
|
443
452
|
this.name = name;
|
|
444
453
|
this.geometry = geo;
|
|
@@ -452,6 +461,7 @@ class InstancedMeshRenderer {
|
|
|
452
461
|
this._maxVertexCount = estimate.vertexCount;
|
|
453
462
|
this._maxIndexCount = estimate.indexCount;
|
|
454
463
|
this._batchedMesh = new BatchedMesh(this._maxInstanceCount, this._maxVertexCount, this._maxIndexCount, this._debugMaterial ?? this.material);
|
|
464
|
+
this._batchedMesh.name = this.getBatchedMeshName();
|
|
455
465
|
// this.inst = new InstancedMesh(geo, material, count);
|
|
456
466
|
this._batchedMesh[$instancingAutoUpdateBounds] = true;
|
|
457
467
|
// this.inst.count = 0;
|
|
@@ -475,7 +485,7 @@ class InstancedMeshRenderer {
|
|
|
475
485
|
context.post_render_callbacks.push(this.onAfterRender);
|
|
476
486
|
|
|
477
487
|
if (debugInstancing) {
|
|
478
|
-
console.log(`Instanced renderer created with ${this._maxInstanceCount} instances, ${this._maxVertexCount} max vertices and ${this._maxIndexCount} max indices for \"${name}\"`)
|
|
488
|
+
console.log(`Instanced renderer (${this.name}) created with ${this._maxInstanceCount} instances, ${this._maxVertexCount} max vertices and ${this._maxIndexCount} max indices for \"${name}\"`)
|
|
479
489
|
}
|
|
480
490
|
}
|
|
481
491
|
|
|
@@ -522,7 +532,8 @@ class InstancedMeshRenderer {
|
|
|
522
532
|
return false;
|
|
523
533
|
}
|
|
524
534
|
|
|
525
|
-
|
|
535
|
+
const newInstanceCount = this._currentInstanceCount + 1;
|
|
536
|
+
if (newInstanceCount > this._maxInstanceCount || this.mustGrow(geo)) {
|
|
526
537
|
if (this.allowResize) {
|
|
527
538
|
this.grow(geo);
|
|
528
539
|
}
|
|
@@ -644,34 +655,42 @@ class InstancedMeshRenderer {
|
|
|
644
655
|
private mustGrow(geo?: BufferGeometry): boolean {
|
|
645
656
|
if (this.count >= this._maxInstanceCount) return true;
|
|
646
657
|
if (!geo || !geo.attributes) return false;
|
|
658
|
+
|
|
659
|
+
const isKnownGeometry = this._geometryIds.has(geo);
|
|
660
|
+
if (isKnownGeometry) return false;
|
|
661
|
+
|
|
647
662
|
const meshInfo = getMeshInformation(geo);
|
|
648
663
|
const newVertexCount = meshInfo.vertexCount;
|
|
649
664
|
const newIndexCount = meshInfo.indexCount;
|
|
650
665
|
return this._currentVertexCount + newVertexCount > this._maxVertexCount || this._currentIndexCount + newIndexCount > this._maxIndexCount;
|
|
651
666
|
}
|
|
652
667
|
|
|
668
|
+
private _growId = 0;
|
|
653
669
|
private grow(geometry: BufferGeometry) {
|
|
670
|
+
const id = ++this._growId;
|
|
654
671
|
const growFactor = 2;
|
|
655
672
|
const newSize = Math.ceil(this._maxInstanceCount * growFactor);
|
|
656
673
|
|
|
657
674
|
// create a new BatchedMesh instance
|
|
675
|
+
// TODO: we should keep track of how many instances for each geometry we have and consider that when estimating new space
|
|
658
676
|
const estimatedSpace = this.tryEstimateVertexCountSize(newSize, [geometry]);// geometry.attributes.position.count;
|
|
659
677
|
// const indices = geometry.index ? geometry.index.count : 0;
|
|
660
678
|
const newMaxVertexCount = Math.max(this._maxVertexCount, estimatedSpace.vertexCount);
|
|
661
|
-
const newMaxIndexCount = Math.max(this._maxIndexCount, estimatedSpace.indexCount
|
|
679
|
+
const newMaxIndexCount = Math.max(this._maxIndexCount, estimatedSpace.indexCount);//, Math.ceil(this._maxVertexCount * growFactor));
|
|
662
680
|
|
|
663
681
|
if (debugInstancing) {
|
|
664
682
|
const geometryInfo = getMeshInformation(geometry);
|
|
665
|
-
console.warn(`[Instancing] Growing Buffer\nMesh: \"${this.name}${geometry.name?.length ? "/" + geometry.name : ""}\"
|
|
683
|
+
console.warn(`[Instancing] Growing Buffer\nMesh: \"${this.name}${geometry.name?.length ? "/" + geometry.name : ""}\" (${geometryInfo.vertexCount.toLocaleString()} vertices, ${geometryInfo.indexCount.toLocaleString()} indices)\nMax count ${this._maxInstanceCount.toLocaleString()} → ${newSize.toLocaleString()}\nMax vertex count ${this._maxVertexCount.toLocaleString()} -> ${newMaxVertexCount.toLocaleString()}\nMax index count ${this._maxIndexCount.toLocaleString()} -> ${newMaxIndexCount.toLocaleString()}`);
|
|
666
684
|
this._debugMaterial = createDebugMaterial();
|
|
667
685
|
}
|
|
668
686
|
else if (isDevEnvironment()) {
|
|
669
|
-
console.debug(`[Instancing] Growing Buffer\nMesh: \"${this.name}${geometry.name?.length ? "/" + geometry.name : ""}\"\nMax count ${this._maxInstanceCount} → ${newSize}\nMax vertex count ${this._maxVertexCount} -> ${newMaxVertexCount}\nMax index count ${this._maxIndexCount} -> ${newMaxIndexCount}`);
|
|
687
|
+
console.debug(`[Instancing] Growing Buffer\nMesh: \"${this.name}${geometry.name?.length ? "/" + geometry.name : ""}\"\nMax count ${this._maxInstanceCount} → ${newSize}\nMax vertex count ${this._maxVertexCount.toLocaleString()} -> ${newMaxVertexCount.toLocaleString()}\nMax index count ${this._maxIndexCount.toLocaleString()} -> ${newMaxIndexCount.toLocaleString()}`);
|
|
670
688
|
}
|
|
671
689
|
|
|
672
690
|
this._maxVertexCount = newMaxVertexCount;
|
|
673
691
|
this._maxIndexCount = newMaxIndexCount;
|
|
674
692
|
const newInst = new BatchedMesh(newSize, this._maxVertexCount, this._maxIndexCount, this._debugMaterial ?? this.material);
|
|
693
|
+
newInst.name = this.getBatchedMeshName();
|
|
675
694
|
newInst.layers = this._batchedMesh.layers;
|
|
676
695
|
newInst.castShadow = this._batchedMesh.castShadow;
|
|
677
696
|
newInst.receiveShadow = this._batchedMesh.receiveShadow;
|
|
@@ -686,7 +705,7 @@ class InstancedMeshRenderer {
|
|
|
686
705
|
// dispose the old batched mesh
|
|
687
706
|
this._batchedMesh.dispose();
|
|
688
707
|
this._batchedMesh.removeFromParent();
|
|
689
|
-
this._geometryIds
|
|
708
|
+
this._geometryIds = new WeakMap<BufferGeometry, number>();
|
|
690
709
|
|
|
691
710
|
this._batchedMesh = newInst;
|
|
692
711
|
this._maxInstanceCount = newSize;
|
|
@@ -698,6 +717,11 @@ class InstancedMeshRenderer {
|
|
|
698
717
|
const original = [...this._handles];
|
|
699
718
|
this._handles = [];
|
|
700
719
|
for (const handle of original) {
|
|
720
|
+
if (id !== this._growId) {
|
|
721
|
+
// another grow happened in the meantime
|
|
722
|
+
if (debugInstancing) console.warn("[Instancing] Aborting grow since another grow happened in the meantime");
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
701
725
|
if (handle && handle.__instanceIndex >= 0) {
|
|
702
726
|
this.addGeometry(handle);
|
|
703
727
|
this._handles[handle.__instanceIndex] = handle;
|
|
@@ -722,23 +746,31 @@ class InstancedMeshRenderer {
|
|
|
722
746
|
entry.count += 1;
|
|
723
747
|
}
|
|
724
748
|
|
|
749
|
+
if (_newGeometries && _newGeometries?.length > 0) {
|
|
750
|
+
const index = _newGeometries.indexOf(handle.object.geometry as BufferGeometry);
|
|
751
|
+
if (index !== -1) {
|
|
752
|
+
_newGeometries.splice(index, 1);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
725
755
|
}
|
|
726
756
|
}
|
|
727
757
|
|
|
728
758
|
// then calculate the total vertex count
|
|
729
759
|
let totalVertices = 0;
|
|
730
760
|
let totalIndices = 0;
|
|
761
|
+
let totalGeometries = 0;
|
|
731
762
|
// let maxVertices = 0;
|
|
732
763
|
for (const [_geo, data] of usedGeometries) {
|
|
733
|
-
|
|
734
|
-
|
|
764
|
+
totalGeometries += 1;
|
|
765
|
+
totalVertices += data.vertexCount;
|
|
766
|
+
totalIndices += data.indexCount;
|
|
735
767
|
// maxVertices = Math.max(maxVertices, geo.attributes.position.count * count);
|
|
736
768
|
}
|
|
737
769
|
// we calculate the average to make an educated guess of how many vertices will be needed with the new buffer count
|
|
738
|
-
const averageVerts = Math.ceil(totalVertices / Math.max(1,
|
|
739
|
-
let maxVertexCount = averageVerts *
|
|
740
|
-
const averageIndices = Math.ceil(totalIndices / Math.max(1,
|
|
741
|
-
let maxIndexCount = averageIndices *
|
|
770
|
+
const averageVerts = Math.ceil(totalVertices / Math.max(1, totalGeometries));
|
|
771
|
+
let maxVertexCount = averageVerts * totalGeometries;
|
|
772
|
+
const averageIndices = Math.ceil(totalIndices / Math.max(1, totalGeometries));
|
|
773
|
+
let maxIndexCount = averageIndices * totalGeometries;
|
|
742
774
|
|
|
743
775
|
// if new geometries are provided we *know* that they will be added
|
|
744
776
|
// so we make sure to include them in the calculation
|
|
@@ -753,6 +785,10 @@ class InstancedMeshRenderer {
|
|
|
753
785
|
}
|
|
754
786
|
}
|
|
755
787
|
|
|
788
|
+
if (debugInstancing) {
|
|
789
|
+
console.log(`[Instancing] Estimated size for new buffer ${this.name}\nGeometries: ${totalGeometries} (New: ${_newGeometries?.length || 0})\nInstances: ${newMaxInstances}\nEstimated Vertices: ${maxVertexCount.toLocaleString()}\nEstimated Indices: ${maxIndexCount.toLocaleString()}`);
|
|
790
|
+
}
|
|
791
|
+
|
|
756
792
|
return { vertexCount: maxVertexCount, indexCount: maxIndexCount };
|
|
757
793
|
}
|
|
758
794
|
|
|
@@ -770,16 +806,16 @@ class InstancedMeshRenderer {
|
|
|
770
806
|
let geometryId = this._geometryIds.get(geo);
|
|
771
807
|
if (geometryId === undefined || geometryId === null) {
|
|
772
808
|
if (debugInstancing)
|
|
773
|
-
console.
|
|
809
|
+
console.warn(`[Instancing] > ADD NEW GEOMETRY \"${handle.name} (${geo.name}; ${geo.uuid})\"\nCurrent Instances: ${this._currentInstanceCount}\nMax Vertices: ${handle.maxVertexCount.toLocaleString()}\nMax Indices: ${handle.maxIndexCount.toLocaleString()}\nMax Triangles: ${(handle.maxIndexCount / 3).toLocaleString()}`);
|
|
774
810
|
|
|
775
811
|
geometryId = this._batchedMesh.addGeometry(geo, handle.maxVertexCount, handle.maxIndexCount);
|
|
776
812
|
this._geometryIds.set(geo, geometryId);
|
|
813
|
+
this._currentVertexCount += handle.maxVertexCount;
|
|
814
|
+
this._currentIndexCount += handle.maxIndexCount;
|
|
777
815
|
}
|
|
778
816
|
else {
|
|
779
817
|
if (debugInstancing === "verbose") console.log(`[Instancing] > ADD INSTANCE \"${handle.name}\"\nGEOMETRY_ID=${geometryId}\n${this._currentInstanceCount} instances`);
|
|
780
818
|
}
|
|
781
|
-
this._currentVertexCount += handle.maxVertexCount;
|
|
782
|
-
this._currentIndexCount += handle.maxIndexCount;
|
|
783
819
|
const i = this._batchedMesh.addInstance(geometryId);
|
|
784
820
|
handle.__geometryIndex = geometryId;
|
|
785
821
|
handle.__instanceIndex = i;
|
|
@@ -787,7 +823,7 @@ class InstancedMeshRenderer {
|
|
|
787
823
|
handle.__reservedIndexRange = handle.maxIndexCount;
|
|
788
824
|
this._batchedMesh.setMatrixAt(i, handle.object.matrixWorld);
|
|
789
825
|
if (debugInstancing)
|
|
790
|
-
console.debug(`[Instancing] > ADDED INSTANCE \"${handle.name}\"\nGEOMETRY_ID=${geometryId}\n${this._currentInstanceCount} instances\nIndex: ${handle.__instanceIndex}`);
|
|
826
|
+
console.debug(`[Instancing] > ADDED INSTANCE \"${handle.name}\"\nGEOMETRY_ID=${geometryId}\n${this._currentInstanceCount} instances\nIndex: ${handle.__instanceIndex}\nVertices: ${this._currentVertexCount.toLocaleString()}/${this._maxVertexCount.toLocaleString()},\nIndices: ${this._currentIndexCount.toLocaleString()}/${this._maxIndexCount.toLocaleString()}`);
|
|
791
827
|
|
|
792
828
|
}
|
|
793
829
|
|
|
@@ -803,7 +839,7 @@ class InstancedMeshRenderer {
|
|
|
803
839
|
// this.inst.deleteGeometry(handle.__instanceIndex);
|
|
804
840
|
// else
|
|
805
841
|
// this._batchedMesh.setVisibleAt(handle.__instanceIndex, false);
|
|
806
|
-
if(debugInstancing) {
|
|
842
|
+
if (debugInstancing) {
|
|
807
843
|
console.debug(`[Instancing] < REMOVE INSTANCE \"${handle.name}\" at [${handle.__instanceIndex}]\nGEOMETRY_ID=${handle.__geometryIndex}\n${this._currentInstanceCount} instances\nIndex: ${handle.__instanceIndex}`);
|
|
808
844
|
}
|
|
809
845
|
this._batchedMesh.deleteInstance(handle.__instanceIndex);
|
|
@@ -140,6 +140,7 @@ class TransformWatch {
|
|
|
140
140
|
* - Example: https://samples.needle.tools/physics-playground
|
|
141
141
|
* - Example: https://samples.needle.tools/physics-&-animation
|
|
142
142
|
*
|
|
143
|
+
* @summary Rigidbody for physical interactions
|
|
143
144
|
* @category Physics
|
|
144
145
|
* @group Components
|
|
145
146
|
*/
|