@iwsdk/core 0.2.2 → 0.3.1

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.
Files changed (228) hide show
  1. package/README.md +94 -0
  2. package/dist/asset/loaders/hdr-texture-loader.d.ts +1 -1
  3. package/dist/asset/loaders/hdr-texture-loader.d.ts.map +1 -1
  4. package/dist/asset/loaders/hdr-texture-loader.js +4 -4
  5. package/dist/asset/loaders/hdr-texture-loader.js.map +1 -1
  6. package/dist/audio/audio-system.d.ts +6 -2
  7. package/dist/audio/audio-system.d.ts.map +1 -1
  8. package/dist/audio/audio-system.js +1 -0
  9. package/dist/audio/audio-system.js.map +1 -1
  10. package/dist/audio/audio.d.ts +3 -1
  11. package/dist/audio/audio.d.ts.map +1 -1
  12. package/dist/audio/audio.js +8 -2
  13. package/dist/audio/audio.js.map +1 -1
  14. package/dist/camera/camera-source.js +1 -0
  15. package/dist/camera/camera-source.js.map +1 -1
  16. package/dist/camera/camera-system.d.ts.map +1 -1
  17. package/dist/camera/camera-system.js +1 -0
  18. package/dist/camera/camera-system.js.map +1 -1
  19. package/dist/camera/camera-utils.d.ts.map +1 -1
  20. package/dist/camera/camera-utils.js.map +1 -1
  21. package/dist/depth/depth-occludable.d.ts +48 -0
  22. package/dist/depth/depth-occludable.d.ts.map +1 -0
  23. package/dist/depth/depth-occludable.js +48 -0
  24. package/dist/depth/depth-occludable.js.map +1 -0
  25. package/dist/depth/depth-sensing-system.d.ts +164 -0
  26. package/dist/depth/depth-sensing-system.d.ts.map +1 -0
  27. package/dist/depth/depth-sensing-system.js +453 -0
  28. package/dist/depth/depth-sensing-system.js.map +1 -0
  29. package/dist/depth/depth-textures.d.ts +53 -0
  30. package/dist/depth/depth-textures.d.ts.map +1 -0
  31. package/dist/depth/depth-textures.js +114 -0
  32. package/dist/depth/depth-textures.js.map +1 -0
  33. package/dist/depth/index.d.ts +10 -0
  34. package/dist/depth/index.d.ts.map +1 -0
  35. package/dist/depth/occlusion/preprocessing-pass.d.ts +52 -0
  36. package/dist/depth/occlusion/preprocessing-pass.d.ts.map +1 -0
  37. package/dist/depth/occlusion/preprocessing-pass.js +105 -0
  38. package/dist/depth/occlusion/preprocessing-pass.js.map +1 -0
  39. package/dist/depth/occlusion/preprocessing-shader.glsl.d.ts +22 -0
  40. package/dist/depth/occlusion/preprocessing-shader.glsl.d.ts.map +1 -0
  41. package/dist/depth/occlusion/preprocessing-shader.glsl.js +115 -0
  42. package/dist/depth/occlusion/preprocessing-shader.glsl.js.map +1 -0
  43. package/dist/ecs/entity.d.ts +17 -1
  44. package/dist/ecs/entity.d.ts.map +1 -1
  45. package/dist/ecs/entity.js +7 -1
  46. package/dist/ecs/entity.js.map +1 -1
  47. package/dist/ecs/world.d.ts +12 -0
  48. package/dist/ecs/world.d.ts.map +1 -1
  49. package/dist/ecs/world.js +47 -3
  50. package/dist/ecs/world.js.map +1 -1
  51. package/dist/environment/dome-gradient.js +1 -0
  52. package/dist/environment/dome-gradient.js.map +1 -1
  53. package/dist/environment/dome-texture.d.ts +3 -1
  54. package/dist/environment/dome-texture.d.ts.map +1 -1
  55. package/dist/environment/dome-texture.js +7 -1
  56. package/dist/environment/dome-texture.js.map +1 -1
  57. package/dist/environment/environment-system.d.ts +8 -0
  58. package/dist/environment/environment-system.d.ts.map +1 -1
  59. package/dist/environment/environment-system.js +78 -2
  60. package/dist/environment/environment-system.js.map +1 -1
  61. package/dist/environment/ibl-gradient.js +1 -0
  62. package/dist/environment/ibl-gradient.js.map +1 -1
  63. package/dist/environment/ibl-texture.d.ts +3 -1
  64. package/dist/environment/ibl-texture.d.ts.map +1 -1
  65. package/dist/environment/ibl-texture.js +7 -1
  66. package/dist/environment/ibl-texture.js.map +1 -1
  67. package/dist/environment-raycast/environment-raycast.d.ts +136 -0
  68. package/dist/environment-raycast/environment-raycast.d.ts.map +1 -0
  69. package/dist/environment-raycast/environment-raycast.js +333 -0
  70. package/dist/environment-raycast/environment-raycast.js.map +1 -0
  71. package/dist/environment-raycast/index.d.ts +9 -0
  72. package/dist/environment-raycast/index.d.ts.map +1 -0
  73. package/dist/environment-raycast/raycast-target.d.ts +114 -0
  74. package/dist/environment-raycast/raycast-target.d.ts.map +1 -0
  75. package/dist/environment-raycast/raycast-target.js +84 -0
  76. package/dist/environment-raycast/raycast-target.js.map +1 -0
  77. package/dist/grab/distance-grabbable.d.ts +27 -2
  78. package/dist/grab/distance-grabbable.d.ts.map +1 -1
  79. package/dist/grab/distance-grabbable.js +25 -2
  80. package/dist/grab/distance-grabbable.js.map +1 -1
  81. package/dist/grab/grab-system.d.ts +106 -61
  82. package/dist/grab/grab-system.d.ts.map +1 -1
  83. package/dist/grab/grab-system.js +61 -10
  84. package/dist/grab/grab-system.js.map +1 -1
  85. package/dist/grab/handles.d.ts +14 -4
  86. package/dist/grab/handles.d.ts.map +1 -1
  87. package/dist/grab/handles.js +45 -18
  88. package/dist/grab/handles.js.map +1 -1
  89. package/dist/grab/index.d.ts +0 -1
  90. package/dist/grab/index.d.ts.map +1 -1
  91. package/dist/grab/index.js +0 -2
  92. package/dist/grab/index.js.map +1 -1
  93. package/dist/grab/one-hand-grabbable.js +1 -0
  94. package/dist/grab/one-hand-grabbable.js.map +1 -1
  95. package/dist/grab/two-hands-grabbable.js +1 -0
  96. package/dist/grab/two-hands-grabbable.js.map +1 -1
  97. package/dist/index.d.ts +3 -0
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/index.js +9 -1
  100. package/dist/index.js.map +1 -1
  101. package/dist/init/world-initializer.d.ts +13 -1
  102. package/dist/init/world-initializer.d.ts.map +1 -1
  103. package/dist/init/world-initializer.js +78 -18
  104. package/dist/init/world-initializer.js.map +1 -1
  105. package/dist/init/xr.d.ts +1 -0
  106. package/dist/init/xr.d.ts.map +1 -1
  107. package/dist/init/xr.js +6 -0
  108. package/dist/init/xr.js.map +1 -1
  109. package/dist/input/input-system.d.ts +409 -5
  110. package/dist/input/input-system.d.ts.map +1 -1
  111. package/dist/input/input-system.js +166 -32
  112. package/dist/input/input-system.js.map +1 -1
  113. package/dist/input/state-tags.d.ts +32 -15
  114. package/dist/input/state-tags.d.ts.map +1 -1
  115. package/dist/input/state-tags.js +34 -16
  116. package/dist/input/state-tags.js.map +1 -1
  117. package/dist/level/level-entity-creator.js +1 -0
  118. package/dist/level/level-entity-creator.js.map +1 -1
  119. package/dist/level/level-root.js +1 -0
  120. package/dist/level/level-root.js.map +1 -1
  121. package/dist/level/level-system.js +1 -0
  122. package/dist/level/level-system.js.map +1 -1
  123. package/dist/level/level-tag.js +1 -0
  124. package/dist/level/level-tag.js.map +1 -1
  125. package/dist/locomotion/locomotion.d.ts +10 -0
  126. package/dist/locomotion/locomotion.d.ts.map +1 -1
  127. package/dist/locomotion/locomotion.js +17 -1
  128. package/dist/locomotion/locomotion.js.map +1 -1
  129. package/dist/locomotion/slide.d.ts +10 -0
  130. package/dist/locomotion/slide.d.ts.map +1 -1
  131. package/dist/locomotion/slide.js +6 -2
  132. package/dist/locomotion/slide.js.map +1 -1
  133. package/dist/locomotion/teleport.js +1 -0
  134. package/dist/locomotion/teleport.js.map +1 -1
  135. package/dist/mcp/ecs-debug-tools.d.ts +167 -0
  136. package/dist/mcp/ecs-debug-tools.d.ts.map +1 -0
  137. package/dist/mcp/ecs-debug-tools.js +602 -0
  138. package/dist/mcp/ecs-debug-tools.js.map +1 -0
  139. package/dist/mcp/index.d.ts +10 -0
  140. package/dist/mcp/index.d.ts.map +1 -0
  141. package/dist/mcp/mcp-runtime.d.ts +31 -0
  142. package/dist/mcp/mcp-runtime.d.ts.map +1 -0
  143. package/dist/mcp/mcp-runtime.js +85 -0
  144. package/dist/mcp/mcp-runtime.js.map +1 -0
  145. package/dist/mcp/scene-tools.d.ts +41 -0
  146. package/dist/mcp/scene-tools.d.ts.map +1 -0
  147. package/dist/mcp/scene-tools.js +95 -0
  148. package/dist/mcp/scene-tools.js.map +1 -0
  149. package/dist/physics/physics-system.d.ts +1 -1
  150. package/dist/physics/physics-system.d.ts.map +1 -1
  151. package/dist/physics/physics-system.js +9 -4
  152. package/dist/physics/physics-system.js.map +1 -1
  153. package/dist/physics/utils.d.ts.map +1 -1
  154. package/dist/physics/utils.js +1 -1
  155. package/dist/scene-understanding/anchor.js +1 -0
  156. package/dist/scene-understanding/anchor.js.map +1 -1
  157. package/dist/scene-understanding/mesh.js +1 -0
  158. package/dist/scene-understanding/mesh.js.map +1 -1
  159. package/dist/scene-understanding/plane.js +1 -0
  160. package/dist/scene-understanding/plane.js.map +1 -1
  161. package/dist/scene-understanding/scene-understanding-system.d.ts +0 -39
  162. package/dist/scene-understanding/scene-understanding-system.d.ts.map +1 -1
  163. package/dist/scene-understanding/scene-understanding-system.js +10 -2
  164. package/dist/scene-understanding/scene-understanding-system.js.map +1 -1
  165. package/dist/transform/index.d.ts +2 -0
  166. package/dist/transform/index.d.ts.map +1 -1
  167. package/dist/transform/synced-euler.d.ts +62 -0
  168. package/dist/transform/synced-euler.d.ts.map +1 -0
  169. package/dist/transform/synced-euler.js +212 -0
  170. package/dist/transform/synced-euler.js.map +1 -0
  171. package/dist/transform/synced-quaternion.d.ts +11 -0
  172. package/dist/transform/synced-quaternion.d.ts.map +1 -1
  173. package/dist/transform/synced-quaternion.js +29 -0
  174. package/dist/transform/synced-quaternion.js.map +1 -1
  175. package/dist/transform/transform-utils.d.ts +24 -0
  176. package/dist/transform/transform-utils.d.ts.map +1 -0
  177. package/dist/transform/transform-utils.js +53 -0
  178. package/dist/transform/transform-utils.js.map +1 -0
  179. package/dist/transform/transform.d.ts.map +1 -1
  180. package/dist/transform/transform.js +19 -2
  181. package/dist/transform/transform.js.map +1 -1
  182. package/dist/ui/follow.js +1 -0
  183. package/dist/ui/follow.js.map +1 -1
  184. package/dist/ui/index.d.ts +1 -1
  185. package/dist/ui/index.d.ts.map +1 -1
  186. package/dist/ui/screenspace.js +1 -0
  187. package/dist/ui/screenspace.js.map +1 -1
  188. package/dist/ui/ui.d.ts.map +1 -1
  189. package/dist/ui/ui.js +2 -8
  190. package/dist/ui/ui.js.map +1 -1
  191. package/dist/version.d.ts +1 -1
  192. package/dist/version.js +1 -1
  193. package/dist/visibility/visibility.d.ts.map +1 -1
  194. package/dist/visibility/visibility.js +4 -1
  195. package/dist/visibility/visibility.js.map +1 -1
  196. package/package.json +16 -9
  197. package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/html.js +0 -128
  198. package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/html.js.map +0 -1
  199. package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/index.js +0 -161
  200. package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/index.js.map +0 -1
  201. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js +0 -66
  202. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js.map +0 -1
  203. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.js +0 -162
  204. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.js.map +0 -1
  205. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.js +0 -519
  206. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.js.map +0 -1
  207. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.js +0 -15
  208. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.js.map +0 -1
  209. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.js +0 -32
  210. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.js.map +0 -1
  211. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.js +0 -10
  212. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.js.map +0 -1
  213. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js +0 -41
  214. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js.map +0 -1
  215. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.js +0 -35
  216. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.js.map +0 -1
  217. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.js +0 -24
  218. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.js.map +0 -1
  219. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.js +0 -92
  220. package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.js.map +0 -1
  221. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/libs/fflate.module.js +0 -382
  222. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/libs/fflate.module.js.map +0 -1
  223. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/EXRLoader.js +0 -2587
  224. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/EXRLoader.js.map +0 -1
  225. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/RGBELoader.js +0 -477
  226. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/RGBELoader.js.map +0 -1
  227. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js +0 -17
  228. package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js.map +0 -1
