@needle-tools/engine 4.15.0-next.f391a30 → 4.16.0-next.0798cbb
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 +32 -0
- package/README.md +92 -46
- package/SKILL.md +240 -0
- package/components.needle.json +1 -1
- package/dist/{gltf-progressive-DYL3SLVb.min.js → gltf-progressive-DQa78GTA.min.js} +1 -1
- package/dist/{gltf-progressive-CMwJPwEt.umd.cjs → gltf-progressive-LOFTyzy4.umd.cjs} +1 -1
- package/dist/{gltf-progressive-CTlvpS3A.js → gltf-progressive-_wvokUUu.js} +3 -3
- package/dist/{materialx-NDD0y4JY.umd.cjs → materialx-BrPdNmQT.umd.cjs} +1 -1
- package/dist/{materialx-4jJLLe9Q.js → materialx-CT8J50pg.js} +2 -2
- package/dist/{materialx-Bt9FHwco.min.js → materialx-D_ofN96q.min.js} +1 -1
- package/dist/{needle-engine.bundle-DsTdfmeb.min.js → needle-engine.bundle-D-KMaXfY.min.js} +109 -111
- package/dist/{needle-engine.bundle-C1BFRZDF.umd.cjs → needle-engine.bundle-DEWMFvfK.umd.cjs} +114 -116
- package/dist/{needle-engine.bundle-DB4kLWO_.js → needle-engine.bundle-Dz6Tag-6.js} +3209 -3206
- package/dist/needle-engine.d.ts +48 -320
- package/dist/needle-engine.js +4 -4
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-De9ZpJrk.js → postprocessing-C-WOZQC5.js} +2 -2
- package/dist/{postprocessing-DYmYOVm4.umd.cjs → postprocessing-CtXfLXvp.umd.cjs} +1 -1
- package/dist/{postprocessing-BN-f4viE.min.js → postprocessing-DXm8YKbQ.min.js} +1 -1
- package/dist/{three-examples-C0ZCCA_K.js → three-examples.js} +1 -1
- package/dist/{three-examples-DmTY8tGr.min.js → three-examples.min.js} +1 -1
- package/dist/{three-examples-BHqRVpO_.umd.cjs → three-examples.umd.cjs} +1 -1
- package/dist/{three-mesh-ui-BlakAItG.js → three-mesh-ui-B-lqrZWj.js} +1 -1
- package/dist/{three-mesh-ui-D828VbQp.umd.cjs → three-mesh-ui-Chib781Y.umd.cjs} +1 -1
- package/dist/{three-mesh-ui-5HVE2RV-.min.js → three-mesh-ui-n3JU4M2W.min.js} +1 -1
- package/dist/{three-BjYim-vL.umd.cjs → three.umd.cjs} +1 -1
- package/dist/{vendor-ixwD-vv2.js → vendor-BsRxp-FT.js} +1 -1
- package/dist/{vendor-CIDkyBaO.umd.cjs → vendor-BwxpsdCm.umd.cjs} +1 -1
- package/dist/{vendor-BxK0WKmT.min.js → vendor-DZ45lcA8.min.js} +1 -1
- package/lib/asap/needle-asap.js.map +1 -1
- package/lib/asap/sessiongranted.js.map +1 -1
- package/lib/engine/analytics/index.d.ts +1 -1
- package/lib/engine/analytics/lcp.js.map +1 -1
- package/lib/engine/assets/index.js.map +1 -1
- package/lib/engine/debug/debug.d.ts +4 -4
- package/lib/engine/debug/debug.js +6 -6
- package/lib/engine/debug/debug.js.map +1 -1
- package/lib/engine/debug/debug_console.js.map +1 -1
- package/lib/engine/debug/debug_overlay.d.ts +16 -1
- package/lib/engine/debug/debug_overlay.js +47 -10
- package/lib/engine/debug/debug_overlay.js.map +1 -1
- package/lib/engine/debug/debug_spatial_console.js.map +1 -1
- package/lib/engine/debug/debug_spector.js.map +1 -1
- package/lib/engine/engine_accessibility.js.map +1 -1
- package/lib/engine/engine_addressables.d.ts +6 -3
- package/lib/engine/engine_addressables.js +10 -3
- package/lib/engine/engine_addressables.js.map +1 -1
- package/lib/engine/engine_animation.js.map +1 -1
- package/lib/engine/engine_application.d.ts +0 -7
- package/lib/engine/engine_application.js.map +1 -1
- package/lib/engine/engine_assetdatabase.js.map +1 -1
- package/lib/engine/engine_audio.js.map +1 -1
- package/lib/engine/engine_camera.fit.js.map +1 -1
- package/lib/engine/engine_camera.js.map +1 -1
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_components_internal.js.map +1 -1
- package/lib/engine/engine_constants.js.map +1 -1
- package/lib/engine/engine_context.d.ts +0 -1
- package/lib/engine/engine_context.js +1 -1
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_context_registry.js.map +1 -1
- package/lib/engine/engine_coroutine.js.map +1 -1
- package/lib/engine/engine_create_objects.js.map +1 -1
- package/lib/engine/engine_editor-sync.d.ts +1 -1
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_generic_utils.js.map +1 -1
- package/lib/engine/engine_gizmos.js.map +1 -1
- package/lib/engine/engine_gltf.js.map +1 -1
- package/lib/engine/engine_gltf_builtin_components.js +2 -2
- package/lib/engine/engine_gltf_builtin_components.js.map +1 -1
- package/lib/engine/engine_hot_reload.js.map +1 -1
- package/lib/engine/engine_input.d.ts +0 -1
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_instancing.js.map +1 -1
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_lifecycle_functions_internal.js.map +1 -1
- package/lib/engine/engine_lightdata.js.map +1 -1
- package/lib/engine/engine_loaders.callbacks.js.map +1 -1
- package/lib/engine/engine_loaders.d.ts +7 -4
- package/lib/engine/engine_loaders.gltf.js.map +1 -1
- package/lib/engine/engine_loaders.js +7 -4
- package/lib/engine/engine_loaders.js.map +1 -1
- package/lib/engine/engine_lods.js.map +1 -1
- package/lib/engine/engine_mainloop_utils.d.ts +0 -1
- package/lib/engine/engine_mainloop_utils.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.js.map +1 -1
- package/lib/engine/engine_math.js.map +1 -1
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_networking_auto.js.map +1 -1
- package/lib/engine/engine_networking_blob.js.map +1 -1
- package/lib/engine/engine_networking_files.js.map +1 -1
- package/lib/engine/engine_networking_instantiate.js.map +1 -1
- package/lib/engine/engine_networking_peer.js.map +1 -1
- package/lib/engine/engine_networking_streams.js +2 -0
- package/lib/engine/engine_networking_streams.js.map +1 -1
- package/lib/engine/engine_patcher.js.map +1 -1
- package/lib/engine/engine_physics.d.ts +2 -2
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_playerview.js.map +1 -1
- package/lib/engine/engine_pmrem.js.map +1 -1
- package/lib/engine/engine_scenelighting.d.ts +1 -1
- package/lib/engine/engine_scenelighting.js.map +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
- package/lib/engine/engine_serialization_core.js.map +1 -1
- package/lib/engine/engine_serialization_decorator.d.ts +2 -2
- package/lib/engine/engine_serialization_decorator.js.map +1 -1
- package/lib/engine/engine_shaders.js.map +1 -1
- package/lib/engine/engine_shims.js.map +1 -1
- package/lib/engine/engine_texture.js.map +1 -1
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_time_utils.js.map +1 -1
- package/lib/engine/engine_tonemapping.js.map +1 -1
- package/lib/engine/engine_types.d.ts +0 -1
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/engine_typestore.js.map +1 -1
- package/lib/engine/engine_util_decorator.js +1 -1
- package/lib/engine/engine_util_decorator.js.map +1 -1
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/engine_utils_attributes.js.map +1 -1
- package/lib/engine/engine_utils_format.js.map +1 -1
- package/lib/engine/engine_utils_qrcode.js.map +1 -1
- package/lib/engine/engine_utils_screenshot.js.map +1 -1
- package/lib/engine/engine_utils_screenshot.xr.js.map +1 -1
- package/lib/engine/export/gltf/EXT_mesh_gpu_instancing_exporter.js.map +1 -1
- package/lib/engine/export/gltf/Writers.js.map +1 -1
- package/lib/engine/export/gltf/index.js.map +1 -1
- package/lib/engine/export/state.js.map +1 -1
- package/lib/engine/extensions/EXT_texture_exr.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_components.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_gameobject_data.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lighting_settings.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lightmaps.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_materialx.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_persistent_assets.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_render_objects.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_techniques_webgl.js.map +1 -1
- package/lib/engine/extensions/extension_utils.js.map +1 -1
- package/lib/engine/extensions/extensions.js.map +1 -1
- package/lib/engine/extensions/usage_tracker.js.map +1 -1
- package/lib/engine/js-extensions/ExtensionUtils.js.map +1 -1
- package/lib/engine/js-extensions/Object3D.js.map +1 -1
- package/lib/engine/js-extensions/RGBAColor.js.map +1 -1
- package/lib/engine/js-extensions/Vector.js.map +1 -1
- package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js.map +1 -1
- package/lib/engine/shaders/shaderData.d.ts +6 -6
- package/lib/engine/tests/test_utils.js.map +1 -1
- package/lib/engine/webcomponents/WebXRButtons.d.ts +0 -1
- package/lib/engine/webcomponents/WebXRButtons.js.map +1 -1
- package/lib/engine/webcomponents/buttons.js.map +1 -1
- package/lib/engine/webcomponents/fonts.js.map +1 -1
- package/lib/engine/webcomponents/icons.js.map +1 -1
- package/lib/engine/webcomponents/logo-element.d.ts +3 -6
- package/lib/engine/webcomponents/logo-element.js +0 -18
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +7 -10
- package/lib/engine/webcomponents/needle menu/needle-menu.js +4 -16
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.ar-overlay.d.ts +0 -1
- package/lib/engine/webcomponents/needle-engine.ar-overlay.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +0 -4
- package/lib/engine/webcomponents/needle-engine.js +1 -11
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
- package/lib/engine/xr/NeedleXRController.d.ts +0 -1
- package/lib/engine/xr/NeedleXRController.js +1 -1
- package/lib/engine/xr/NeedleXRController.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.d.ts +0 -1
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine/xr/NeedleXRSync.d.ts +0 -1
- package/lib/engine/xr/NeedleXRSync.js.map +1 -1
- package/lib/engine/xr/SceneTransition.js.map +1 -1
- package/lib/engine/xr/TempXRContext.d.ts +0 -1
- package/lib/engine/xr/TempXRContext.js.map +1 -1
- package/lib/engine/xr/events.js.map +1 -1
- package/lib/engine/xr/internal.js.map +1 -1
- package/lib/engine/xr/usdz.js.map +1 -1
- package/lib/engine/xr/utils.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/AnimationCurve.js.map +1 -1
- package/lib/engine-components/AnimationUtils.js.map +1 -1
- package/lib/engine-components/AnimationUtilsAutoplay.js.map +1 -1
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AnimatorController.js +1 -1
- package/lib/engine-components/AnimatorController.js.map +1 -1
- package/lib/engine-components/AudioListener.js.map +1 -1
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/AvatarLoader.js.map +1 -1
- package/lib/engine-components/AxesHelper.js.map +1 -1
- package/lib/engine-components/BoxHelperComponent.js.map +1 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CameraUtils.js.map +1 -1
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Component.d.ts +0 -1
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/ContactShadows.d.ts +0 -1
- package/lib/engine-components/ContactShadows.js.map +1 -1
- package/lib/engine-components/DeleteBox.js.map +1 -1
- package/lib/engine-components/DeviceFlag.js.map +1 -1
- package/lib/engine-components/DragControls.js +10 -0
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.js +8 -1
- package/lib/engine-components/Duplicatable.js.map +1 -1
- package/lib/engine-components/EventList.js.map +1 -1
- package/lib/engine-components/EventTrigger.js.map +1 -1
- package/lib/engine-components/Gizmos.js.map +1 -1
- package/lib/engine-components/GridHelper.js.map +1 -1
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/LODGroup.js.map +1 -1
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/Networking.js.map +1 -1
- package/lib/engine-components/OffsetConstraint.js.map +1 -1
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/PlayerColor.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/Renderer.js +2 -1
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RendererInstancing.js.map +1 -1
- package/lib/engine-components/RendererLightmap.js.map +1 -1
- package/lib/engine-components/RigidBody.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/ShadowCatcher.js.map +1 -1
- package/lib/engine-components/Skybox.js.map +1 -1
- package/lib/engine-components/SmoothFollow.js.map +1 -1
- package/lib/engine-components/SpatialTrigger.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SpriteRenderer.js.map +1 -1
- package/lib/engine-components/SyncedCamera.js.map +1 -1
- package/lib/engine-components/SyncedRoom.js +1 -1
- package/lib/engine-components/SyncedRoom.js.map +1 -1
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/TestRunner.js.map +1 -1
- package/lib/engine-components/TransformGizmo.js.map +1 -1
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/Voip.js.map +1 -1
- package/lib/engine-components/avatar/AvatarBlink_Simple.js.map +1 -1
- package/lib/engine-components/avatar/AvatarEyeLook_Rotation.js.map +1 -1
- package/lib/engine-components/avatar/Avatar_Brain_LookAt.js.map +1 -1
- package/lib/engine-components/avatar/Avatar_MouthShapes.js.map +1 -1
- package/lib/engine-components/avatar/Avatar_MustacheShake.js.map +1 -1
- package/lib/engine-components/debug/LogStats.js.map +1 -1
- package/lib/engine-components/export/gltf/GltfExport.js +1 -1
- package/lib/engine-components/export/gltf/GltfExport.js.map +1 -1
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.d.ts +1 -1
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js +23 -23
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/Animation.d.ts +2 -2
- package/lib/engine-components/export/usdz/extensions/Animation.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/NodeMaterialConverter.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/USDZText.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/USDZUI.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/Actions.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/AudioExtension.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/Behaviour.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehavioursBuilder.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/PhysicsExtension.js.map +1 -1
- package/lib/engine-components/export/usdz/utils/animationutils.js.map +1 -1
- package/lib/engine-components/export/usdz/utils/quicklook.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystemModules.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystemSubEmitter.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Antialiasing.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/BloomEffect.js +2 -2
- package/lib/engine-components/postprocessing/Effects/BloomEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Pixelation.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js +2 -2
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.utils.d.ts +3 -3
- package/lib/engine-components/postprocessing/Effects/Tonemapping.utils.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
- package/lib/engine-components/postprocessing/Volume.js.map +1 -1
- package/lib/engine-components/postprocessing/VolumeParameter.js.map +1 -1
- package/lib/engine-components/postprocessing/VolumeProfile.js.map +1 -1
- package/lib/engine-components/postprocessing/utils.js.map +1 -1
- package/lib/engine-components/splines/Spline.js.map +1 -1
- package/lib/engine-components/splines/SplineWalker.js.map +1 -1
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/timeline/SignalAsset.js.map +1 -1
- package/lib/engine-components/timeline/TimelineTracks.js.map +1 -1
- package/lib/engine-components/ui/BaseUIComponent.js.map +1 -1
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/CanvasGroup.js.map +1 -1
- package/lib/engine-components/ui/EventSystem.js.map +1 -1
- package/lib/engine-components/ui/Graphic.js.map +1 -1
- package/lib/engine-components/ui/Image.js.map +1 -1
- package/lib/engine-components/ui/InputField.js.map +1 -1
- package/lib/engine-components/ui/Layout.js.map +1 -1
- package/lib/engine-components/ui/PointerEvents.d.ts +0 -1
- package/lib/engine-components/ui/PointerEvents.js.map +1 -1
- package/lib/engine-components/ui/RaycastUtils.js.map +1 -1
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/ui/RectTransform.js +2 -2
- package/lib/engine-components/ui/RectTransform.js.map +1 -1
- package/lib/engine-components/ui/SpatialHtml.js.map +1 -1
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/ui/Utils.js.map +1 -1
- package/lib/engine-components/utils/EnvironmentScene.js.map +1 -1
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/utils/OpenURL.js.map +1 -1
- package/lib/engine-components/web/Clickthrough.js.map +1 -1
- package/lib/engine-components/web/CursorFollow.js.map +1 -1
- package/lib/engine-components/web/HoverAnimation.js.map +1 -1
- package/lib/engine-components/web/ScrollFollow.js.map +1 -1
- package/lib/engine-components/web/ViewBox.js +2 -1
- package/lib/engine-components/web/ViewBox.js.map +1 -1
- package/lib/engine-components/webxr/Avatar.js.map +1 -1
- package/lib/engine-components/webxr/WebARCameraBackground.d.ts +0 -1
- package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
- package/lib/engine-components/webxr/WebARSessionRoot.d.ts +0 -1
- package/lib/engine-components/webxr/WebARSessionRoot.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +0 -1
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.d.ts +0 -1
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/lib/engine-components/webxr/WebXRPlaneTracking.d.ts +2 -3
- package/lib/engine-components/webxr/WebXRPlaneTracking.js.map +1 -1
- package/lib/engine-components/webxr/WebXRRig.d.ts +0 -1
- package/lib/engine-components/webxr/WebXRRig.js.map +1 -1
- package/lib/engine-components/webxr/XRFlag.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerFollow.d.ts +0 -1
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerModel.d.ts +0 -1
- package/lib/engine-components/webxr/controllers/XRControllerModel.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
- package/lib/engine-components-experimental/Presentation.js.map +1 -1
- package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -1
- package/lib/engine-schemes/schemes.js.map +1 -1
- package/lib/needle-engine.js.map +1 -1
- package/package.json +7 -5
- package/plugins/common/buildinfo.js +1 -1
- package/plugins/common/license.js +5 -6
- package/plugins/common/logger.js +104 -14
- package/plugins/types/userconfig.d.ts +2 -0
- package/plugins/vite/ai.js +4 -18
- package/plugins/vite/alias.js +0 -13
- package/plugins/vite/asap.js +1 -1
- package/plugins/vite/build-pipeline.js +2 -5
- package/plugins/vite/buildinfo.js +9 -9
- package/plugins/vite/copyfiles.js +19 -16
- package/plugins/vite/custom-element-data.js +4 -4
- package/plugins/vite/dependencies.js +45 -18
- package/plugins/vite/dependency-watcher.js +10 -8
- package/plugins/vite/imports-logger.js +14 -12
- package/plugins/vite/local-files-analysis.js +10 -12
- package/plugins/vite/local-files-core.js +8 -8
- package/plugins/vite/local-files-types.d.ts +49 -11
- package/plugins/vite/local-files-utils.js +14 -10
- package/plugins/vite/logger.client.js +4 -4
- package/plugins/vite/logger.js +7 -7
- package/plugins/vite/logging.js +26 -3
- package/plugins/vite/pwa.js +6 -5
- package/plugins/vite/reload.js +27 -24
- package/src/asap/needle-asap.ts +1 -1
- package/src/engine/debug/debug.ts +8 -7
- package/src/engine/debug/debug_overlay.ts +66 -12
- package/src/engine/debug/debug_spector.ts +1 -1
- package/src/engine/engine_addressables.ts +11 -3
- package/src/engine/engine_application.ts +0 -7
- package/src/engine/engine_context.ts +1 -1
- package/src/engine/engine_gltf_builtin_components.ts +1 -1
- package/src/engine/engine_loaders.ts +7 -4
- package/src/engine/engine_networking_streams.ts +1 -0
- package/src/engine/engine_util_decorator.ts +2 -2
- package/src/engine/webcomponents/logo-element.ts +3 -20
- package/src/engine/webcomponents/needle menu/needle-menu.ts +11 -25
- package/src/engine/webcomponents/needle-engine.ts +1 -13
- package/src/engine-components/DragControls.ts +14 -0
- package/src/engine-components/Duplicatable.ts +9 -1
- package/src/engine-components/Renderer.ts +2 -1
- package/src/engine-components/SyncedRoom.ts +1 -1
- package/src/engine-components/export/usdz/USDZExporter.ts +1 -1
- /package/dist/{three-Bvk2VKbF.js → three.js} +0 -0
- /package/dist/{three-IG2qPafA.min.js → three.min.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,38 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [4.16.0] - 2026-03-05
|
|
8
|
+
- **NEW**: `makeFilesLocal` build option overhauled — builds can now be fully self-contained and work offline. The plugin downloads external CDN assets at build time and bundles them locally. This is essential for playable ads, app stores that require single-origin or self-contained bundles, offline-capable PWAs, and restricted hosting environments. Supports auto-detection of used features, per-feature opt-in/opt-out, and platform presets. Covers Draco decoders, KTX2 transcoders, MaterialX, WebXR input profiles, skybox/environment textures, Google Fonts, third-party scripts, and more.
|
|
9
|
+
Example in `vite.config.js`:
|
|
10
|
+
```js
|
|
11
|
+
needlePlugin({
|
|
12
|
+
makeFilesLocal: "auto" // auto-detect and download only what your project uses
|
|
13
|
+
})
|
|
14
|
+
// or with fine-grained control:
|
|
15
|
+
needlePlugin({
|
|
16
|
+
makeFilesLocal: {
|
|
17
|
+
enabled: true,
|
|
18
|
+
features: ["draco", "ktx2", "fonts"],
|
|
19
|
+
excludeFeatures: ["xr"]
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
- Add: `showBalloonMessage` now supports `duration`, `once`, and `key` options for controlling message display duration and updating existing messages
|
|
24
|
+
- Add: `needleAI` vite plugin — when using Claude Code in a Needle Engine project, the engine automatically provides a project-aware AI skill with Needle Engine context
|
|
25
|
+
- Add: DragControls now warns when used on static objects that won't update their transforms
|
|
26
|
+
- Add: AR overlay support for AppClip sessions
|
|
27
|
+
- Improve: Stable three.js chunk names in production builds, enabling CDN import maps with predictable URLs
|
|
28
|
+
- Improve: USDZ export now uses `"string"` type for input variable names for better spec compatibility
|
|
29
|
+
- Improve: Gizmo rendering uses consistent font from CDN
|
|
30
|
+
- Improve: needle-menu layout with correct padding and minimum width for icon-only elements
|
|
31
|
+
- Improve: Vite project template aligned with online template
|
|
32
|
+
- Improve: Updated MaterialX dependency
|
|
33
|
+
- Improve: JSDoc documentation
|
|
34
|
+
- Fix: ReflectionProbe support for Blender workflows
|
|
35
|
+
- Fix: Mac build error ("-50" error)
|
|
36
|
+
- Fix: PWA defaults when package name is missing
|
|
37
|
+
- Fix: Improved error handling in MaterialX importer
|
|
38
|
+
|
|
7
39
|
## [4.15.0] - 2026-02-27
|
|
8
40
|
- **NEW**: Accessibility support with screen reader overlay. The engine now maintains a visually-hidden DOM tree mirroring 3D scene objects with ARIA roles and labels. Components like Button, Text, DragControls, and USDZ behavior components automatically register accessible elements.
|
|
9
41
|
- Add: `AccessibilityManager` accessible via `context.accessibility` for managing accessible elements, focus, and hover announcements
|
package/README.md
CHANGED
|
@@ -1,63 +1,31 @@
|
|
|
1
|
-
# Needle Engine
|
|
1
|
+
# Needle Engine
|
|
2
2
|
|
|
3
|
-
**Needle Engine** is a web
|
|
3
|
+
**Needle Engine** is a web-first 3D framework built on [three.js](https://threejs.org/) for building games, configurators, AR/VR experiences, and interactive websites.
|
|
4
4
|
|
|
5
|
-
Built
|
|
5
|
+
`Built-in: Rapier Physics | WebXR (incl. iOS) | Multiplayer & VOIP | Blender & Unity Integration`
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
🏓 [Changelog](https://github.com/needle-tools/needle-engine-support/releases) • 📑 [Documentation](https://docs.needle.tools) • 🧠 [Sample Scenes](https://samples.needle.tools) • 💎 [Showcase](https://engine.needle.tools/samples/?overlay=showcase)
|
|
9
|
-
|
|
10
|
-
## Key Features
|
|
11
|
-
|
|
12
|
-
**🎮 Development Experience**
|
|
13
|
-
- Component system with easy custom component creation
|
|
14
|
-
- Unity and Blender integrations for familiar workflows
|
|
15
|
-
- Multi-scene support with dynamic content loading
|
|
16
|
-
|
|
17
|
-
**🌐 Web & XR Ready**
|
|
18
|
-
- WebXR support for immersive experiences on Android and iOS ([yes! WebXR on iOS!](https://engine.needle.tools/docs/how-to-guides/xr/ios-webxr-app-clip.html))
|
|
19
|
-
- Interactive QuickLook support for interactive AR on Vision Pro
|
|
20
|
-
- Built-in networking and collaboration
|
|
7
|
+
Built on three.js and the glTF standard, Needle Engine delivers flexible, extensible web experiences with built-in collaboration and XR support. Use it standalone with npm or with powerful editor integrations for Unity and Blender.
|
|
21
8
|
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
- Automatic LOD generation for textures and meshes
|
|
25
|
-
- Advanced PBR rendering with lightmap support
|
|
26
|
-
|
|
27
|
-
**🎬 Animation & Effects**
|
|
28
|
-
- Animation state machines and timeline animations
|
|
29
|
-
- Physics simulation
|
|
30
|
-
- Post-processing effects
|
|
31
|
-
- Animate anything with ease
|
|
32
|
-
|
|
33
|
-
[→ See all features](https://docs.needle.tools/features)
|
|
34
|
-
|
|
35
|
-
## Editor Integrations
|
|
36
|
-
|
|
37
|
-
**Powerful integrations for Unity and Blender** allow artists and developers to collaborate and manage web applications inside battle-tested 3d editors. Needle Engine integrations allow you to use editor features for exporting models, author materials, animate and sequence animations, bake lightmaps and more.
|
|
38
|
-
- 🎲 [Download Unity Integration](https://engine.needle.tools/downloads/unity)
|
|
39
|
-
- 🐵 [Download Blender Integration](https://engine.needle.tools/downloads/blender)
|
|
40
|
-
- 📜 [Use with Code](https://engine.needle.tools/docs/three/)
|
|
9
|
+
## Quick Links
|
|
10
|
+
[Changelog](https://github.com/needle-tools/needle-engine-support/releases) | [Documentation](https://docs.needle.tools) | [Samples](https://samples.needle.tools) | [Showcase](https://engine.needle.tools/samples/?overlay=showcase) | [API Reference](https://engine.needle.tools/docs/api/latest)
|
|
41
11
|
|
|
42
12
|
## Getting Started
|
|
43
13
|
|
|
44
|
-
**Quick Start with npm:**
|
|
45
14
|
```bash
|
|
46
15
|
npm install @needle-tools/engine
|
|
47
16
|
```
|
|
48
17
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
**Explore Examples:** [Try our interactive samples](https://engine.needle.tools/samples) to see what's possible ⚡
|
|
18
|
+
[Try it now on StackBlitz](https://engine.needle.tools/new) | [Getting Started Guide](https://docs.needle.tools/getting-started)
|
|
52
19
|
|
|
53
|
-
##
|
|
20
|
+
## Code Examples
|
|
54
21
|
|
|
55
|
-
###
|
|
22
|
+
### Custom Component
|
|
56
23
|
|
|
57
24
|
```typescript
|
|
58
25
|
import { Behaviour, serializable } from "@needle-tools/engine";
|
|
59
26
|
|
|
60
27
|
export class MyComponent extends Behaviour {
|
|
28
|
+
|
|
61
29
|
@serializable()
|
|
62
30
|
speed: number = 1;
|
|
63
31
|
|
|
@@ -71,7 +39,42 @@ export class MyComponent extends Behaviour {
|
|
|
71
39
|
}
|
|
72
40
|
```
|
|
73
41
|
|
|
74
|
-
###
|
|
42
|
+
### Physics with Rapier (built-in)
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { Behaviour, Rigidbody, BoxCollider } from "@needle-tools/engine";
|
|
46
|
+
|
|
47
|
+
export class PhysicsBox extends Behaviour {
|
|
48
|
+
|
|
49
|
+
awake() {
|
|
50
|
+
// Add a physics body — Rapier is built in, no extra install needed
|
|
51
|
+
const rb = this.gameObject.addComponent(Rigidbody);
|
|
52
|
+
rb.useGravity = true;
|
|
53
|
+
|
|
54
|
+
// Add a collider
|
|
55
|
+
this.gameObject.addComponent(BoxCollider);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Multiplayer with @syncField
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { Behaviour, syncField } from "@needle-tools/engine";
|
|
64
|
+
|
|
65
|
+
export class SyncedCounter extends Behaviour {
|
|
66
|
+
// Automatically synced across all connected clients
|
|
67
|
+
@syncField()
|
|
68
|
+
count: number = 0;
|
|
69
|
+
|
|
70
|
+
onPointerClick() {
|
|
71
|
+
// Reassign to trigger sync (this is required for sync to work)
|
|
72
|
+
this.count = this.count + 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Lifecycle Hooks (no component needed)
|
|
75
78
|
|
|
76
79
|
```typescript
|
|
77
80
|
import { onStart, onUpdate } from "@needle-tools/engine";
|
|
@@ -85,11 +88,54 @@ onUpdate((context) => {
|
|
|
85
88
|
});
|
|
86
89
|
```
|
|
87
90
|
|
|
88
|
-
|
|
91
|
+
## Key Features
|
|
92
|
+
|
|
93
|
+
**WebXR & AR** — immersive experiences on Android and iOS
|
|
94
|
+
- WebXR support including [WebXR on iOS](https://engine.needle.tools/docs/how-to-guides/xr/ios-webxr-app-clip.html)
|
|
95
|
+
- `WebXRImageTracking` — AR image targets with full tracking lifecycle
|
|
96
|
+
- `WebXRPlaneTracking` — AR surface detection
|
|
97
|
+
- Interactive QuickLook for AR on Vision Pro
|
|
98
|
+
|
|
99
|
+
**Scene & Asset Management**
|
|
100
|
+
- `SceneSwitcher` — load different scenes by URL
|
|
101
|
+
- `AssetReference` — runtime asset loading by URL
|
|
102
|
+
- `NestedGltf` — lazy-load GLB files on demand within a scene
|
|
103
|
+
- Multi-scene support with dynamic content loading
|
|
104
|
+
|
|
105
|
+
**Physics & Interaction** — Built-in [Rapier](https://rapier.rs/) physics engine
|
|
106
|
+
- `Rigidbody`, `BoxCollider`, `SphereCollider`, `MeshCollider` — full physics simulation
|
|
107
|
+
- `CharacterController` — movement with gravity, slopes, and steps
|
|
108
|
+
- `DragControls` — click-and-drag 3D objects with zero code
|
|
109
|
+
- `SpatialTrigger` — proximity and enter-zone detection
|
|
110
|
+
|
|
111
|
+
**Multiplayer & Networking** — real-time collaboration out of the box
|
|
112
|
+
- `SyncedRoom` + `@syncField()` — automatic state synchronization
|
|
113
|
+
- `Voip` — built-in WebRTC voice chat
|
|
114
|
+
- `PlayerSync` — player object sync on join/leave
|
|
115
|
+
- `SyncedCamera` — camera sync for observer sessions
|
|
116
|
+
|
|
117
|
+
**Rendering & Effects**
|
|
118
|
+
- Advanced PBR rendering with lightmap support
|
|
119
|
+
- Post-processing (Bloom, DepthOfField, SSAO, ChromaticAberration, and more)
|
|
120
|
+
- Progressive texture and mesh loading with automatic LOD generation
|
|
121
|
+
|
|
122
|
+
**Animation & Media**
|
|
123
|
+
- Animation state machines and timeline animations
|
|
124
|
+
- `VideoPlayer` — full video playback component
|
|
125
|
+
- `AudioSource` — 3D spatial audio
|
|
126
|
+
- Animate anything via [KHR_animation_pointer](https://github.com/nicolo-ribaudo/glTF/tree/animation-pointer/extensions/2.0/Khronos/KHR_animation_pointer)
|
|
127
|
+
|
|
128
|
+
**Framework Integration** — works with React, Vue, Svelte, or vanilla JS/TS
|
|
129
|
+
|
|
130
|
+
[See all features](https://docs.needle.tools/features)
|
|
131
|
+
|
|
132
|
+
## Editor Integrations
|
|
89
133
|
|
|
90
|
-
|
|
134
|
+
Needle Engine works standalone with just npm — no editor required. For asset-heavy workflows, use our editor integrations:
|
|
91
135
|
|
|
92
|
-
|
|
136
|
+
- [Download Unity Integration](https://engine.needle.tools/downloads/unity)
|
|
137
|
+
- [Download Blender Integration](https://engine.needle.tools/downloads/blender)
|
|
138
|
+
- [Code-only workflow docs](https://engine.needle.tools/docs/three/)
|
|
93
139
|
|
|
94
140
|
## Examples
|
|
95
141
|
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: needle-engine
|
|
3
|
+
description: Automatically provides Needle Engine context when working in a Needle Engine web project. Use this skill when editing TypeScript components, Vite config, GLB assets, or anything related to @needle-tools/engine.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Designed for Claude Code and similar AI coding agents.
|
|
6
|
+
metadata:
|
|
7
|
+
author: Needle Tools
|
|
8
|
+
reviewed-against: "@needle-tools/engine@4.15.0"
|
|
9
|
+
last-reviewed: "2026-03"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Needle Engine
|
|
13
|
+
|
|
14
|
+
You are an expert in Needle Engine — a web-first 3D engine built on Three.js with a component system and Unity/Blender-based workflow.
|
|
15
|
+
|
|
16
|
+
## When to Use This Skill
|
|
17
|
+
|
|
18
|
+
**Use when the user is:**
|
|
19
|
+
- Editing TypeScript files that import from `@needle-tools/engine`
|
|
20
|
+
- Working on a project with `vite.config.ts` that uses `needlePlugins`
|
|
21
|
+
- Loading or debugging `.glb` files exported from Unity or Blender
|
|
22
|
+
- Using the Needle Engine Blender addon or Unity package
|
|
23
|
+
- Asking about component lifecycle, serialization, XR, networking, or deployment
|
|
24
|
+
|
|
25
|
+
**Do NOT use for:**
|
|
26
|
+
- Pure Three.js projects with no Needle Engine
|
|
27
|
+
- Non-web Unity/Blender work with no GLB export
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<needle-engine src="assets/scene.glb"></needle-engine>
|
|
35
|
+
<script type="module">
|
|
36
|
+
import "@needle-tools/engine";
|
|
37
|
+
</script>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Minimal TypeScript component:
|
|
41
|
+
```ts
|
|
42
|
+
import { Behaviour, serializable, registerType } from "@needle-tools/engine";
|
|
43
|
+
|
|
44
|
+
@registerType
|
|
45
|
+
export class HelloWorld extends Behaviour {
|
|
46
|
+
@serializable() message: string = "Hello!";
|
|
47
|
+
|
|
48
|
+
start() {
|
|
49
|
+
console.log(this.message);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
> **TypeScript config required:** `tsconfig.json` must have `"experimentalDecorators": true` and `"useDefineForClassFields": false` for decorators to work.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Key Concepts
|
|
59
|
+
|
|
60
|
+
**Needle Engine** ships 3D scenes from Unity or Blender as GLB files and renders them in the browser using Three.js. TypeScript components attached to objects are serialized into the GLB and re-hydrated at runtime.
|
|
61
|
+
|
|
62
|
+
- **Unity workflow:** C# MonoBehaviours → auto-generated TypeScript stubs → GLB export on play/build
|
|
63
|
+
- **Blender workflow:** Components added via the Needle Engine Blender addon → GLB export with component data embedded
|
|
64
|
+
- **Embedding:** `<needle-engine src="assets/scene.glb">` web component creates and manages a 3D context
|
|
65
|
+
- **Context access:** use `onStart(ctx => { ... })` or `onInitialize(ctx => { ... })` lifecycle hooks (preferred); `document.querySelector("needle-engine").context` works but only from UI event handlers
|
|
66
|
+
|
|
67
|
+
### `<needle-engine>` Attributes
|
|
68
|
+
|
|
69
|
+
Boolean attributes can be disabled with `="0"` (e.g. `camera-controls="0"`).
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<needle-engine
|
|
73
|
+
src="assets/scene.glb"
|
|
74
|
+
camera-controls
|
|
75
|
+
auto-rotate
|
|
76
|
+
autoplay
|
|
77
|
+
background-color="#222"
|
|
78
|
+
environment-image="studio"
|
|
79
|
+
contactshadows
|
|
80
|
+
></needle-engine>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Attribute | Description |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `src` | GLB/glTF file path(s) — string, array, or comma-separated |
|
|
86
|
+
| `camera-controls` | Adds default OrbitControls with auto-fit if no `OrbitControls`/`ICameraController` exists in the root GLB. Disable with `="0"` for fully custom camera. To tweak defaults, get `OrbitControls` from the main camera in `onStart` |
|
|
87
|
+
| `auto-rotate` | Auto-rotate the camera (requires `camera-controls`) |
|
|
88
|
+
| `autoplay` | Auto-play animations in the loaded scene |
|
|
89
|
+
| `background-color` | Hex or RGB background color (e.g. `#ff0000`) |
|
|
90
|
+
| `background-image` | Skybox URL or preset: `studio`, `blurred-skybox`, `quicklook`, `quicklook-ar` |
|
|
91
|
+
| `background-blurriness` | Blur intensity for background (0–1) |
|
|
92
|
+
| `environment-image` | Environment lighting image URL or preset (same presets as `background-image`) |
|
|
93
|
+
| `contactshadows` | Enable contact shadows |
|
|
94
|
+
| `tone-mapping` | `none`, `linear`, `neutral`, `agx` |
|
|
95
|
+
| `poster` | Placeholder image URL shown while loading |
|
|
96
|
+
| `loadstart` / `progress` / `loadfinished` | Callback functions for loading lifecycle |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Unity → Needle Cheat Sheet
|
|
101
|
+
|
|
102
|
+
| Unity (C#) | Needle Engine (TypeScript) |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `MonoBehaviour` | `Behaviour` |
|
|
105
|
+
| `[SerializeField]` / public field | `@serializable()` (required for all serialized fields) |
|
|
106
|
+
| `Instantiate(prefab)` | `instantiate(obj)` |
|
|
107
|
+
| `Destroy(obj)` | `destroy(obj)` |
|
|
108
|
+
| `GetComponent<T>()` | `this.gameObject.getComponent(T)` |
|
|
109
|
+
| `AddComponent<T>()` | `this.gameObject.addComponent(T)` |
|
|
110
|
+
| `FindObjectOfType<T>()` | `findObjectOfType(T, ctx)` |
|
|
111
|
+
| `transform.position` | `this.gameObject.worldPosition` (world) / `this.gameObject.position` (local) |
|
|
112
|
+
| `transform.rotation` | `this.gameObject.worldQuaternion` (world) / `this.gameObject.quaternion` (local) |
|
|
113
|
+
| `transform.localScale` | `this.gameObject.worldScale` (world) / `this.gameObject.scale` (local) |
|
|
114
|
+
| `Resources.Load<T>()` | No direct equivalent — use `@serializable(AssetReference)` to assign refs in editor, then `.instantiate()` or `.asset` at runtime |
|
|
115
|
+
| `StartCoroutine()` | `this.startCoroutine()` (in a component; unlike Unity, coroutines stop when the component is disabled) |
|
|
116
|
+
| `Time.deltaTime` | `this.context.time.deltaTime` |
|
|
117
|
+
| `Camera.main` | `this.context.mainCamera` (THREE.Camera) / `this.context.mainCameraComponent` (Needle Camera component) |
|
|
118
|
+
| `Debug.Log()` | `console.log()` |
|
|
119
|
+
| `OnCollisionEnter()` | `onCollisionEnter(col: Collision)` |
|
|
120
|
+
| `OnTriggerEnter()` | `onTriggerEnter(col: Collision)` |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Three.js → Needle Cheat Sheet
|
|
125
|
+
|
|
126
|
+
| Three.js | Needle Engine |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `new Mesh(geo, mat)` | Created in Unity/Blender, exported as GLB; access via `Renderer.sharedMesh` / `Renderer.sharedMaterials` |
|
|
129
|
+
| `scene.add(obj)` | `this.gameObject.add(obj)` or `instantiate(prefab)` |
|
|
130
|
+
| `scene.remove(obj)` | `obj.removeFromParent()` (re-parent) or `destroy(obj)` (permanent) |
|
|
131
|
+
| `obj.position` | `obj.position` (local) / `obj.worldPosition` (world — Needle extension) |
|
|
132
|
+
| `obj.quaternion` | `obj.quaternion` (local) / `obj.worldQuaternion` (world — Needle extension) |
|
|
133
|
+
| `obj.scale` | `obj.scale` (local) / `obj.worldScale` (world — Needle extension) |
|
|
134
|
+
| `obj.getWorldPosition(v)` | `obj.worldPosition` (getter, no temp vec needed) |
|
|
135
|
+
| `obj.traverse(cb)` | `obj.traverse(cb)` (same — it's Three.js underneath) |
|
|
136
|
+
| `obj.children` | `obj.children` (same) |
|
|
137
|
+
| `obj.parent` | `obj.parent` (same) |
|
|
138
|
+
| `raycaster.intersectObjects()` | `this.context.physics.raycast()` (auto BVH, faster) |
|
|
139
|
+
| `renderer.setAnimationLoop(cb)` | `update() {}` in a component, or `onUpdate(cb)` hook |
|
|
140
|
+
| `clock.getDelta()` | `this.context.time.deltaTime` |
|
|
141
|
+
| `new GLTFLoader().load(url)` | `AssetReference.getOrCreate(base, url)` then `.instantiate()`, or `loadAsset(url)` |
|
|
142
|
+
|
|
143
|
+
Needle Engine extends `Object3D` with component methods (`getComponent`, `addComponent`, `worldPosition`, `worldQuaternion`, `worldScale`, `worldForward`, `worldRight`, `worldUp`, `contains`, etc.). `this.gameObject` is the `Object3D` a component is attached to. The underlying Three.js API still works directly.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Creating a New Project
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm create needle my-app # Vite (default)
|
|
151
|
+
npm create needle my-app -t react # React + Vite
|
|
152
|
+
npm create needle my-app -t vue # Vue + Vite
|
|
153
|
+
npm create needle my-app -t sveltekit # SvelteKit
|
|
154
|
+
npm create needle my-app -t nextjs # Next.js
|
|
155
|
+
npm create needle my-app -t react-three-fiber # R3F
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Vite Plugin System
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
import { defineConfig } from "vite";
|
|
164
|
+
import { needlePlugins } from "@needle-tools/engine/vite";
|
|
165
|
+
|
|
166
|
+
export default defineConfig(async ({ command }) => ({
|
|
167
|
+
plugins: [
|
|
168
|
+
...(await needlePlugins(command, {}, {})),
|
|
169
|
+
],
|
|
170
|
+
}));
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Deployment
|
|
176
|
+
|
|
177
|
+
- **Needle Cloud** — `npx needle-cloud deploy`
|
|
178
|
+
- **Vercel / Netlify** — standard Vite web app
|
|
179
|
+
- **itch.io** — for games
|
|
180
|
+
- **Any static host / FTP** — `npm run build` (or `npm run build:production`) produces a standard dist folder
|
|
181
|
+
|
|
182
|
+
From Unity, built-in deployment components (e.g. `DeployToNetlify`) require a PRO license. Needle Cloud deployment works with the free tier.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Progressive Loading (`@needle-tools/gltf-progressive`)
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
import { useNeedleProgressive } from "@needle-tools/gltf-progressive";
|
|
190
|
+
useNeedleProgressive(gltfLoader, renderer);
|
|
191
|
+
gltfLoader.load(url, (gltf) => scene.add(gltf.scene));
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
In Needle Engine projects this is built in — configure via **Compression & LOD Settings** in Unity.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Searching the Documentation
|
|
199
|
+
|
|
200
|
+
Use the `needle_search` MCP tool to find relevant docs, forum posts, and community answers:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
needle_search("how to play animation clip from code")
|
|
204
|
+
needle_search("SyncedTransform multiplayer")
|
|
205
|
+
needle_search("deploy to Needle Cloud CI")
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Use this *before* guessing at API details — the docs are the source of truth.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Common Gotchas
|
|
213
|
+
|
|
214
|
+
- `@registerType` is required or the component won't be instantiated from GLB (Unity/Blender export adds this automatically, but hand-written components need it)
|
|
215
|
+
- GLB assets go in `assets/`, static files (fonts, images) in `public/` (configurable via `needle.config.json`)
|
|
216
|
+
- `useDefineForClassFields: false` must be set in `tsconfig.json` — otherwise decorators silently break field initialization
|
|
217
|
+
- `@syncField()` only triggers on reassignment — mutating an array/object in place won't sync; do `this.arr = this.arr`
|
|
218
|
+
- Physics callbacks (`onCollisionEnter` etc.) require a Needle `Collider` component on the GameObject
|
|
219
|
+
- `removeComponent()` does NOT call `onDestroy` — use `destroy(obj)` for full cleanup
|
|
220
|
+
- Prefer `instantiate()` and `destroy()` functions over `GameObject.instantiate()` / `GameObject.destroy()`
|
|
221
|
+
- `loadAsset()` returns a model wrapper (not an Object3D) — use `.scene` to get the root Object3D
|
|
222
|
+
- `AssetReference.getOrCreateFromUrl()` caches by URL — loading the same URL twice returns the same Object3D. Use `.instantiate()` or `loadAsset()` with `{ context }` for multiple copies
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## References
|
|
227
|
+
|
|
228
|
+
For detailed API usage, read these reference files:
|
|
229
|
+
|
|
230
|
+
- [Full API Reference](https://raw.githubusercontent.com/needle-tools/ai/refs/heads/main/providers/claude/plugin/skills/needle-engine/references/api.md) — lifecycle, decorators, context API, animation, networking, XR, physics
|
|
231
|
+
- [Framework Integration](https://raw.githubusercontent.com/needle-tools/ai/refs/heads/main/providers/claude/plugin/skills/needle-engine/references/integration.md) — React, Svelte, Vue, vanilla JS examples + SSR patterns
|
|
232
|
+
- [Troubleshooting](https://raw.githubusercontent.com/needle-tools/ai/refs/heads/main/providers/claude/plugin/skills/needle-engine/references/troubleshooting.md) — common errors and fixes
|
|
233
|
+
- [Component Template](https://raw.githubusercontent.com/needle-tools/ai/refs/heads/main/providers/claude/plugin/skills/needle-engine/templates/my-component.ts) — annotated starter component
|
|
234
|
+
|
|
235
|
+
## Important URLs
|
|
236
|
+
|
|
237
|
+
- Docs: https://engine.needle.tools/docs/
|
|
238
|
+
- Samples: https://engine.needle.tools/samples/
|
|
239
|
+
- GitHub: https://github.com/needle-tools/needle-engine-support
|
|
240
|
+
- npm: https://www.npmjs.com/package/@needle-tools/engine
|