@needle-tools/engine 4.1.1 → 4.2.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 +5 -0
- package/dist/needle-engine.bundle.js +3681 -3666
- package/dist/needle-engine.bundle.light.js +3680 -3665
- package/dist/needle-engine.bundle.light.min.js +108 -108
- package/dist/needle-engine.bundle.light.umd.cjs +120 -120
- package/dist/needle-engine.bundle.min.js +108 -108
- package/dist/needle-engine.bundle.umd.cjs +114 -114
- package/lib/engine/engine_utils.d.ts +2 -0
- package/lib/engine/engine_utils.js +8 -0
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/xr/NeedleXRController.d.ts +0 -1
- package/lib/engine/xr/NeedleXRController.js +0 -14
- package/lib/engine/xr/NeedleXRController.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.js +10 -2
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine-components/DragControls.js +12 -3
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/webxr/WebXRPlaneTracking.js +2 -2
- package/lib/engine-components/webxr/WebXRPlaneTracking.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js +3 -0
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerModel.d.ts +3 -0
- package/lib/engine-components/webxr/controllers/XRControllerModel.js +11 -0
- package/lib/engine-components/webxr/controllers/XRControllerModel.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/engine_utils.ts +7 -0
- package/src/engine/xr/NeedleXRController.ts +0 -14
- package/src/engine/xr/NeedleXRSession.ts +10 -2
- package/src/engine-components/DragControls.ts +13 -3
- package/src/engine-components/webxr/WebXRPlaneTracking.ts +2 -2
- package/src/engine-components/webxr/controllers/XRControllerFollow.ts +3 -0
- package/src/engine-components/webxr/controllers/XRControllerModel.ts +15 -0
|
@@ -113,6 +113,7 @@ export class XRControllerModel extends Behaviour {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
+
|
|
116
117
|
onXRControllerRemoved(args: NeedleXRControllerEventArgs): void {
|
|
117
118
|
console.debug("XR Controller Removed", args.controller.side, args.controller.index);
|
|
118
119
|
// we need to find the index by the controller because if controller 0 is removed first then args.controller.index 1 will be at index 0
|
|
@@ -128,6 +129,19 @@ export class XRControllerModel extends Behaviour {
|
|
|
128
129
|
entry.model = undefined;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
|
|
133
|
+
onBeforeXR(_mode: XRSessionMode, args: XRSessionInit & { trackedImages: Array<any> }): void {
|
|
134
|
+
// When a custom hand model is used, we want to ensure we're requesting hand tracking,
|
|
135
|
+
// even when the platform default doesn't include it (for example, on VisionOS we don't
|
|
136
|
+
// request hand tracking by default because there's an additional permissions dialogue.
|
|
137
|
+
if (this.createHandModel && (this.customLeftHand || this.customRightHand)) {
|
|
138
|
+
args.optionalFeatures = args.optionalFeatures || [];
|
|
139
|
+
if (!args.optionalFeatures.includes("hand-tracking")) {
|
|
140
|
+
args.optionalFeatures.push("hand-tracking");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
131
145
|
onLeaveXR(_args: NeedleXREventArgs): void {
|
|
132
146
|
for (const entry of this._models) {
|
|
133
147
|
if (!entry) continue;
|
|
@@ -145,6 +159,7 @@ export class XRControllerModel extends Behaviour {
|
|
|
145
159
|
}
|
|
146
160
|
this._models.length = 0;
|
|
147
161
|
}
|
|
162
|
+
|
|
148
163
|
onBeforeRender() {
|
|
149
164
|
if (!NeedleXRSession.active) return;
|
|
150
165
|
|