@threlte/xr 1.5.1 → 1.5.3
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.
|
@@ -69,10 +69,17 @@ export const setupPointerControls = (context, handContext, fixedStep = 1 / 40) =
|
|
|
69
69
|
const intersections = [];
|
|
70
70
|
const rawHits = context.raycaster.intersectObjects(context.interactiveObjects, true);
|
|
71
71
|
const seen = new Set();
|
|
72
|
+
// Deduplicate hits by object. When recursive=true, intersectObjects searches
|
|
73
|
+
// each registered object's full subtree, so a child that is itself registered
|
|
74
|
+
// appears once per registered ancestor — causing duplicate events. The key is
|
|
75
|
+
// context-sensitive so that legitimate multi-hit objects are preserved:
|
|
76
|
+
// InstancedMesh — each instance is a distinct target, key by instanceId
|
|
77
|
+
// Points — each point is a distinct target, key by point index
|
|
78
|
+
// Mesh / other — uuid only; multiple face hits are the same surface
|
|
72
79
|
const hits = rawHits.filter((hit) => {
|
|
73
80
|
const key = hit.instanceId !== undefined
|
|
74
81
|
? `${hit.object.uuid}|${hit.instanceId}`
|
|
75
|
-
: hit.
|
|
82
|
+
: hit.object.isPoints
|
|
76
83
|
? `${hit.object.uuid}|${hit.index}`
|
|
77
84
|
: hit.object.uuid;
|
|
78
85
|
if (seen.has(key))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threlte/xr",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"author": "Micheal Parks <michealparks1989@gmail.com> (https://parks.lol)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Tools to more easily create VR and AR experiences with Threlte",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"typescript-eslint": "^8.32.0",
|
|
29
29
|
"vite": "^7.1.4",
|
|
30
30
|
"vite-plugin-mkcert": "^1.17.5",
|
|
31
|
-
"@threlte/core": "8.5.
|
|
31
|
+
"@threlte/core": "8.5.8"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"svelte": ">=5",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"svelte": "./dist/index.js",
|
|
65
65
|
"files": [
|
|
66
66
|
"dist",
|
|
67
|
+
"!dist/**/__tests__",
|
|
67
68
|
"!dist/**/*.test.*",
|
|
68
69
|
"!dist/**/*.spec.*"
|
|
69
70
|
],
|