@@ -0,0 +1,333 @@
1
+ import { createSystem } from '../ecs/system.js';
2
+ import '../ecs/world.js';
3
+ import 'elics';
4
+ import '../ecs/entity.js';
5
+ import '../ecs/component-registry.js';
6
+ import '../runtime/three.js';
7
+ import '../transform/transform.js';
8
+ import { setWorldPosition, setWorldQuaternion } from '../transform/transform-utils.js';
9
+ import { EnvironmentRaycastTarget, RaycastSpace } from './raycast-target.js';
10
+ import { Matrix4, Vector3, Quaternion } from 'three';
11
+
12
+ /**
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ // Reusable math objects to avoid allocations
19
+ const tempMatrix = new Matrix4();
20
+ const tempPosition = new Vector3();
21
+ const tempQuaternion = new Quaternion();
22
+ const tempWorldQuaternion = new Quaternion();
23
+ const tempScale = new Vector3();
24
+ const tempNormal = new Vector3();
25
+ const tempRayOrigin = new Vector3();
26
+ const tempDirection = new Vector3();
27
+ const upVector = new Vector3(0, 1, 0);
28
+ const defaultDirection = new Vector3(0, 0, -1);
29
+ /**
30
+ * System that manages environment raycasting.
31
+ * @category Environment Raycast
32
+ */
33
+ class EnvironmentRaycastSystem extends createSystem({
34
+ targets: { required: [EnvironmentRaycastTarget] },
35
+ }) {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.pendingControllerSources = new Map();
39
+ }
40
+ init() {
41
+ this.xrManager.addEventListener('sessionstart', () => {
42
+ this.updateEnabledFeatures(this.xrManager.getSession());
43
+ });
44
+ this.xrManager.addEventListener('sessionend', () => {
45
+ this.queries.targets.entities.forEach((entity) => {
46
+ this.cleanupRaycastSource(entity);
47
+ });
48
+ this.hitTestFeatureEnabled = undefined;
49
+ this.pendingControllerSources.clear();
50
+ });
51
+ // Automatic cleanup when component is removed
52
+ this.queries.targets.subscribe('disqualify', (entity) => {
53
+ this.cleanupRaycastSource(entity);
54
+ });
55
+ }
56
+ update(_delta, _time) {
57
+ const frame = this.xrFrame;
58
+ const session = this.xrManager.getSession();
59
+ const referenceSpace = this.xrManager.getReferenceSpace();
60
+ if (!this.hitTestFeatureEnabled || !frame || !session || !referenceSpace) {
61
+ return;
62
+ }
63
+ this.checkPendingControllerSources(session, referenceSpace);
64
+ this.queries.targets.entities.forEach((entity) => {
65
+ const space = entity.getValue(EnvironmentRaycastTarget, 'space');
66
+ if (space === RaycastSpace.Screen) {
67
+ this.handleTransientInput(entity, session, frame, referenceSpace);
68
+ }
69
+ else {
70
+ this.handleStandardRaycast(entity, session, frame, referenceSpace);
71
+ }
72
+ });
73
+ }
74
+ handleStandardRaycast(entity, session, frame, referenceSpace) {
75
+ const source = entity.getValue(EnvironmentRaycastTarget, '_source');
76
+ const sourceRequested = entity.getValue(EnvironmentRaycastTarget, '_sourceRequested');
77
+ if (!source && !sourceRequested) {
78
+ this.requestRaycastSource(entity, session, referenceSpace);
79
+ return;
80
+ }
81
+ if (source) {
82
+ this.updateRaycastResults(entity, frame, referenceSpace);
83
+ }
84
+ }
85
+ handleTransientInput(entity, session, frame, referenceSpace) {
86
+ const transientSource = entity.getValue(EnvironmentRaycastTarget, '_transientSource');
87
+ const sourceRequested = entity.getValue(EnvironmentRaycastTarget, '_sourceRequested');
88
+ if (!transientSource && !sourceRequested) {
89
+ this.requestTransientRaycastSource(entity, session);
90
+ return;
91
+ }
92
+ if (transientSource) {
93
+ this.updateTransientRaycastResults(entity, frame, referenceSpace, transientSource);
94
+ }
95
+ }
96
+ checkPendingControllerSources(session, referenceSpace) {
97
+ if (this.pendingControllerSources.size === 0) {
98
+ return;
99
+ }
100
+ for (const [entity, handedness] of this.pendingControllerSources) {
101
+ const inputSource = this.input.getPrimaryInputSource(handedness);
102
+ if (inputSource) {
103
+ this.pendingControllerSources.delete(entity);
104
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', false);
105
+ this.requestRaycastSource(entity, session, referenceSpace);
106
+ }
107
+ }
108
+ }
109
+ updateEnabledFeatures(xrSession) {
110
+ var _a;
111
+ if (!xrSession) {
112
+ return;
113
+ }
114
+ this.hitTestFeatureEnabled =
115
+ (_a = xrSession.enabledFeatures) === null || _a === void 0 ? void 0 : _a.includes('hit-test');
116
+ if (!this.hitTestFeatureEnabled) {
117
+ console.warn('[EnvironmentRaycastSystem] hit-test feature not enabled.');
118
+ }
119
+ }
120
+ async requestRaycastSource(entity, session, _referenceSpace) {
121
+ if (!session.requestHitTestSource) {
122
+ return;
123
+ }
124
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', true);
125
+ try {
126
+ const space = entity.getValue(EnvironmentRaycastTarget, 'space');
127
+ const xrSpace = await this.resolveXRSpace(entity, space, session);
128
+ if (!xrSpace) {
129
+ return;
130
+ }
131
+ // Build offsetRay from component properties
132
+ const offsetRay = this.buildOffsetRay(entity);
133
+ const source = await session.requestHitTestSource({
134
+ space: xrSpace,
135
+ offsetRay,
136
+ });
137
+ entity.setValue(EnvironmentRaycastTarget, '_source', source);
138
+ entity.setValue(EnvironmentRaycastTarget, '_raySpace', xrSpace);
139
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', false);
140
+ }
141
+ catch (error) {
142
+ console.error('[EnvironmentRaycastSystem] Failed to create source:', error);
143
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', false);
144
+ }
145
+ }
146
+ buildOffsetRay(entity) {
147
+ const offsetPosition = entity.getValue(EnvironmentRaycastTarget, 'offsetPosition');
148
+ const offsetQuaternion = entity.getValue(EnvironmentRaycastTarget, 'offsetQuaternion');
149
+ // Calculate direction from quaternion (apply to default -Z direction)
150
+ if (offsetQuaternion) {
151
+ tempDirection.copy(defaultDirection).applyQuaternion(offsetQuaternion);
152
+ }
153
+ else {
154
+ tempDirection.copy(defaultDirection);
155
+ }
156
+ const origin = offsetPosition
157
+ ? new DOMPointReadOnly(offsetPosition.x, offsetPosition.y, offsetPosition.z, 1)
158
+ : new DOMPointReadOnly(0, 0, 0, 1);
159
+ const direction = new DOMPointReadOnly(tempDirection.x, tempDirection.y, tempDirection.z, 0);
160
+ return new XRRay(origin, direction);
161
+ }
162
+ async requestTransientRaycastSource(entity, session) {
163
+ if (!session.requestHitTestSourceForTransientInput) {
164
+ return;
165
+ }
166
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', true);
167
+ try {
168
+ const source = await session.requestHitTestSourceForTransientInput({
169
+ profile: 'generic-touchscreen',
170
+ });
171
+ entity.setValue(EnvironmentRaycastTarget, '_transientSource', source);
172
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', false);
173
+ }
174
+ catch (error) {
175
+ console.error('[EnvironmentRaycastSystem] Failed to create transient source:', error);
176
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', false);
177
+ }
178
+ }
179
+ async resolveXRSpace(entity, space, session) {
180
+ switch (space) {
181
+ case RaycastSpace.Viewer:
182
+ return await session.requestReferenceSpace('viewer');
183
+ case RaycastSpace.Left:
184
+ case RaycastSpace.Right: {
185
+ const inputSource = this.input.getPrimaryInputSource(space);
186
+ if (inputSource) {
187
+ return inputSource.targetRaySpace;
188
+ }
189
+ this.pendingControllerSources.set(entity, space);
190
+ return null;
191
+ }
192
+ default:
193
+ return await session.requestReferenceSpace('viewer');
194
+ }
195
+ }
196
+ updateRaycastResults(entity, frame, referenceSpace) {
197
+ const source = entity.getValue(EnvironmentRaycastTarget, '_source');
198
+ if (!source) {
199
+ return;
200
+ }
201
+ const raySpace = entity.getValue(EnvironmentRaycastTarget, '_raySpace');
202
+ const object3D = entity.object3D;
203
+ const maxDistance = entity.getValue(EnvironmentRaycastTarget, 'maxDistance');
204
+ try {
205
+ const results = frame.getHitTestResults(source);
206
+ if (results.length === 0) {
207
+ this.clearHitResult(entity, object3D);
208
+ return;
209
+ }
210
+ // Get ray origin for distance calculation
211
+ const rayOrigin = this.getRayOrigin(frame, referenceSpace, raySpace);
212
+ // Find first valid result within maxDistance
213
+ const validResult = this.findValidHitResult(results, referenceSpace, maxDistance, rayOrigin);
214
+ if (!validResult) {
215
+ this.clearHitResult(entity, object3D);
216
+ return;
217
+ }
218
+ this.applyHitResult(entity, object3D, validResult, referenceSpace, undefined);
219
+ }
220
+ catch (_a) {
221
+ this.cleanupRaycastSource(entity);
222
+ }
223
+ }
224
+ updateTransientRaycastResults(entity, frame, referenceSpace, transientSource) {
225
+ const object3D = entity.object3D;
226
+ const maxDistance = entity.getValue(EnvironmentRaycastTarget, 'maxDistance');
227
+ try {
228
+ const transientResults = frame.getHitTestResultsForTransientInput(transientSource);
229
+ for (const transientResult of transientResults) {
230
+ const inputSource = transientResult.inputSource;
231
+ const rayOrigin = this.getRayOrigin(frame, referenceSpace, inputSource === null || inputSource === void 0 ? void 0 : inputSource.targetRaySpace);
232
+ const validResult = this.findValidHitResult(transientResult.results, referenceSpace, maxDistance, rayOrigin);
233
+ if (validResult) {
234
+ this.applyHitResult(entity, object3D, validResult, referenceSpace, inputSource);
235
+ return;
236
+ }
237
+ }
238
+ // No valid hit found in any transient result
239
+ this.clearHitResult(entity, object3D);
240
+ }
241
+ catch (_a) {
242
+ this.cleanupRaycastSource(entity);
243
+ }
244
+ }
245
+ getRayOrigin(frame, referenceSpace, raySpace) {
246
+ if (!raySpace) {
247
+ return null;
248
+ }
249
+ const rayPose = frame.getPose(raySpace, referenceSpace);
250
+ if (!rayPose) {
251
+ return null;
252
+ }
253
+ tempRayOrigin.set(rayPose.transform.position.x, rayPose.transform.position.y, rayPose.transform.position.z);
254
+ return tempRayOrigin;
255
+ }
256
+ findValidHitResult(results, referenceSpace, maxDistance, rayOrigin) {
257
+ for (const result of results) {
258
+ const pose = result.getPose(referenceSpace);
259
+ if (!pose) {
260
+ continue;
261
+ }
262
+ tempMatrix.fromArray(pose.transform.matrix);
263
+ tempMatrix.decompose(tempPosition, tempQuaternion, tempScale);
264
+ // Only apply distance filter if we have a valid ray origin
265
+ if (rayOrigin) {
266
+ const distance = tempPosition.distanceTo(rayOrigin);
267
+ if (distance > maxDistance) {
268
+ continue;
269
+ }
270
+ }
271
+ return result;
272
+ }
273
+ return null;
274
+ }
275
+ applyHitResult(entity, object3D, result, referenceSpace, inputSource) {
276
+ const pose = result.getPose(referenceSpace);
277
+ if (!pose) {
278
+ this.clearHitResult(entity, object3D);
279
+ return;
280
+ }
281
+ tempMatrix.fromArray(pose.transform.matrix);
282
+ tempMatrix.decompose(tempPosition, tempQuaternion, tempScale);
283
+ tempNormal.set(0, 1, 0).applyQuaternion(tempQuaternion);
284
+ if (object3D) {
285
+ setWorldPosition(object3D, tempPosition);
286
+ tempWorldQuaternion.setFromUnitVectors(upVector, tempNormal);
287
+ setWorldQuaternion(object3D, tempWorldQuaternion);
288
+ object3D.visible = true;
289
+ }
290
+ entity.setValue(EnvironmentRaycastTarget, 'xrHitTestResult', result);
291
+ entity.setValue(EnvironmentRaycastTarget, 'inputSource', inputSource);
292
+ }
293
+ clearHitResult(entity, object3D) {
294
+ entity.setValue(EnvironmentRaycastTarget, 'xrHitTestResult', undefined);
295
+ entity.setValue(EnvironmentRaycastTarget, 'inputSource', undefined);
296
+ if (object3D) {
297
+ object3D.visible = false;
298
+ }
299
+ }
300
+ cleanupRaycastSource(entity) {
301
+ const source = entity.getValue(EnvironmentRaycastTarget, '_source');
302
+ if (source) {
303
+ try {
304
+ source.cancel();
305
+ }
306
+ catch (_a) {
307
+ /* ignore */
308
+ }
309
+ }
310
+ const transientSource = entity.getValue(EnvironmentRaycastTarget, '_transientSource');
311
+ if (transientSource) {
312
+ try {
313
+ transientSource.cancel();
314
+ }
315
+ catch (_b) {
316
+ /* ignore */
317
+ }
318
+ }
319
+ entity.setValue(EnvironmentRaycastTarget, '_source', undefined);
320
+ entity.setValue(EnvironmentRaycastTarget, '_raySpace', undefined);
321
+ entity.setValue(EnvironmentRaycastTarget, '_transientSource', undefined);
322
+ entity.setValue(EnvironmentRaycastTarget, '_sourceRequested', false);
323
+ entity.setValue(EnvironmentRaycastTarget, 'xrHitTestResult', undefined);
324
+ entity.setValue(EnvironmentRaycastTarget, 'inputSource', undefined);
325
+ this.pendingControllerSources.delete(entity);
326
+ if (entity.object3D) {
327
+ entity.object3D.visible = false;
328
+ }
329
+ }
330
+ }
331
+
332
+ export { EnvironmentRaycastSystem };
333
+ //# sourceMappingURL=environment-raycast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-raycast.js","sources":["../../src/environment-raycast/environment-raycast.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;AAKG;AAOH;AACA,MAAM,UAAU,GAAG,IAAI,OAAO,EAAE;AAChC,MAAM,YAAY,GAAG,IAAI,OAAO,EAAE;AAClC,MAAM,cAAc,GAAG,IAAI,UAAU,EAAE;AACvC,MAAM,mBAAmB,GAAG,IAAI,UAAU,EAAE;AAC5C,MAAM,SAAS,GAAG,IAAI,OAAO,EAAE;AAC/B,MAAM,UAAU,GAAG,IAAI,OAAO,EAAE;AAChC,MAAM,aAAa,GAAG,IAAI,OAAO,EAAE;AACnC,MAAM,aAAa,GAAG,IAAI,OAAO,EAAE;AACnC,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAE9C;;;AAGG;AACG,MAAO,wBAAyB,SAAQ,YAAY,CAAC;AACzD,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,wBAAwB,CAAC,EAAE;CAClD,CAAC,CAAA;AAFF,IAAA,WAAA,GAAA;;AAIU,QAAA,IAAA,CAAA,wBAAwB,GAAG,IAAI,GAAG,EAA4B;IAqexE;IAneE,IAAI,GAAA;QACF,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,cAAc,EAAE,MAAK;YACnD,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;A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AAM,CAAC,QAAQ,CAAC,wBAAwB,EAAE,kBAAkB,EAAE,KAAK,CAAC;QACpE,MAAM,CAAC,QAAQ,CAAC,wBAAwB,EAAE,iBAAiB,EAAE,SAAS,CAAC;QACvE,MAAM,CAAC,QAAQ,CAAC,wBAAwB,EAAE,aAAa,EAAE,SAAS,CAAC;AACnE,QAAA,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,MAAM,CAAC;AAE5C,QAAA,IAAI,MAAM,CAAC,QAAQ,EAAE;AACnB,YAAA,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAG,KAAK;QACjC;IACF;AACD;;;;"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export * from './environment-raycast.js';
8
+ export * from './raycast-target.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment-raycast/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { Types } from '../ecs/index.js';
8
+ /**
9
+ * Ray source options for environment raycasting.
10
+ * @category Environment Raycast
11
+ */
12
+ export declare const RaycastSpace: {
13
+ /** Use left controller's target ray */
14
+ readonly Left: "left";
15
+ /** Use right controller's target ray */
16
+ readonly Right: "right";
17
+ /** Use viewer/head position and gaze direction */
18
+ readonly Viewer: "viewer";
19
+ /** For phone AR - tracks screen touch for tap-to-place */
20
+ readonly Screen: "screen";
21
+ };
22
+ export type RaycastSpace = (typeof RaycastSpace)[keyof typeof RaycastSpace];
23
+ /**
24
+ * Component that makes an entity follow environment raycast hit points.
25
+ *
26
+ * @remarks
27
+ * The entity's Object3D is automatically positioned at the raycast hit point
28
+ * and oriented to match the surface normal. When there's no hit, the Object3D
29
+ * is hidden.
30
+ *
31
+ * Use `offsetPosition` and `offsetQuaternion` to offset the ray from the
32
+ * space origin. This is useful for one-shot raycasts where you want to
33
+ * cast from a specific position/orientation relative to the controller.
34
+ *
35
+ * @example Teleport reticle that follows controller ray
36
+ * ```ts
37
+ * const reticle = world.createTransformEntity(reticleMesh);
38
+ * reticle.addComponent(EnvironmentRaycastTarget, { space: RaycastSpace.Right });
39
+ * // Reticle automatically moves to where controller points
40
+ * ```
41
+ *
42
+ * @example Place object on trigger press
43
+ * ```ts
44
+ * const xrResult = entity.getValue(EnvironmentRaycastTarget, 'xrHitTestResult');
45
+ * if (xrResult && gamepad.getSelectStart()) {
46
+ * spawnObject(entity.object3D.position.clone());
47
+ * }
48
+ * ```
49
+ *
50
+ * @category Environment Raycast
51
+ */
52
+ export declare const EnvironmentRaycastTarget: import("elics").Component<{
53
+ /** Ray source: 'left', 'right', 'viewer', or 'screen'. @default 'right' */
54
+ space: {
55
+ type: Types.Enum;
56
+ enum: {
57
+ /** Use left controller's target ray */
58
+ readonly Left: "left";
59
+ /** Use right controller's target ray */
60
+ readonly Right: "right";
61
+ /** Use viewer/head position and gaze direction */
62
+ readonly Viewer: "viewer";
63
+ /** For phone AR - tracks screen touch for tap-to-place */
64
+ readonly Screen: "screen";
65
+ };
66
+ default: "right";
67
+ };
68
+ /** Maximum raycast distance in meters. @default 100 */
69
+ maxDistance: {
70
+ type: Types.Float32;
71
+ default: number;
72
+ };
73
+ /** Offset position from the space origin. @default (0, 0, 0) */
74
+ offsetPosition: {
75
+ type: Types.Object;
76
+ default: undefined;
77
+ };
78
+ /** Offset quaternion to rotate the ray direction. @default identity */
79
+ offsetQuaternion: {
80
+ type: Types.Object;
81
+ default: undefined;
82
+ };
83
+ /** The XRHitTestResult when there's a hit, undefined otherwise. @readonly */
84
+ xrHitTestResult: {
85
+ type: Types.Object;
86
+ default: undefined;
87
+ };
88
+ /** For Screen mode: the input source that triggered the hit. @readonly */
89
+ inputSource: {
90
+ type: Types.Object;
91
+ default: undefined;
92
+ };
93
+ /** @internal */
94
+ _source: {
95
+ type: Types.Object;
96
+ default: undefined;
97
+ };
98
+ /** @internal */
99
+ _raySpace: {
100
+ type: Types.Object;
101
+ default: undefined;
102
+ };
103
+ /** @internal */
104
+ _transientSource: {
105
+ type: Types.Object;
106
+ default: undefined;
107
+ };
108
+ /** @internal */
109
+ _sourceRequested: {
110
+ type: Types.Boolean;
111
+ default: false;
112
+ };
113
+ }>;
114
+ //# sourceMappingURL=raycast-target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raycast-target.d.ts","sourceRoot":"","sources":["../../src/environment-raycast/raycast-target.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB,uCAAuC;;IAEvC,wCAAwC;;IAExC,kDAAkD;;IAElD,0DAA0D;;CAElD,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,wBAAwB;IAGjC,2EAA2E;;;;YA5C7E,uCAAuC;;YAEvC,wCAAwC;;YAExC,kDAAkD;;YAElD,0DAA0D;;;;;IA4CxD,uDAAuD;;;;;IAGvD,gEAAgE;;;;;IAEhE,uEAAuE;;;;;IAGvE,6EAA6E;;;;;IAE7E,0EAA0E;;;;;IAG1E,gBAAgB;;;;;IAEhB,gBAAgB;;;;;IAEhB,gBAAgB;;;;;IAEhB,gBAAgB;;;;;EAInB,CAAC"}
@@ -0,0 +1,84 @@
1
+ import '@preact/signals-core';
2
+ import '../ecs/world.js';
3
+ import { createComponent, Types } from 'elics';
4
+ import '../ecs/entity.js';
5
+ import '../ecs/component-registry.js';
6
+
7
+ /**
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ /**
14
+ * Ray source options for environment raycasting.
15
+ * @category Environment Raycast
16
+ */
17
+ const RaycastSpace = {
18
+ /** Use left controller's target ray */
19
+ Left: 'left',
20
+ /** Use right controller's target ray */
21
+ Right: 'right',
22
+ /** Use viewer/head position and gaze direction */
23
+ Viewer: 'viewer',
24
+ /** For phone AR - tracks screen touch for tap-to-place */
25
+ Screen: 'screen',
26
+ };
27
+ /**
28
+ * Component that makes an entity follow environment raycast hit points.
29
+ *
30
+ * @remarks
31
+ * The entity's Object3D is automatically positioned at the raycast hit point
32
+ * and oriented to match the surface normal. When there's no hit, the Object3D
33
+ * is hidden.
34
+ *
35
+ * Use `offsetPosition` and `offsetQuaternion` to offset the ray from the
36
+ * space origin. This is useful for one-shot raycasts where you want to
37
+ * cast from a specific position/orientation relative to the controller.
38
+ *
39
+ * @example Teleport reticle that follows controller ray
40
+ * ```ts
41
+ * const reticle = world.createTransformEntity(reticleMesh);
42
+ * reticle.addComponent(EnvironmentRaycastTarget, { space: RaycastSpace.Right });
43
+ * // Reticle automatically moves to where controller points
44
+ * ```
45
+ *
46
+ * @example Place object on trigger press
47
+ * ```ts
48
+ * const xrResult = entity.getValue(EnvironmentRaycastTarget, 'xrHitTestResult');
49
+ * if (xrResult && gamepad.getSelectStart()) {
50
+ * spawnObject(entity.object3D.position.clone());
51
+ * }
52
+ * ```
53
+ *
54
+ * @category Environment Raycast
55
+ */
56
+ const EnvironmentRaycastTarget = createComponent('EnvironmentRaycastTarget', {
57
+ /** Ray source: 'left', 'right', 'viewer', or 'screen'. @default 'right' */
58
+ space: {
59
+ type: Types.Enum,
60
+ enum: RaycastSpace,
61
+ default: RaycastSpace.Right,
62
+ },
63
+ /** Maximum raycast distance in meters. @default 100 */
64
+ maxDistance: { type: Types.Float32, default: 100 },
65
+ /** Offset position from the space origin. @default (0, 0, 0) */
66
+ offsetPosition: { type: Types.Object, default: undefined },
67
+ /** Offset quaternion to rotate the ray direction. @default identity */
68
+ offsetQuaternion: { type: Types.Object, default: undefined },
69
+ /** The XRHitTestResult when there's a hit, undefined otherwise. @readonly */
70
+ xrHitTestResult: { type: Types.Object, default: undefined },
71
+ /** For Screen mode: the input source that triggered the hit. @readonly */
72
+ inputSource: { type: Types.Object, default: undefined },
73
+ /** @internal */
74
+ _source: { type: Types.Object, default: undefined },
75
+ /** @internal */
76
+ _raySpace: { type: Types.Object, default: undefined },
77
+ /** @internal */
78
+ _transientSource: { type: Types.Object, default: undefined },
79
+ /** @internal */
80
+ _sourceRequested: { type: Types.Boolean, default: false },
81
+ }, 'Entity follows environment raycast hit points');
82
+
83
+ export { EnvironmentRaycastTarget, RaycastSpace };
84
+ //# sourceMappingURL=raycast-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raycast-target.js","sources":["../../src/environment-raycast/raycast-target.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;;;AAKG;AAIH;;;AAGG;AACI,MAAM,YAAY,GAAG;;AAE1B,IAAA,IAAI,EAAE,MAAM;;AAEZ,IAAA,KAAK,EAAE,OAAO;;AAEd,IAAA,MAAM,EAAE,QAAQ;;AAEhB,IAAA,MAAM,EAAE,QAAQ;;AAKlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACI,MAAM,wBAAwB,GAAG,eAAe,CACrD,0BAA0B,EAC1B;;AAEE,IAAA,KAAK,EAAE;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,QAAA,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,YAAY,CAAC,KAAK;AAC5B,KAAA;;IAED,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE;;IAGlD,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;;IAE1D,gBAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;;IAG5D,eAAe,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;;IAE3D,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;;IAGvD,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;;IAEnD,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;;IAErD,gBAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;;IAE5D,gBAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;CAC1D,EACD,+CAA+C;;;;"}
@@ -16,6 +16,7 @@ import { Types } from '../ecs/index.js';
16
16
  * - **RotateAtSource**: Object rotates in place without translation or scaling.
