@needle-tools/engine 4.14.0-next.b2e3b1a → 4.15.0-next.cecd8e7
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 +9 -1
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-Bhgt3W8p.min.js → needle-engine.bundle-CuAiLb-d.min.js} +134 -126
- package/dist/{needle-engine.bundle-BC1QDiuv.umd.cjs → needle-engine.bundle-JQGIFVRm.umd.cjs} +128 -120
- package/dist/{needle-engine.bundle-CeQXs7Hh.js → needle-engine.bundle-VZVrVbc3.js} +3521 -3315
- package/dist/needle-engine.d.ts +450 -107
- package/dist/needle-engine.js +570 -569
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/api.d.ts +202 -17
- package/lib/engine/api.js +270 -17
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_accessibility.d.ts +77 -0
- package/lib/engine/engine_accessibility.js +162 -0
- package/lib/engine/engine_accessibility.js.map +1 -0
- package/lib/engine/engine_components.d.ts +1 -1
- package/lib/engine/engine_components.js +3 -7
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_context.d.ts +2 -12
- package/lib/engine/engine_context.js +7 -29
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_gltf_builtin_components.js +1 -16
- package/lib/engine/engine_gltf_builtin_components.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.d.ts +90 -4
- package/lib/engine/engine_materialpropertyblock.js +97 -7
- package/lib/engine/engine_materialpropertyblock.js.map +1 -1
- package/lib/engine/engine_math.d.ts +34 -1
- package/lib/engine/engine_math.js +34 -1
- package/lib/engine/engine_math.js.map +1 -1
- package/lib/engine/engine_networking.js +1 -1
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_types.d.ts +2 -0
- package/lib/engine/engine_types.js +2 -0
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/webcomponents/icons.js +3 -0
- package/lib/engine/webcomponents/icons.js.map +1 -1
- package/lib/engine/webcomponents/logo-element.d.ts +1 -0
- package/lib/engine/webcomponents/logo-element.js +3 -1
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.d.ts +37 -11
- package/lib/engine/webcomponents/needle-button.js +42 -11
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +10 -2
- package/lib/engine/webcomponents/needle-engine.js +13 -3
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/Component.d.ts +1 -2
- package/lib/engine-components/Component.js +1 -2
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +1 -0
- package/lib/engine-components/DragControls.js +21 -0
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +2 -0
- package/lib/engine-components/NeedleMenu.js +2 -0
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/Networking.d.ts +28 -3
- package/lib/engine-components/Networking.js +28 -3
- package/lib/engine-components/Networking.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +1 -0
- package/lib/engine-components/ReflectionProbe.js +20 -2
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +107 -13
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +167 -30
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.utils.d.ts +1 -1
- package/lib/engine-components/ui/Button.d.ts +1 -0
- package/lib/engine-components/ui/Button.js +11 -0
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +1 -0
- package/lib/engine-components/ui/Text.js +11 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/api.ts +370 -18
- package/src/engine/engine_accessibility.ts +198 -0
- package/src/engine/engine_components.ts +3 -7
- package/src/engine/engine_context.ts +11 -28
- package/src/engine/engine_gltf_builtin_components.ts +1 -17
- package/src/engine/engine_materialpropertyblock.ts +102 -11
- package/src/engine/engine_math.ts +34 -1
- package/src/engine/engine_networking.ts +1 -1
- package/src/engine/engine_types.ts +5 -0
- package/src/engine/webcomponents/icons.ts +3 -0
- package/src/engine/webcomponents/logo-element.ts +4 -1
- package/src/engine/webcomponents/needle-button.ts +44 -13
- package/src/engine/webcomponents/needle-engine.ts +18 -7
- package/src/engine-components/Component.ts +1 -3
- package/src/engine-components/DragControls.ts +29 -4
- package/src/engine-components/NeedleMenu.ts +5 -3
- package/src/engine-components/Networking.ts +29 -4
- package/src/engine-components/ReflectionProbe.ts +21 -2
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +198 -65
- package/src/engine-components/ui/Button.ts +12 -0
- package/src/engine-components/ui/Text.ts +13 -0
|
@@ -9,8 +9,8 @@ import type { Voip } from './Voip.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* [NeedleMenu](https://engine.needle.tools/docs/api/NeedleMenu) provides configuration for the built-in UI menu.
|
|
11
11
|
* The menu renders as HTML overlay in browser mode and automatically
|
|
12
|
-
* switches to a 3D spatial menu in VR/AR.
|
|
13
|
-
*
|
|
12
|
+
* switches to a 3D spatial menu in VR/AR.
|
|
13
|
+
*
|
|
14
14
|
* 
|
|
15
15
|
*
|
|
16
16
|
* **Features:**
|
|
@@ -18,7 +18,7 @@ import type { Voip } from './Voip.js';
|
|
|
18
18
|
* - Audio mute/unmute button
|
|
19
19
|
* - QR code sharing (desktop only)
|
|
20
20
|
* - Spatial menu in XR (appears when looking up)
|
|
21
|
-
* - Custom positioning (top/bottom)
|
|
21
|
+
* - Custom positioning (top/bottom)
|
|
22
22
|
*
|
|
23
23
|
* **Programmatic access:**
|
|
24
24
|
* Access the menu API via `this.context.menu` to add custom buttons,
|
|
@@ -36,6 +36,8 @@ import type { Voip } from './Voip.js';
|
|
|
36
36
|
* @category User Interface
|
|
37
37
|
* @group Components
|
|
38
38
|
* @see {@link Context.menu} for programmatic menu control
|
|
39
|
+
* @see {@link NeedleButtonElement} for standalone <needle-button> web component
|
|
40
|
+
* @see {@link NeedleEngineWebComponent} for the main <needle-engine> element
|
|
39
41
|
* @see {@link Voip} adds a microphone button to the menu
|
|
40
42
|
* @see {@link ScreenCapture} adds a screen sharing button
|
|
41
43
|
**/
|
|
@@ -7,10 +7,34 @@ import { Behaviour } from "./Component.js";
|
|
|
7
7
|
const debug = getParam("debugnet");
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Provides configuration
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Provides websocket URL configuration for the built-in networking system.
|
|
11
|
+
* Add this component to override the default networking backend URL used by {@link NetworkConnection} (`this.context.connection`).
|
|
12
|
+
*
|
|
13
|
+
* The component registers itself as a URL provider on `awake()`. When the networking system connects,
|
|
14
|
+
* it queries this provider for the websocket URL to use instead of the default Needle networking backend.
|
|
15
|
+
*
|
|
16
|
+
* **URL resolution order:**
|
|
17
|
+
* 1. If `urlParameterName` is set and the corresponding URL parameter exists in the browser URL, that value is used
|
|
18
|
+
* 2. If running on a local network and `localhost` is set, the `localhost` URL is used
|
|
19
|
+
* 3. Otherwise, the `url` field is used
|
|
20
|
+
*
|
|
21
|
+
* Without this component, the default backend URL `wss://networking-2.needle.tools/socket` is used.
|
|
22
|
+
*
|
|
23
|
+
* **Note:** This component only configures the websocket URL. To actually join a networked room,
|
|
24
|
+
* use a `SyncedRoom` component or call `this.context.connection.joinRoom("room-name")` directly.
|
|
25
|
+
*
|
|
26
|
+
* @example Overriding the URL via browser parameter
|
|
27
|
+
* ```ts
|
|
28
|
+
* // With urlParameterName="server", visiting:
|
|
29
|
+
* // https://myapp.com/?server=wss://my-server.com/socket
|
|
30
|
+
* // will connect to that server instead
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @see {@link NetworkConnection} for the main networking API (`this.context.connection`)
|
|
34
|
+
* @see {@link SyncedRoom} for automatic room joining
|
|
35
|
+
* @see {@link OwnershipModel} for networked object ownership
|
|
36
|
+
* @see {@link RoomEvents} for room lifecycle events
|
|
37
|
+
* @link https://engine.needle.tools/docs/how-to-guides/networking/
|
|
14
38
|
* @summary Networking configuration
|
|
15
39
|
* @category Networking
|
|
16
40
|
* @group Components
|
|
@@ -20,6 +44,7 @@ export class Networking extends Behaviour implements INetworkingWebsocketUrlProv
|
|
|
20
44
|
/**
|
|
21
45
|
* The websocket URL to connect to for networking functionality.
|
|
22
46
|
* Can be a complete URL or a relative path that will be resolved against the current origin.
|
|
47
|
+
* @default null
|
|
23
48
|
*/
|
|
24
49
|
@serializable()
|
|
25
50
|
url: string | null = null;
|
|
@@ -2,10 +2,11 @@ import { Color, CubeReflectionMapping, CubeTexture, EquirectangularReflectionMap
|
|
|
2
2
|
|
|
3
3
|
import { isDevEnvironment, showBalloonWarning } from "../engine/debug/index.js";
|
|
4
4
|
import { MaterialPropertyBlock } from "../engine/engine_materialpropertyblock.js";
|
|
5
|
+
import { loadPMREM } from "../engine/engine_pmrem.js";
|
|
5
6
|
import { serializable } from "../engine/engine_serialization.js";
|
|
6
7
|
import { Context } from "../engine/engine_setup.js";
|
|
7
8
|
import type { IRenderer } from "../engine/engine_types.js";
|
|
8
|
-
import { getParam } from "../engine/engine_utils.js";
|
|
9
|
+
import { getParam, resolveUrl } from "../engine/engine_utils.js";
|
|
9
10
|
import { BoxHelperComponent } from "./BoxHelperComponent.js";
|
|
10
11
|
import { Behaviour } from "./Component.js";
|
|
11
12
|
import { EventList } from "./EventList.js";
|
|
@@ -90,10 +91,28 @@ export class ReflectionProbe extends Behaviour {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
private _texture!: Texture;
|
|
94
|
+
private _textureUrlInFlight?: string;
|
|
93
95
|
|
|
94
|
-
@serializable(Texture)
|
|
96
|
+
@serializable([Texture, String])
|
|
95
97
|
set texture(tex: Texture) {
|
|
96
98
|
if (this._texture === tex) return;
|
|
99
|
+
|
|
100
|
+
if (typeof tex === "string") {
|
|
101
|
+
if(debug) console.debug(`[ReflectionProbe] Loading reflection probe texture from URL: ${tex}`);
|
|
102
|
+
this._textureUrlInFlight = tex;
|
|
103
|
+
const textureUrl = resolveUrl(this.sourceId, tex);
|
|
104
|
+
loadPMREM(textureUrl, this.context.renderer).then(loaded => {
|
|
105
|
+
if (this._textureUrlInFlight === tex && loaded) {
|
|
106
|
+
this._textureUrlInFlight = undefined;
|
|
107
|
+
if (debug) console.debug(`[ReflectionProbe] Successfully loaded reflection probe texture: ${tex}`);
|
|
108
|
+
this.texture = loaded;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
this._textureUrlInFlight = undefined;
|
|
115
|
+
|
|
97
116
|
this._texture = tex;
|
|
98
117
|
|
|
99
118
|
if (debug) console.debug("[ReflectionProbe] Set reflection probe texture " + (tex?.name || "(removed)"));
|