@needle-tools/engine 4.12.0-next.f962b5a → 4.12.0
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 -4
- package/README.md +4 -2
- package/components.needle.json +1 -1
- package/dist/{gltf-progressive-Rs-ojtXy.umd.cjs → gltf-progressive-Bfpfaz84.umd.cjs} +1 -1
- package/dist/{gltf-progressive-DnLBuGK5.js → gltf-progressive-DPunMlEM.js} +1 -1
- package/dist/{gltf-progressive-BmSygnAC.min.js → gltf-progressive-hFPACYio.min.js} +1 -1
- package/dist/{needle-engine.bundle-Dm-UEvOC.min.js → needle-engine.bundle-BhAUDZcQ.min.js} +146 -146
- package/dist/{needle-engine.bundle-BbNVbTsd.js → needle-engine.bundle-CpPhY8AW.js} +7974 -7797
- package/dist/{needle-engine.bundle-DZDLbOMI.umd.cjs → needle-engine.bundle-DQdhrcLq.umd.cjs} +143 -143
- package/dist/needle-engine.d.ts +30 -23
- package/dist/needle-engine.js +3 -3
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-DZtb9Nnn.umd.cjs → postprocessing-BHQvwehB.umd.cjs} +1 -1
- package/dist/{postprocessing-B5ksn9-G.min.js → postprocessing-ClLv0reO.min.js} +1 -1
- package/dist/{postprocessing-__7s9wON.js → postprocessing-DLI2N3LL.js} +1 -1
- package/dist/{three-examples-y2GeYlze.js → three-examples-D4rE49Ui.js} +10 -2
- package/dist/{three-examples-MsJjauyk.min.js → three-examples-DB5Uoja4.min.js} +2 -2
- package/dist/{three-examples-Dho7cuu4.umd.cjs → three-examples-Djbk6WA4.umd.cjs} +2 -2
- package/lib/engine/engine_context.js +2 -0
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_license.d.ts +18 -0
- package/lib/engine/engine_license.js +161 -9
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_networking.js +15 -0
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
- package/lib/engine/engine_three_utils.js +2 -2
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -1
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +2 -0
- package/lib/engine/webcomponents/needle menu/needle-menu.js +41 -2
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.js +21 -0
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine-components/DragControls.js +1 -1
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +1 -0
- package/lib/engine-components/DropListener.js +26 -8
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/EventList.js +4 -1
- package/lib/engine-components/EventList.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.d.ts +3 -2
- package/lib/engine-components/SceneSwitcher.js +24 -11
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +8 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/webxr/WebARSessionRoot.d.ts +5 -2
- package/lib/engine-components/webxr/WebARSessionRoot.js +5 -2
- package/lib/engine-components/webxr/WebARSessionRoot.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +3 -1
- package/lib/engine-components/webxr/WebXR.js +3 -1
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/package.json +3 -3
- package/src/engine/engine_context.ts +2 -0
- package/src/engine/engine_license.ts +178 -9
- package/src/engine/engine_networking.ts +15 -0
- package/src/engine/engine_serialization_builtin_serializer.ts +1 -1
- package/src/engine/engine_three_utils.ts +4 -2
- package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -1
- package/src/engine/webcomponents/needle menu/needle-menu.ts +44 -3
- package/src/engine/xr/NeedleXRSession.ts +25 -0
- package/src/engine-components/DragControls.ts +1 -1
- package/src/engine-components/DropListener.ts +29 -8
- package/src/engine-components/EventList.ts +5 -1
- package/src/engine-components/SceneSwitcher.ts +26 -13
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +11 -0
- package/src/engine-components/webxr/WebARSessionRoot.ts +7 -3
- package/src/engine-components/webxr/WebXR.ts +4 -2
|
@@ -11,6 +11,7 @@ import { Animation } from "../../../../Animation.js";
|
|
|
11
11
|
import { Animator } from "../../../../Animator.js";
|
|
12
12
|
import { AudioSource } from "../../../../AudioSource.js";
|
|
13
13
|
import { Behaviour, GameObject } from "../../../../Component.js";
|
|
14
|
+
import { Rigidbody } from "../../../../RigidBody.js";
|
|
14
15
|
import type { IPointerClickHandler, PointerEventData } from "../../../../ui/PointerEvents.js";
|
|
15
16
|
import { ObjectRaycaster,Raycaster } from "../../../../ui/Raycaster.js";
|
|
16
17
|
import { makeNameSafeForUSD,USDDocument, USDObject, USDZExporterContext } from "../../ThreeUSDZExporter.js";
|
|
@@ -68,6 +69,16 @@ export class ChangeTransformOnClick extends Behaviour implements IPointerClickHa
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
onPointerClick(args: PointerEventData) {
|
|
72
|
+
|
|
73
|
+
const rbs = this.object?.getComponentsInChildren(Rigidbody);
|
|
74
|
+
|
|
75
|
+
if (rbs){
|
|
76
|
+
for (const rb of rbs) {
|
|
77
|
+
rb.resetVelocities();
|
|
78
|
+
rb.resetForcesAndTorques();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
71
82
|
args.use();
|
|
72
83
|
if (this.coroutine) this.stopCoroutine(this.coroutine);
|
|
73
84
|
if (!this.relativeMotion)
|
|
@@ -10,6 +10,7 @@ import type { IComponent, IGameObject } from "../../engine/engine_types.js";
|
|
|
10
10
|
import { DeviceUtilities, getParam } from "../../engine/engine_utils.js";
|
|
11
11
|
import { NeedleXRController, type NeedleXREventArgs, type NeedleXRHitTestResult, NeedleXRSession } from "../../engine/engine_xr.js";
|
|
12
12
|
import { Behaviour, GameObject } from "../Component.js";
|
|
13
|
+
import type { WebXR } from "./WebXR.js";
|
|
13
14
|
|
|
14
15
|
// https://github.com/takahirox/takahirox.github.io/blob/master/js.mmdeditor/examples/js/controls/DeviceOrientationControls.js
|
|
15
16
|
|
|
@@ -20,14 +21,17 @@ const invertForwardMatrix = new Matrix4().makeRotationY(Math.PI);
|
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* The WebARSessionRoot is the root object for a WebAR session and used to place the scene in AR.
|
|
23
|
-
* It is also responsible for scaling the user in AR and to define the center of the AR scene.
|
|
24
|
+
* It is also responsible for scaling the user in AR and to define the center of the AR scene.
|
|
25
|
+
* If not present in the scene it will be created automatically by the WebXR component when entering an AR session.
|
|
24
26
|
*
|
|
25
|
-
* @
|
|
27
|
+
* **Note**: If the WebXR component {@link WebXR.autoCenter} option is enabled the scene will be automatically centered based on the content in the scene.
|
|
28
|
+
*
|
|
29
|
+
* @example Callback when the scene has been placed in AR:
|
|
26
30
|
* ```ts
|
|
27
31
|
* WebARSessionRoot.onPlaced((args) => {
|
|
28
32
|
* console.log("Scene has been placed in AR");
|
|
29
33
|
* });
|
|
30
|
-
* ```
|
|
34
|
+
* ```
|
|
31
35
|
*
|
|
32
36
|
* @summary Root object for WebAR sessions, managing scene placement and user scaling in AR.
|
|
33
37
|
* @category XR
|
|
@@ -23,7 +23,7 @@ const debug = getParam("debugwebxr");
|
|
|
23
23
|
const debugQuicklook = getParam("debugusdz");
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Use the WebXR component to enable VR
|
|
26
|
+
* Use the WebXR component to enable VR and AR on iOS and Android in your scene. VisionOS support is also provided via QuickLook USDZ export.
|
|
27
27
|
*
|
|
28
28
|
* The WebXR component is a simple to use wrapper around the {@link NeedleXRSession} API and adds some additional features like creating buttons for AR, VR, enabling default movement behaviour ({@link XRControllerMovement}) and controller rendering ({@link XRControllerModel}), as well as handling AR placement and Quicklook USDZ export.
|
|
29
29
|
*
|
|
@@ -146,7 +146,9 @@ export class WebXR extends Behaviour {
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* When enabled, the AR session root center will be automatically adjusted to place the center of the scene.
|
|
149
|
-
* This helps ensure the scene is properly aligned with detected surfaces.
|
|
149
|
+
* This helps ensure the scene is properly aligned with detected surfaces.
|
|
150
|
+
*
|
|
151
|
+
* **Note**: This option overrides the placement of the {@link WebARSessionRoot} component if both are used.
|
|
150
152
|
*/
|
|
151
153
|
@serializable()
|
|
152
154
|
autoCenter: boolean = false;
|