17
17
  * - Optional `returnToOrigin` makes objects snap back to their original position when released.
18
18
  * - Supports rotation, translation, and scaling with per‑axis constraints.
19
+ * - Configure target position and rotation offsets relative to the input source for MoveTowardsTarget mode.
19
20
  * - Works with the {@link GrabSystem} to create specialized distance grab handles.
20
21
  * - Perfect for telekinetic‑style interactions and remote object manipulation.
21
22
  *
@@ -44,6 +45,15 @@ import { Types } from '../ecs/index.js';
44
45
  * })
45
46
  * ```
46
47
  *
48
+ * @example Distance grabbable with offset (object stays 0.3m in front of controller)
49
+ * ```ts
50
+ * entity.addComponent(DistanceGrabbable, {
51
+ * movementMode: MovementMode.MoveTowardsTarget,
52
+ * targetPositionOffset: [0, 0, -0.3], // 0.3m forward in controller space
53
+ * targetQuaternionOffset: [0, 0, 0, 1], // no rotation offset
54
+ * })
55
+ * ```
56
+ *
47
57
  * @category Grab
48
58
  * @see {@link GrabSystem}
49
59
  * @see {@link OneHandGrabbable}
@@ -112,10 +122,25 @@ export declare const DistanceGrabbable: import("elics").Component<{
112
122
  type: Types.Boolean;
113
123
  default: false;
114
124
  };
115
- /** Object movement speed for the MoveTowardsTarget movement mode. */
116
- moveSpeed: {
125
+ /** A boolean value to set whether the object will be detached from its parent and attach to the scene/Level root when grabbed. */
126
+ detachOnGrab: {
127
+ type: Types.Boolean;
128
+ default: false;
129
+ };
130
+ /** Object movement and rotation speed factor for the MoveTowardsTarget movement mode with a scale from 0 to 1. */
131
+ moveSpeedFactor: {
117
132
  type: Types.Float32;
118
133
  default: number;
119
134
  };
135
+ /** Target position offset relative to the input source for MoveTowardsTarget mode in [x, y, z]. */
136
+ targetPositionOffset: {
137
+ type: Types.Vec3;
138
+ default: [number, number, number];
139
+ };
140
+ /** Target rotation offset as a quaternion relative to the input source for MoveTowardsTarget mode in [x, y, z, w]. */
141
+ targetQuaternionOffset: {
142
+ type: Types.Vec4;
143
+ default: [number, number, number, number];
144
+ };
120
145
  }>;
121
146
  //# sourceMappingURL=distance-grabbable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"distance-grabbable.d.ts","sourceRoot":"","sources":["../../src/grab/distance-grabbable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,iBAAiB;IAG1B,qEAAqE;;;;;IAErE,gGAAgG;;;;;IAKhG,gGAAgG;;;;;IAKhG,8EAA8E;;;;;IAE9E,mFAAmF;;;;;IAKnF,mFAAmF;;;;;IAKnF,gFAAgF;;;;;IAEhF,kFAAkF;;;;;IAKlF,kFAAkF;;;;;IAKlF,gFAAgF;;;;;;;;;;;IAMhF,iGAAiG;;;;;IAEjG,qEAAqE;;;;;EAIxE,CAAC"}
1
+ {"version":3,"file":"distance-grabbable.d.ts","sourceRoot":"","sources":["../../src/grab/distance-grabbable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,iBAAiB;IAG1B,qEAAqE;;;;;IAErE,gGAAgG;;;;;IAKhG,gGAAgG;;;;;IAKhG,8EAA8E;;;;;IAE9E,mFAAmF;;;;;IAKnF,mFAAmF;;;;;IAKnF,gFAAgF;;;;;IAEhF,kFAAkF;;;;;IAKlF,kFAAkF;;;;;IAKlF,gFAAgF;;;;;;;;;;;IAMhF,iGAAiG;;;;;IAEjG,kIAAkI;;;;;IAElI,kHAAkH;;;;;IAElH,mGAAmG;;;;;IAKnG,sHAAsH;;;;;EAOzH,CAAC"}