@realitycollective/native-interactions 0.1.1-preview.1 → 0.1.1-preview.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.
package/CHANGELOG.md CHANGED
@@ -8,15 +8,44 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
8
8
 
9
9
  ### Added
10
10
 
11
+ - `@realitycollective/webxr-interactions` - the near-pointer rule, IWSDK 1.0.0's pointer stack restated as one core decision every binding runs (`near-pointer.ts`, `NEAR_POINTER_DEFAULTS`): a fingertip (or a controller's ray origin) within 0.15 m of a target's surface owns the source as the touch pointer (hysteresis out to 0.2 m), presses at 0.02 m arriving from outside and releases on the way out, never pressing from inside or behind; the grip is a 0.07 m grab sphere; per source the first of touch, grab, ray with a candidate is the active pointer, locked while it presses or grabs; and `InteractionRuntime` publishes per-source `PointerVisuals` (`onPointerVisuals`, `getPointerVisuals`, `getActivePointer`): the ray and its cursor show only while the ray owns the source or nothing does, with the cursor at the active pointer's hit. `InteractableDescriptor.pokeRadius` is now the touch hover enter distance for that target (default 0.15 m, was a 0.05 m proximity trigger). `nearPointerContractCases()` is the shared suite, run on every platform's hit tester.
12
+ - `@realitycollective/webxr-interactions` - the physics contract (`physics.ts`): `PhysicsFacility`, the platform physics behind one set of semantics and IWSDK 1.0.0's defaults (`PHYSICS_DEFAULTS`: gravity `[0, -9.81, 0]`, 60 steps per second with interpolation, a dynamic body with no damping and gravity factor 1, an auto shape with density 1, restitution 0 and friction 0.5), static and kinematic states, suspend for a hold, resume with the release velocity, teleport with velocity cleared. `physicsFacilityContractCases()` proves a facility falls and rests, bounces, holds, throws, teleports and disposes; `MemoryPhysicsFacility` is the engine-free reference. Every binding names a default engine and takes an app's own facility instead: `createThreeInteractions({ physics: { rapier } })` (Rapier, `RapierPhysicsFacility`, proved against the real engine), `connectXRBlocksInteractions({ physics: { rapier } })` (the Rapier XR Blocks bundles), `registerInteractions` (Havok through IWSDK's components, `IWSDKPhysicsFacility`), `createBabylonInteractions({ physics: { kit } })` (Havok, `BabylonPhysicsFacility`, proved against a fake), and the native `physics` slice (`NativePhysicsHost`, Jolt on Quest and Android, RealityKit on visionOS, with every obligation stated in `native-types.ts` and the whole shared suite in the host conformance kit). A registered object with a body drives the held pose through its facility; `register` takes `body` and `shape` specs.
13
+ - `@realitycollective/native-interactions` - `NativeInputHost.applyPointerVisuals(sourceId, visuals)`: the host is told each frame whether to draw a source's ray and where its cursor sits, and draws exactly that; the earlier rule that the host draws a cursor at every ray hit is withdrawn. The kit gains `input/the ray and cursor are drawn exactly as told`, the whole `nearPointerContractCases()` suite over the host's own queries, and the physics cases.
14
+ - `@realitycollective/iwsdk-interactions` - `test/near-pointer-reference.test.ts` reads the touch and grab constants off IWSDK 1.0.0's own pointer classes and drives the core touch machine beside `@pmndrs/pointer-events`' press rule, recording the one frame they differ on by design (a fingertip first seen inside the press band).
15
+ - `@realitycollective/xrblocks-interactions` - the provider reads the XR Blocks camera's head pose through real three.js scratch objects; a plain object handed to `getWorldPosition` threw against the real camera.
16
+ - Eye gaze and pinch, on every platform, following Meta IWSDK 1.0.0's gaze-and-pinch interaction (the primary input on Meta VR Glasses). The provider half of the rule is `@realitycollective/webxr-input` 0.1.7's `EyeGazeInput`; this repository applies it in every provider and adds the targeting half to the core. `@realitycollective/webxr-interactions` - `HitTester` gains an optional `hitCone(ray, halfAngle, maxLength)`, IWSDK's `GazeConecaster` query (a target the ray reaches wins outright, otherwise the nearest to the axis within the cone, the nearer on a tie within half a degree), with `coneHitForSpheres` for sphere-based testers and `GazeConsensus`, the time-weighted dwell vote over IWSDK's 0.15 s window. `InteractionRuntime` takes `eyeGaze` options (`EYE_GAZE_DEFAULTS`: 5 degree cone, 30 m, 0.15 s, suppression on, follow the hand on) and, when the provider reports `capabilities.eyeGaze`, targets the gaze source through the cone and the consensus, targets nothing while a hand's near pointer is hovering or grabbing, satisfies `gaze.required` and dwell from the eye gaze, presses or grabs the gazed target when the owning hand pinches, and from the next frame drives the gaze source's ray from the pinching hand aimed at the gaze hit (`selectorPose`), so `onSample` listeners such as the pointer bridge and every behaviour see a drag that follows the hand. `hitTesterContractCases()` gains five `hitCone` cases that run when a tester has one. Without `eyeGaze` nothing changes: a gaze-kind source still targets by plain ray as head gaze does.
17
+ - `@realitycollective/iwsdk-interactions` - `IWSDKInputProvider` reports `eyeGaze` when the session carries a gaze input source, reads IWSDK's own sampled eye pose (`xrOrigin.eyeSpace` while `gazeOrigin` is `"tracked"`) and applies `EyeGazeInput`, so it hands far targeting to gaze exactly when IWSDK's `GazePointer` does; `EntityHitTester` answers `hitCone` over its spheres. `test/gaze-reference.test.ts` drives IWSDK's `FilteredEyeGaze` and `GazeConecaster` side by side with the core's filter and consensus.
18
+ - `@realitycollective/threejs-interactions` (reused by `@realitycollective/xrblocks-interactions`) - `WebXRInputProvider` finds the `targetRayMode === "gaze"` source, poses it against the reference space and applies `EyeGazeInput`; `ThreeHitTester.hitCone` tries the raycast first and then the cone over the registered roots' bounding spheres.
19
+ - `@realitycollective/babylon-interactions` - `BabylonInputProvider` reads the `xr-eye-tracking` feature (`WebXREyeTracking.getEyeGaze()`) when the app enabled it and applies `EyeGazeInput`; `BabylonHitTester.hitCone` runs the cone over its spheres.
20
+ - `@realitycollective/native-interactions` - `NativeInputFacts.eyeTracking` (an eye-gaze source is present: OpenXR `XR_EXT_eye_gaze_interaction` bound and active) and `NativeInputHost.getEyeGazePose()` (this frame's gaze target-ray pose, world space, or null) let a native host report the facts while the binding applies the rule: `eyeGaze` is derived, far rays are dropped, the pinch selects, and the selector pose is built from the hand's ray. The `interactions` slice gains an optional `hitCone` the host answers over its own scene, forwarded by `NativeHitTester`. The host conformance kit gains `input/eye gaze` cases: a host that reports eye tracking must pose the gaze, and a hidden target never answers a cone query.
21
+
22
+ - `@realitycollective/webxr-interactions` - three `hitTesterContractCases()` that hold every platform to IWSDK's hit-test semantics: `hitProximity` reports the distance to the target's SURFACE, clamped at zero (a point 3 cm outside a 10 cm target reports 0.03 within 1 mm, not 0.13); it misses a target whose surface is farther than the query radius; and a ray that passes a target farther than its radius misses it. Every platform in the repository already passed them. The `HitTester` and `TransformPort.setEffect` docs now state those semantics, and the effect rule: `scale` multiplies the rest scale, `emissive` adds to the base intensity, and the last write wins.
23
+ - `@realitycollective/native-interactions` - `nativeInteractionsHostConformanceCases()`, the host conformance kit a native app runs on its device against its real slices: the core's whole `hitTesterContractCases()` run against the host itself, the 0.1 m default target radius, the release velocity reaching `endHold`, live-session capabilities, presence hiding the models only per side, `"auto"` following the live modality, and presence never hiding the cursors. The host provides the test readbacks of the new `NativeInteractionsTestHost` type. The kit fails a host that measures proximity to a target's centre, ignores the radius it is handed, loses a release velocity, or draws the wrong presence.
11
24
  - `@realitycollective/webxr-interactions` - shared conformance suites for `HitTester` and `TransformPort`, `hitTesterContractCases()` and `transformPortContractCases()`, alongside the existing `inputProviderContractCases()` from `@realitycollective/webxr-input`. Runner-free data, the same pattern as WebXR-UIExtensions' `windowHostContractCases()`: each case throws a plain `Error` naming what a platform's ray/proximity query or transform read/write broke, and asserts only what `ports.ts` documents - a ray or proximity query answers null or an id with a positive distance and a point near the query, the nearer of two targets wins, an offset round-trips, `getWorldPose()` is finite with a unit quaternion, `getRestWorldPose()` is the registration pose and stays put, `getWorldPose()` follows `setLocalOffset`, `setLocalRotation` and `setWorldPose` from that rest frame, every returned tuple is a fresh value the caller owns and no tuple passed in is kept, and the optional `setEffect` accepts its shape without throwing. Each platform's subject starts away from the origin and turned, so a port that ignores its rest frame fails. Run against all five platforms in `packages/iwsdk-interactions/test/port-parity.test.ts`, next to the provider parity suite; every platform passes every case.
12
25
  - `@realitycollective/native-interactions` - a native host adapter, the fifth platform. It reads the `input` and `interactions` slices a native app (OpenXR on Quest, CompositorServices on visionOS) installs on `globalThis.__rcHost`, or hands in directly, and maps them onto `InputProvider`, `HitTester` and `TransformPort` with no engine dependency at all - assets and rendering stay in the native app, and only tuples and target ids cross the boundary. Every snapshot, hit and pose read across that boundary is copied, so a host that reuses its own buffers cannot reach an object the app is still holding, and optional members (`getHeadPose`, `sampleHints`, `pulse`, `setPresenceVisible`, `setPresenceModality`, `setWorldPose`, `setEffect`) are present only when the host slice itself carries them. `createNativeInteractions()` is the one-call setup, with the same shape as the other adapters' setups; `attachToHost` drives updates from the app's frame callback. The public surface matches the other adapters, and slice reading and tuple copying stay internal. Covered headlessly by an in-memory fake of both slices, including the shared `InputProvider` contract suite.
13
26
  - `@realitycollective/webxr-interactions` - "held pose" for a grabbed object with physics: `TransformPort` gains two optional members, `beginHold()` and `endHold(release: HoldRelease)`, and the `HoldRelease` type they take (`linearVelocity`/`angularVelocity`, metres and radians per second, world space). A host whose object has physics uses them to give a `poseOnly` grab the same three behaviours native grab fulfilment already had: held (physics suspended, the object follows `setWorldPose` exactly, gravity and collisions do nothing), released (physics resumes with the grabbing hand's velocity, so a throw carries through), and reset (a `setWorldPose` while not held teleports and clears velocity - "back to the tee"). `setWorldPose`'s own doc states this split. A platform with no physics grows neither member and behaves exactly as before; a platform that fulfils grabs natively is expected to show the same three behaviours through its own engine, and the runtime never calls `beginHold`/`endHold` for one. `InteractorInfo` gains optional `linearVelocity`/`angularVelocity`, the grabbing source's tracked velocity `GrabBehaviour` reads for the release. `transformPortContractCases()` gains three cases - Held, Released, Reset - that run only when the contract subject carries an optional `physics` driver, and skip otherwise.
14
27
  - `@realitycollective/native-interactions` - the `interactions` slice gains the matching optional `beginHold(targetId)`/`endHold(targetId, release)`, keyed by target id like every other member. `NativeTransformPort` grows the two only when the host slice carries them, the same rule as `setWorldPose`/`setEffect`. The README states the rule for a native app that fulfils grabs itself: it is responsible for showing held/released/reset through its own engine, and `beginHold`/`endHold` are never called for a grab that app already owns.
15
28
  - `@realitycollective/babylon-interactions` - `BabylonTransformPort` implements the held pose over Physics V2's `PhysicsBody`, through a new `physicsMotionTypes` construction option (Babylon's own `PhysicsMotionType.ANIMATED`/`.DYNAMIC` values - this package holds no Babylon values, only shapes). A held node switches to `ANIMATED`; `endHold` switches it back to `DYNAMIC` with the release velocity. A node with no `physicsBody`, or a construction with no `physicsMotionTypes`, grows neither member. Written from the Babylon Physics V2 documentation - this package has no `@babylonjs/core`/`@babylonjs/havok` dependency to verify it against - and not yet exercised against a live scene.
16
29
  - `@realitycollective/iwsdk-interactions` - `IWSDKTransformPort` takes an optional `physics: IWSDKPhysicsBinding` (`beginHold`/`endHold`/`teleport`); `IWSDKInteractions.register()` builds one from `@iwsdk/core`'s `PhysicsBody`/`PhysicsShape`/`PhysicsManipulation` components and `PhysicsSystem.setBodyTransform` whenever the entity has a physics body. A hold removes `PhysicsBody` (keeping `PhysicsShape`), which tears down the entity's Havok body so gravity, collisions and the physics-to-object3D sync all stop while the port's own `setWorldPose` writes take over; release re-adds `PhysicsBody` at the state it had and, for a nonzero velocity, a `PhysicsManipulation`. Never the `Grabbed` tag `GrabSystem` owns - its own doc says not to add or remove it by hand - and never the private Havok handle `PhysicsSystem` keeps to itself.
30
+ - `@realitycollective/threejs-interactions` (reused by `@realitycollective/xrblocks-interactions`) - `ThreeHitTester.register(id, object, targetRadius?)` takes an optional radius, default 0.1 m, used by `hitProximity` for a target with no geometry of its own (a bare `Group`), matching IWSDK's default for a target registered without one. A target with a mesh keeps using its own bounding-sphere radius. `hitTesterContractCases()` gains a case proving the default, run wherever a driver's new optional `placeBare(id, position)` can register one.
31
+ - `@realitycollective/threejs-interactions` (reused by `@realitycollective/xrblocks-interactions`) - `ThreeHitTester.hitRay`/`hitProximity` now drop a hit whose object, or any ancestor, has `visible === false`. three.js's own `Raycaster` ignores `visible` by design (r186, issue 14700), so the rule is re-applied by the adapter. `hitTesterContractCases()` gains a case proving it, run wherever a driver's new optional `setVisible(id, visible)` can toggle one; `HitTester`'s doc states the rule for every platform.
32
+ - `@realitycollective/threejs-interactions`, `@realitycollective/babylon-interactions` and `@realitycollective/xrblocks-interactions` - `sample()` reports no sources while a live session exists but is not `"visible"` (backgrounded, or the browser's own "content is obscured" state), the rule `IWSDKInputProvider` already applied to `world.visibilityState`. Proven per platform, and through `provider-parity.test.ts`'s shared suite where a fake session can express visibility.
33
+ - `@realitycollective/xrblocks-interactions` - `XRBlocksInputProvider` reads the real grip pose from `controller.inputSource.gripSpace` (falling back to `targetRaySpace`), through a new optional `xr` context on `XRBlocksContext` - the same `WebXRManager`-shaped access `webxr-uiextensions`' xrblocks integration already reads `gripSpace` through. Angular velocity, differentiated from consecutive grip poses by the core's `VelocityTracker`, is now meaningful; before this the grip pose was the ray origin with an identity orientation, and every rotation reads were zero. `xr` also gates sampling on session visibility. Falls back to the previous ray-pose behaviour with no `xr` context supplied.
34
+ - `@realitycollective/xrblocks-interactions` - `XRBlocksInputProvider.pulse()` plays a haptic pulse through the controller's WebXR Gamepad `hapticActuators` (`Controller.gamepad`, verified against `input/Controller.ts`), clamping intensity to 0..1 exactly as the other providers do, and reports `capabilities.haptics`/`hapticsAvailable` accordingly. xrblocks 0.20.0 had no such surface; 0.21.1 does.
35
+ - `@realitycollective/xrblocks-interactions` - a new `nativeGrab` provider option (mirroring `IWSDKInputProvider`'s) switches `capabilities.grabs` to `"native"`, and `XRBlocksInteractions.onObjectGrabStart`/`onObjectGrabEnd` forward XR Blocks' `ManipulationManager`-driven `ObjectGrabEvent` Script hooks into `setNativeGrabbing`, the same hint `IWSDKInputProvider` raises for its own native grab. xrblocks 0.20.0 had no engine-owned grab; 0.21.1's `ManipulationManager` does.
36
+ - `@realitycollective/xrblocks-interactions` - a new `XRBlocksTransformPort`, replacing the reused `ThreeTransformPort` in the platform's own registration path (`XRBlocksInteractions.register()`) and in `port-parity.test.ts`'s platform list. It implements `beginHold`/`endHold` when the target's object carries a RAPIER rigid body (`register(descriptor, object, { rigidBody })`, plus a `rigidBodyTypes` construction option - the same `physicsMotionTypes` idea `BabylonTransformPort` uses for Havok): held switches the body kinematic and keeps it at the object's written pose; released switches it back to dynamic with the release velocity. With no body, or no `rigidBodyTypes`, it behaves exactly like `ThreeTransformPort`. xrblocks 0.20.0 bundled no physics; 0.21.1 bundles RAPIER (`PhysicsOptions.RAPIER`).
37
+ - `@realitycollective/babylon-interactions` - `BabylonTransformPort.setEffect`'s emissive pulse now lights the target: `material.emissiveColor` (`StandardMaterial` and `PBRMaterial` both carry it) is scaled by `1 + effect.emissive` about its own captured base, and on a `PBRMaterial`, `emissiveIntensity` is additionally set to its base plus `effect.emissive`, the same additive rule three.js's `emissiveIntensity` already follows. Before this the pulse only scaled the mesh. A node with no material, or a material with no `emissiveColor`, is left alone, as before.
17
38
 
18
39
  ### Changed
19
40
 
41
+ - The reference is now IWSDK 1.0. `@realitycollective/iwsdk-interactions` peers on `@iwsdk/core` and `@iwsdk/xr-input` `>=1.0.0 <2.0.0` (was `>=0.5.0 <0.6.0`) and is built and tested against 1.0.0. The per-frame visibility write the presence code works around is unchanged in 1.0.
42
+ - `@realitycollective/threejs-interactions`, `@realitycollective/babylon-interactions` and `@realitycollective/xrblocks-interactions` - a controller's `indexTip` is its ray origin, as IWSDK's input rig makes it, so a controller pokes buttons and interactables as a fingertip does. Before this only a tracked hand carried an index tip on these three platforms, and controllers could not poke at all.
43
+ - **Breaking for native hosts:** `@realitycollective/native-interactions` now derives and decides what the IWSDK provider derives and decides, and a native host reports facts rather than conclusions. What a host must absorb:
44
+ - The `input` slice reports `getFacts()` (`immersive`, `focused`, `handTracking`) and `onFactsChanged(cb)` in place of `getCapabilities()` and `onCapabilitiesChanged(cb)`. `NativeInputProvider` derives every capability as `IWSDKInputProvider.refreshCapabilities` does: `rays`, `pokes` and pose-only grabs from immersion (a controller pokes with its ray origin, so `pokes` no longer waits for hand tracking), `handJoints` and `pinch` from the hand-tracking fact or a tracked hand, `buttonsAxes` from a controller source, `haptics` from a source with an actuator on a host that can pulse, `gaze` and `headPose` from a head pose, and `presence` from `applyPresence`. It re-derives and fires `onCapabilitiesChanged` on every facts or source change; before this a native host hard-coded them and the event never fired.
45
+ - `setPresenceVisible` and `setPresenceModality` are no longer host members. The provider implements them, decides per side what to show as `IWSDKInputProvider.applyPresence` does (`"auto"` shows hands while hand joints are live), and calls the host's new `applyPresence(side, { hand, controller })` with the result, only when a side changed.
46
+ - `beginHold(targetId)` and `endHold(targetId, release)` are required members of the `interactions` slice, and `NativeTransformPort` throws at construction without them. A pose-only grab calls both, and a host without them silently dropped every release velocity. A target with no physics body rests where released, as on IWSDK.
47
+ - The `interactions` slice gains `setTargetRadius(targetId, radius)`. `NativeInteractions.register(descriptor, { targetRadius })` calls it with the given radius or 0.1 m, the radius IWSDK gives a bare target, so a target is never excluded from hit testing for want of one.
48
+ - `@realitycollective/native-interactions` - `NativeInputProvider` samples no sources while the session lacks focus, as IWSDK's provider samples none unless its visibility state is `Visible`; clamps a pulse's intensity to 0..1, as IWSDK does; takes `nativeGrab` as IWSDK's provider does; and has a `dispose()`, which `NativeInteractions.dispose()` calls.
20
49
  - `@realitycollective/webxr-interactions` - `TransformPort.getWorldPose()` is the LIVE world pose on every platform, and the new required `getRestWorldPose()` returns the rest pose captured at registration, in world space. The core only said "current world pose", and the platforms disagreed: the three.js, IWSDK and XR Blocks ports returned the rest pose, while the Babylon.js port returned the live one. The same behaviour therefore acted differently by platform. The hinge, slide and dial behaviours measure the hand against the rest pose, so they now call `getRestWorldPose()`. Grab and toss scoring keep `getWorldPose()` and now see where the object really is. `ports.ts` also states tuple ownership for `TransformPort` and `HitTester`: every returned tuple is fresh and owned by the caller, and a tuple passed in is read during the call and not kept. Every platform already met the ownership rule; the suites now hold them to it. The native `interactions` slice gains `getRestWorldPose(targetId)`, which the native app must implement. This adds a required member to `TransformPort`, so a port written outside this repository must implement it.
21
50
  - `@realitycollective/xrblocks-interactions` - the structural slices `XBVec3Like`, `XBQuatLike`, `XBRayLike` and `XBControllerLike` are exported, under the same `XB` prefix as `XBRaySourceLike`, `XBDirectTouchLike` and `XBFrameLike` whose fields they type. They were module-private, so a consumer building a fake frame for a test had nothing to name, and TypeDoc reported each as referenced but undocumented.
22
51
 
package/README.md CHANGED
@@ -12,8 +12,8 @@ It re-exports everything from the core, so this is the only interaction package
12
12
 
13
13
  | Layer | Detail |
14
14
  | --- | --- |
15
- | **Input** | `__rcHost.input` - the same members as `InputProvider`: capabilities, source sampling, optional head pose, hints, haptics and presence |
16
- | **Hit-testing** | `__rcHost.interactions.hitRay` / `hitProximity` - the native app owns the scene and physics, so targeting is entirely its answer |
15
+ | **Input** | `__rcHost.input` - session facts (`getFacts`, `onFactsChanged`), sources (`sample`, `onSourcesChanged`), and optional head pose, hints, haptics and presence drawing (`applyPresence`). The provider derives the capabilities and decides presence itself, as the IWSDK provider does |
16
+ | **Hit-testing** | `__rcHost.interactions.hitRay` / `hitProximity` with IWSDK's semantics: the ray parameter to the closest point, and the distance to a target's SURFACE, clamped at zero. `setTargetRadius` tells the host each target's radius (0.1 m unless given) |
17
17
  | **Movement** | `__rcHost.interactions`, keyed by the target id you chose when you registered the object with the native scene |
18
18
  | **No engine dependency** | Assets and rendering stay in the native app; only numbers, strings, booleans and tuples cross the boundary |
19
19
 
@@ -49,11 +49,23 @@ A missing slice - neither passed in nor found on `globalThis.__rcHost` - throws
49
49
  ## Things to know
50
50
 
51
51
  - **Copies, not references.** Every snapshot `sample()` returns, and every tuple inside it, is copied before it leaves `NativeInputProvider`, so a host that reuses its own sample buffers cannot change a snapshot your app is still holding. The same applies to hit results and to poses read through `NativeTransformPort`.
52
- - **Optional members are honest.** `getHeadPose`, `sampleHints`, `pulse`, `setPresenceVisible` and `setPresenceModality` on `NativeInputProvider`, and `setWorldPose`/`setEffect`/`beginHold`/`endHold` on `NativeTransformPort`, are only ever present when the host slice itself carries the matching member - never a method that silently no-ops.
53
- - **Held pose.** `beginHold(targetId)`/`endHold(targetId, release)` suspend and resume physics for one target, the same rule `TransformPort.beginHold`/`endHold` document in `@realitycollective/webxr-interactions`: while held, the object follows `setWorldPose` writes exactly and gravity/collisions stop moving it; on release, physics resumes with `release`'s velocities so a throw carries through; a `setWorldPose` while NOT held teleports and clears velocity. The core's own `poseOnly` grab calls these for you when your `interactions` slice carries them - add them to your host only when it can drive its own physics this way, and leave them off when it cannot, the same as any other optional member. **A native app that fulfils grabs itself**, through its own engine rather than this package's `poseOnly` grab, is responsible for showing the same three behaviours (held / released / reset) on its own: `beginHold`/`endHold` are never called for a grab your engine already owns.
52
+ - **A host is handed results, not rules.** The host reports facts (`immersive`, `focused`, `handTracking`) and sources; `NativeInputProvider` derives every capability from them exactly as `IWSDKInputProvider.refreshCapabilities` does, re-derives on every facts or source change, and fires `onCapabilitiesChanged`. Presence is decided here too: the requested visibility per side and the modality, with `"auto"` showing hands while hand joints are live and controllers otherwise, handed to the host as `applyPresence(side, { hand, controller })`. Presence hides the MODELS only; the host never draws a hand ray and always draws a cursor disc at a ray's hit. No sources are sampled while the session lacks focus, and a pulse's intensity is clamped to 0..1, as on IWSDK.
53
+ - **Optional members are honest.** `getHeadPose`, `sampleHints`, `pulse`, `setPresenceVisible` and `setPresenceModality` on `NativeInputProvider`, and `setWorldPose`/`setEffect` on `NativeTransformPort`, are only ever present when the host slice itself carries the matching member - never a method that silently no-ops.
54
+ - **Held pose is required.** `beginHold(targetId)`/`endHold(targetId, release)` are required members of the `interactions` slice, and `NativeTransformPort` throws at construction without them. A pose-only grab calls both on every grab and release; a host that lacked them used to drop every release velocity silently. While held, the object follows `setWorldPose` writes exactly; on release, a target with a physics body resumes with `release`'s velocities so a throw carries through, and a target with no body rests where it was released, as on IWSDK. A `setWorldPose` while NOT held teleports and clears velocity. A native app that fulfils grabs itself (`nativeGrab: true`) implements both as no-ops and shows the same three behaviours (held, released, reset) through its own engine.
55
+ - **Haptics are routed by the app, as on IWSDK.** Press and grab feedback reach `pulse` when the app routes them, `routeHapticsToProvider((listener) => interactions.runtime.onFeedback(listener), interactions.provider)`, exactly as a web client does with `registerInteractions`. Neither setup routes them by itself.
54
56
  - **One port per interactable.** `TransformPort` is per object; the native host is one object serving every registered interactable, so `NativeTransformPort` binds one `targetId` onto it, the same idea as an engine adapter's port binding to one scene node.
55
57
  - **`NativeHit.targetId`** is renamed to the core's `interactableId` on the way through `NativeHitTester` - the native host names the thing it hit, the core names the thing it manages.
56
58
 
59
+ ## Proving a host: the conformance kit
60
+
61
+ `nativeInteractionsHostConformanceCases()` returns the host cases, as runner-free data named `interactions/<row>` and `input/<row>`. A native app runs them on its device, inside a live focused session, against its real slices and the test readbacks of `NativeInteractionsTestHost` (`placeTarget`, `clearTargets`, `presenceShown`, `lastRelease`, `cursors`). They include the core's whole `hitTesterContractCases()` run against the host itself, so a host that measures proximity to a target's centre fails on the device, not in the field.
62
+
63
+ ```ts
64
+ for (const hostCase of nativeInteractionsHostConformanceCases()) {
65
+ await hostCase.run({ input: __rcHost.input, interactions: __rcHost.interactions, testHost: __rcShell.testHost });
66
+ }
67
+ ```
68
+
57
69
  ## Peer dependency
58
70
 
59
71
  None. No engine object crosses the boundary in either direction.
@@ -0,0 +1,16 @@
1
+ import type { NativeInputHost, NativeInteractionHost, NativeInteractionsTestHost, NativePhysicsHost } from "./native-types.js";
2
+ /** The real slices under test, and their readbacks. */
3
+ export interface NativeInteractionsHostConformanceSetup {
4
+ input: NativeInputHost;
5
+ interactions: NativeInteractionHost;
6
+ testHost: NativeInteractionsTestHost;
7
+ /** The `physics` slice. A host that installs none fails the physics cases. */
8
+ physics?: NativePhysicsHost;
9
+ }
10
+ /** One check a native host must pass. `name` is `interactions/<row>`, `input/<row>` or `physics/<row>`. */
11
+ export interface NativeInteractionsHostConformanceCase {
12
+ name: string;
13
+ run(setup: NativeInteractionsHostConformanceSetup): Promise<void>;
14
+ }
15
+ /** The Interactions and Input host conformance cases. See the file comment. */
16
+ export declare function nativeInteractionsHostConformanceCases(): NativeInteractionsHostConformanceCase[];
@@ -0,0 +1,293 @@
1
+ /**
2
+ * The Interactions host conformance kit: host cases (the third kind in the
3
+ * Masters' "Validation" section), shipped as data so a native app runs them
4
+ * against its REAL `input` and `interactions` slices on the device.
5
+ *
6
+ * The contract cases a native package ran before this checked shapes against
7
+ * fakes, and passed while the real host measured proximity to a target's
8
+ * centre, which removed every near interaction on the headset. These run the
9
+ * same checks against the host itself, through the test readbacks of
10
+ * `NativeInteractionsTestHost`: the core's whole `hitTesterContractCases()`
11
+ * (surface distance included) over targets the host places, the default
12
+ * target radius, the release velocity reaching `endHold`, and what the host
13
+ * draws for presence. Run them inside a live, focused session.
14
+ *
15
+ * Runner-free, like the core suites: a case resolves on success and rejects
16
+ * with a plain `Error` naming its row otherwise.
17
+ */
18
+ import { hitTesterContractCases, nearPointerContractCases, physicsFacilityContractCases, } from "@realitycollective/webxr-interactions";
19
+ import { NativeHitTester } from "./hit-tester.js";
20
+ import { NativeInteractions } from "./host.js";
21
+ import { NativePhysicsFacility } from "./physics-facility.js";
22
+ import { NativeInputProvider } from "./provider.js";
23
+ import { NativeTransformPort } from "./transform-port.js";
24
+ function fail(name, message) {
25
+ throw new Error(`[${name}] ${message}`);
26
+ }
27
+ function hostCase(name, run) {
28
+ return { name, run: async (setup) => run(setup, name) };
29
+ }
30
+ function exactlyOneFamily(shown) {
31
+ return shown !== undefined && shown.hand !== shown.controller;
32
+ }
33
+ /** The Interactions and Input host conformance cases. See the file comment. */
34
+ export function nativeInteractionsHostConformanceCases() {
35
+ const hitCases = hitTesterContractCases().map((contractCase) => hostCase(`interactions/${contractCase.name}`, ({ interactions, testHost }, name) => {
36
+ testHost.clearTargets();
37
+ try {
38
+ contractCase.run({
39
+ hitTester: new NativeHitTester({ interactions }),
40
+ driver: { place: (id, position, radius) => testHost.placeTarget(id, position, radius) },
41
+ });
42
+ }
43
+ catch (error) {
44
+ fail(name, error.message);
45
+ }
46
+ finally {
47
+ testHost.clearTargets();
48
+ }
49
+ }));
50
+ // The near-pointer rule over the host's real queries: touch press, grip
51
+ // grab, pointer priority and what the ray and cursor should show.
52
+ const nearCases = nearPointerContractCases().map((contractCase) => hostCase(`interactions/${contractCase.name}`, ({ interactions, testHost }, name) => {
53
+ testHost.clearTargets();
54
+ try {
55
+ contractCase.run({
56
+ hitTester: new NativeHitTester({ interactions }),
57
+ driver: { place: (id, position, radius) => testHost.placeTarget(id, position, radius) },
58
+ });
59
+ }
60
+ catch (error) {
61
+ fail(name, error.message);
62
+ }
63
+ finally {
64
+ testHost.clearTargets();
65
+ }
66
+ }));
67
+ // The platform's physics behind the core contract: the whole shared suite
68
+ // over the host's engine, on the device.
69
+ const physicsCases = physicsFacilityContractCases().map((contractCase) => hostCase(`physics/${contractCase.name}`, ({ physics }, name) => {
70
+ if (!physics)
71
+ fail(name, "the host installs no physics slice; every native platform names a default engine (Jolt on Quest and Android, RealityKit on visionOS)");
72
+ const facility = new NativePhysicsFacility({ physics });
73
+ try {
74
+ contractCase.run({ facility });
75
+ }
76
+ catch (error) {
77
+ fail(name, error.message);
78
+ }
79
+ finally {
80
+ facility.dispose();
81
+ }
82
+ }));
83
+ return [
84
+ ...hitCases,
85
+ ...nearCases,
86
+ ...physicsCases,
87
+ hostCase("physics/a registered target with a body is held and released through the physics slice", ({ input, interactions, physics, testHost }, name) => {
88
+ if (!physics)
89
+ fail(name, "the host installs no physics slice");
90
+ testHost.clearTargets();
91
+ const setup = new NativeInteractions({ input, interactions, physics });
92
+ try {
93
+ testHost.placeTarget("rc-kit-body", [0, 1, -1], 0.1);
94
+ const port = setup.register({ id: "rc-kit-body", behaviours: [{ kind: "grab" }] }, { shape: { kind: "sphere", dimensions: [0.1, 0, 0] } });
95
+ if (!physics.hasBody("rc-kit-body"))
96
+ fail(name, "register with a shape must add a body to the physics slice");
97
+ port.beginHold();
98
+ if (!physics.isSuspended("rc-kit-body"))
99
+ fail(name, "beginHold on a target with a body must suspend it in the physics slice");
100
+ port.endHold({ linearVelocity: [1, 0, 0], angularVelocity: [0, 0, 0] });
101
+ if (physics.isSuspended("rc-kit-body"))
102
+ fail(name, "endHold must resume the body");
103
+ const velocity = physics.getVelocity("rc-kit-body").linear;
104
+ if (Math.abs(velocity[0] - 1) > 0.01)
105
+ fail(name, `endHold must hand the body the release velocity, it has ${JSON.stringify(velocity)}`);
106
+ setup.unregister("rc-kit-body");
107
+ if (physics.hasBody("rc-kit-body"))
108
+ fail(name, "unregister must remove the body the binding added");
109
+ }
110
+ finally {
111
+ setup.dispose();
112
+ testHost.clearTargets();
113
+ }
114
+ }),
115
+ hostCase("input/the ray and cursor are drawn exactly as told", ({ input, testHost }, name) => {
116
+ // The binding decides the ray and cursor per source (the near-pointer
117
+ // rule) and hands the host the result; a host that draws its own ray
118
+ // or a cursor at every ray hit fails here, as the Quest host did when
119
+ // it kept the cursor on a touched object.
120
+ if (typeof input.applyPointerVisuals !== "function") {
121
+ fail(name, "the host has no applyPointerVisuals, so it cannot hide the ray while a hand touches something");
122
+ }
123
+ if (typeof testHost.pointerVisuals !== "function") {
124
+ fail(name, "the test host has no pointerVisuals readback");
125
+ }
126
+ const touched = { sourceId: "rc-kit-source", activePointer: "touch", ray: false, cursor: true, cursorPoint: [0, 1, -0.9] };
127
+ input.applyPointerVisuals("rc-kit-source", { ...touched });
128
+ const drawn = testHost.pointerVisuals("rc-kit-source");
129
+ if (!drawn || drawn.ray || !drawn.cursor || JSON.stringify(drawn.cursorPoint) !== JSON.stringify(touched.cursorPoint)) {
130
+ fail(name, `told ${JSON.stringify(touched)}, the host draws ${JSON.stringify(drawn)}`);
131
+ }
132
+ if (!testHost.cursors().some((point) => JSON.stringify(point) === JSON.stringify(touched.cursorPoint))) {
133
+ fail(name, "the host draws no cursor disc at the point it was told");
134
+ }
135
+ const idle = { sourceId: "rc-kit-source", activePointer: null, ray: true, cursor: false, cursorPoint: null };
136
+ input.applyPointerVisuals("rc-kit-source", { ...idle });
137
+ const after = testHost.pointerVisuals("rc-kit-source");
138
+ if (!after || !after.ray || after.cursor) {
139
+ fail(name, `told ${JSON.stringify(idle)}, the host draws ${JSON.stringify(after)}`);
140
+ }
141
+ if (testHost.cursors().some((point) => JSON.stringify(point) === JSON.stringify(touched.cursorPoint))) {
142
+ fail(name, "the host still draws the cursor disc after being told to stop");
143
+ }
144
+ }),
145
+ hostCase("interactions/a registered target with no radius is a 10 cm sphere", ({ input, interactions, testHost }, name) => {
146
+ testHost.clearTargets();
147
+ const setup = new NativeInteractions({ input, interactions });
148
+ try {
149
+ // Placed small, then registered with no radius: the registration
150
+ // must make it a 0.1 m sphere, so a point 9 cm from its centre is
151
+ // inside it.
152
+ testHost.placeTarget("rc-kit-bare", [0, 1, -1], 0.02);
153
+ setup.register({ id: "rc-kit-bare", behaviours: [] });
154
+ const hit = interactions.hitProximity([0.09, 1, -1], 0.001);
155
+ if (!hit || hit.targetId !== "rc-kit-bare") {
156
+ fail(name, "a point 9 cm from a bare target's centre did not reach it; the host is not using the 0.1 m radius");
157
+ }
158
+ }
159
+ finally {
160
+ setup.dispose();
161
+ testHost.clearTargets();
162
+ }
163
+ }),
164
+ hostCase("interactions/endHold hands the host the release velocity", ({ interactions, testHost }, name) => {
165
+ testHost.clearTargets();
166
+ try {
167
+ testHost.placeTarget("rc-kit-throw", [0, 1, -1], 0.1);
168
+ const port = new NativeTransformPort("rc-kit-throw", { interactions });
169
+ const release = { linearVelocity: [1, 2, 3], angularVelocity: [0, 0.5, 0] };
170
+ port.beginHold();
171
+ port.endHold(release);
172
+ const received = testHost.lastRelease("rc-kit-throw");
173
+ if (JSON.stringify(received) !== JSON.stringify(release)) {
174
+ fail(name, `the host received ${JSON.stringify(received)}, expected ${JSON.stringify(release)}`);
175
+ }
176
+ }
177
+ finally {
178
+ testHost.clearTargets();
179
+ }
180
+ }),
181
+ hostCase("input/capabilities in a live session: rays, pokes and pose-only grabs", ({ input }, name) => {
182
+ const provider = new NativeInputProvider({ input });
183
+ try {
184
+ const caps = provider.getCapabilities();
185
+ // Pose-only grabs follow from the same fact, so rays and pokes carry it.
186
+ if (!caps.rays || !caps.pokes || caps.grabs !== "poseOnly") {
187
+ fail(name, `a live session must report rays, pokes and pose-only grabs, got ${JSON.stringify(caps)}; run the kit inside a live session`);
188
+ }
189
+ }
190
+ finally {
191
+ provider.dispose();
192
+ }
193
+ }),
194
+ hostCase("input/presence hides the models only, per side", ({ input, testHost }, name) => {
195
+ const provider = new NativeInputProvider({ input });
196
+ try {
197
+ if (!provider.getCapabilities().presence || !provider.setPresenceVisible) {
198
+ fail(name, "the host has no applyPresence, so presence cannot be shown or hidden");
199
+ }
200
+ provider.setPresenceVisible("left", false);
201
+ const left = testHost.presenceShown("left");
202
+ if (!left || left.hand || left.controller)
203
+ fail(name, `a hidden left side still draws ${JSON.stringify(left)}`);
204
+ if (!exactlyOneFamily(testHost.presenceShown("right"))) {
205
+ fail(name, `the right side must still draw exactly one family, drew ${JSON.stringify(testHost.presenceShown("right"))}`);
206
+ }
207
+ }
208
+ finally {
209
+ provider.setPresenceVisible?.("all", true);
210
+ provider.dispose();
211
+ }
212
+ }),
213
+ hostCase('input/"auto" shows the family the live session uses', ({ input, testHost }, name) => {
214
+ const provider = new NativeInputProvider({ input });
215
+ try {
216
+ provider.setPresenceModality?.("auto");
217
+ const handJoints = provider.getCapabilities().handJoints;
218
+ for (const side of ["left", "right"]) {
219
+ const shown = testHost.presenceShown(side);
220
+ if (!shown || shown.hand !== handJoints || shown.controller !== !handJoints) {
221
+ fail(name, `${side} draws ${JSON.stringify(shown)} with hand joints ${handJoints ? "live" : "off"}`);
222
+ }
223
+ }
224
+ }
225
+ finally {
226
+ provider.dispose();
227
+ }
228
+ }),
229
+ hostCase("input/eye gaze: a host that reports eye tracking poses the gaze, and the binding takes far targeting", ({ input }, name) => {
230
+ // Runs when the host reports eye tracking; a host without it (visionOS,
231
+ // a Quest without eye tracking) passes without running. With it, the
232
+ // host must hand the binding a valid pose in a live, focused session,
233
+ // and the binding then samples one gaze snapshot with a ray. That the
234
+ // hand and controller far rays drop is the shared contract case.
235
+ if (!input.getFacts().eyeTracking)
236
+ return;
237
+ if (typeof input.getEyeGazePose !== "function") {
238
+ fail(name, "the host reports eyeTracking but has no getEyeGazePose(); the binding cannot use a fact it cannot pose");
239
+ }
240
+ const provider = new NativeInputProvider({ input });
241
+ try {
242
+ if (!provider.getCapabilities().eyeGaze) {
243
+ fail(name, "the host reports eyeTracking in a live session, so capabilities.eyeGaze must be true; is the session focused?");
244
+ }
245
+ const pose = input.getEyeGazePose();
246
+ if (!pose || [...pose.position, ...pose.quaternion].some((n) => !Number.isFinite(n))) {
247
+ fail(name, `getEyeGazePose() returned ${JSON.stringify(pose)}; run the kit while the user's eyes are tracked`);
248
+ }
249
+ const gaze = provider.sample().find((source) => source.kind === "gaze");
250
+ if (!gaze?.ray)
251
+ fail(name, "with a valid gaze pose the binding must sample one gaze snapshot with a ray");
252
+ }
253
+ finally {
254
+ provider.dispose();
255
+ }
256
+ }),
257
+ hostCase("input/eye gaze: a cone query never answers with a hidden target", ({ interactions, testHost }, name) => {
258
+ if (!interactions.hitCone)
259
+ return;
260
+ testHost.clearTargets();
261
+ try {
262
+ testHost.placeTarget("rc-kit-cone", [0.2, 1, -2], 0.1);
263
+ const ray = { origin: [0, 1, 0], direction: [0, 0, -1] };
264
+ const shown = interactions.hitCone(ray, (5 * Math.PI) / 180, 30);
265
+ if (!shown || shown.targetId !== "rc-kit-cone") {
266
+ fail(name, "a target 0.2 m beside a ray 2 m out, inside a 5 degree cone, was not found");
267
+ }
268
+ testHost.setTargetVisible?.("rc-kit-cone", false);
269
+ if (testHost.setTargetVisible && interactions.hitCone(ray, (5 * Math.PI) / 180, 30) !== null) {
270
+ fail(name, "the cone query answered with a hidden target");
271
+ }
272
+ }
273
+ finally {
274
+ testHost.clearTargets();
275
+ }
276
+ }),
277
+ hostCase("input/presence never hides the cursors", ({ input, testHost }, name) => {
278
+ const provider = new NativeInputProvider({ input });
279
+ try {
280
+ const before = testHost.cursors().length;
281
+ provider.setPresenceVisible?.("all", false);
282
+ const after = testHost.cursors().length;
283
+ if (after !== before)
284
+ fail(name, `hiding presence changed the cursors drawn from ${before} to ${after}`);
285
+ }
286
+ finally {
287
+ provider.setPresenceVisible?.("all", true);
288
+ provider.dispose();
289
+ }
290
+ }),
291
+ ];
292
+ }
293
+ //# sourceMappingURL=conformance.js.map
@@ -0,0 +1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gBAAgB,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;gBAClD,IAAI,QAAQ,CAAC,gBAAgB,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC7F,IAAI,CAAC,IAAI,EAAE,8CAA8C,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;oBAAS,CAAC;gBACT,QAAQ,CAAC,YAAY,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC,CAAC;QACF,QAAQ,CAAC,wCAAwC,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE;YAC/E,MAAM,QAAQ,GAAG,IAAI,mBAAmB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YACpD,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;gBACzC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;gBACxC,IAAI,KAAK,KAAK,MAAM;oBAAE,IAAI,CAAC,IAAI,EAAE,kDAAkD,MAAM,OAAO,KAAK,EAAE,CAAC,CAAC;YAC3G,CAAC;oBAAS,CAAC;gBACT,QAAQ,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAC3C,QAAQ,CAAC,OAAO,EAAE,CAAC;YACrB,CAAC;QACH,CAAC,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The Interactions host conformance kit: host cases (the third kind in the\n * Masters' \"Validation\" section), shipped as data so a native app runs them\n * against its REAL `input` and `interactions` slices on the device.\n *\n * The contract cases a native package ran before this checked shapes against\n * fakes, and passed while the real host measured proximity to a target's\n * centre, which removed every near interaction on the headset. These run the\n * same checks against the host itself, through the test readbacks of\n * `NativeInteractionsTestHost`: the core's whole `hitTesterContractCases()`\n * (surface distance included) over targets the host places, the default\n * target radius, the release velocity reaching `endHold`, and what the host\n * draws for presence. Run them inside a live, focused session.\n *\n * Runner-free, like the core suites: a case resolves on success and rejects\n * with a plain `Error` naming its row otherwise.\n */\nimport {\n hitTesterContractCases,\n nearPointerContractCases,\n physicsFacilityContractCases,\n type HoldRelease,\n type PointerVisuals,\n} from \"@realitycollective/webxr-interactions\";\nimport { NativeHitTester } from \"./hit-tester.js\";\nimport { NativeInteractions } from \"./host.js\";\nimport { NativePhysicsFacility } from \"./physics-facility.js\";\nimport { NativeInputProvider } from \"./provider.js\";\nimport { NativeTransformPort } from \"./transform-port.js\";\nimport type { Vec3Tuple } from \"@realitycollective/webxr-input\";\nimport type {\n NativeInputHost,\n NativeInteractionHost,\n NativeInteractionsTestHost,\n NativePhysicsHost,\n NativePresenceShown,\n} from \"./native-types.js\";\n\n/** The real slices under test, and their readbacks. */\nexport interface NativeInteractionsHostConformanceSetup {\n input: NativeInputHost;\n interactions: NativeInteractionHost;\n testHost: NativeInteractionsTestHost;\n /** The `physics` slice. A host that installs none fails the physics cases. */\n physics?: NativePhysicsHost;\n}\n\n/** One check a native host must pass. `name` is `interactions/<row>`, `input/<row>` or `physics/<row>`. */\nexport interface NativeInteractionsHostConformanceCase {\n name: string;\n run(setup: NativeInteractionsHostConformanceSetup): Promise<void>;\n}\n\nfunction fail(name: string, message: string): never {\n throw new Error(`[${name}] ${message}`);\n}\n\nfunction hostCase(\n name: string,\n run: (setup: NativeInteractionsHostConformanceSetup, name: string) => void | Promise<void>,\n): NativeInteractionsHostConformanceCase {\n return { name, run: async (setup) => run(setup, name) };\n}\n\nfunction exactlyOneFamily(shown: NativePresenceShown | undefined): boolean {\n return shown !== undefined && shown.hand !== shown.controller;\n}\n\n/** The Interactions and Input host conformance cases. See the file comment. */\nexport function nativeInteractionsHostConformanceCases(): NativeInteractionsHostConformanceCase[] {\n const hitCases = hitTesterContractCases().map((contractCase) =>\n hostCase(`interactions/${contractCase.name}`, ({ interactions, testHost }, name) => {\n testHost.clearTargets();\n try {\n contractCase.run({\n hitTester: new NativeHitTester({ interactions }),\n driver: { place: (id, position, radius) => testHost.placeTarget(id, position, radius) },\n });\n } catch (error) {\n fail(name, (error as Error).message);\n } finally {\n testHost.clearTargets();\n }\n }),\n );\n\n // The near-pointer rule over the host's real queries: touch press, grip\n // grab, pointer priority and what the ray and cursor should show.\n const nearCases = nearPointerContractCases().map((contractCase) =>\n hostCase(`interactions/${contractCase.name}`, ({ interactions, testHost }, name) => {\n testHost.clearTargets();\n try {\n contractCase.run({\n hitTester: new NativeHitTester({ interactions }),\n driver: { place: (id, position, radius) => testHost.placeTarget(id, position, radius) },\n });\n } catch (error) {\n fail(name, (error as Error).message);\n } finally {\n testHost.clearTargets();\n }\n }),\n );\n\n // The platform's physics behind the core contract: the whole shared suite\n // over the host's engine, on the device.\n const physicsCases = physicsFacilityContractCases().map((contractCase) =>\n hostCase(`physics/${contractCase.name}`, ({ physics }, name) => {\n if (!physics) fail(name, \"the host installs no physics slice; every native platform names a default engine (Jolt on Quest and Android, RealityKit on visionOS)\");\n const facility = new NativePhysicsFacility({ physics });\n try {\n contractCase.run({ facility });\n } catch (error) {\n fail(name, (error as Error).message);\n } finally {\n facility.dispose();\n }\n }),\n );\n\n return [\n ...hitCases,\n ...nearCases,\n ...physicsCases,\n hostCase(\"physics/a registered target with a body is held and released through the physics slice\", ({ input, interactions, physics, testHost }, name) => {\n if (!physics) fail(name, \"the host installs no physics slice\");\n testHost.clearTargets();\n const setup = new NativeInteractions({ input, interactions, physics });\n try {\n testHost.placeTarget(\"rc-kit-body\", [0, 1, -1], 0.1);\n const port = setup.register({ id: \"rc-kit-body\", behaviours: [{ kind: \"grab\" }] }, { shape: { kind: \"sphere\", dimensions: [0.1, 0, 0] } });\n if (!physics.hasBody(\"rc-kit-body\")) fail(name, \"register with a shape must add a body to the physics slice\");\n port.beginHold();\n if (!physics.isSuspended(\"rc-kit-body\")) fail(name, \"beginHold on a target with a body must suspend it in the physics slice\");\n port.endHold({ linearVelocity: [1, 0, 0], angularVelocity: [0, 0, 0] });\n if (physics.isSuspended(\"rc-kit-body\")) fail(name, \"endHold must resume the body\");\n const velocity = physics.getVelocity(\"rc-kit-body\").linear;\n if (Math.abs(velocity[0] - 1) > 0.01) fail(name, `endHold must hand the body the release velocity, it has ${JSON.stringify(velocity)}`);\n setup.unregister(\"rc-kit-body\");\n if (physics.hasBody(\"rc-kit-body\")) fail(name, \"unregister must remove the body the binding added\");\n } finally {\n setup.dispose();\n testHost.clearTargets();\n }\n }),\n hostCase(\"input/the ray and cursor are drawn exactly as told\", ({ input, testHost }, name) => {\n // The binding decides the ray and cursor per source (the near-pointer\n // rule) and hands the host the result; a host that draws its own ray\n // or a cursor at every ray hit fails here, as the Quest host did when\n // it kept the cursor on a touched object.\n if (typeof input.applyPointerVisuals !== \"function\") {\n fail(name, \"the host has no applyPointerVisuals, so it cannot hide the ray while a hand touches something\");\n }\n if (typeof testHost.pointerVisuals !== \"function\") {\n fail(name, \"the test host has no pointerVisuals readback\");\n }\n const touched: PointerVisuals = { sourceId: \"rc-kit-source\", activePointer: \"touch\", ray: false, cursor: true, cursorPoint: [0, 1, -0.9] };\n input.applyPointerVisuals(\"rc-kit-source\", { ...touched });\n const drawn = testHost.pointerVisuals(\"rc-kit-source\");\n if (!drawn || drawn.ray || !drawn.cursor || JSON.stringify(drawn.cursorPoint) !== JSON.stringify(touched.cursorPoint)) {\n fail(name, `told ${JSON.stringify(touched)}, the host draws ${JSON.stringify(drawn)}`);\n }\n if (!testHost.cursors().some((point) => JSON.stringify(point) === JSON.stringify(touched.cursorPoint))) {\n fail(name, \"the host draws no cursor disc at the point it was told\");\n }\n const idle: PointerVisuals = { sourceId: \"rc-kit-source\", activePointer: null, ray: true, cursor: false, cursorPoint: null };\n input.applyPointerVisuals(\"rc-kit-source\", { ...idle });\n const after = testHost.pointerVisuals(\"rc-kit-source\");\n if (!after || !after.ray || after.cursor) {\n fail(name, `told ${JSON.stringify(idle)}, the host draws ${JSON.stringify(after)}`);\n }\n if (testHost.cursors().some((point) => JSON.stringify(point) === JSON.stringify(touched.cursorPoint))) {\n fail(name, \"the host still draws the cursor disc after being told to stop\");\n }\n }),\n hostCase(\"interactions/a registered target with no radius is a 10 cm sphere\", ({ input, interactions, testHost }, name) => {\n testHost.clearTargets();\n const setup = new NativeInteractions({ input, interactions });\n try {\n // Placed small, then registered with no radius: the registration\n // must make it a 0.1 m sphere, so a point 9 cm from its centre is\n // inside it.\n testHost.placeTarget(\"rc-kit-bare\", [0, 1, -1], 0.02);\n setup.register({ id: \"rc-kit-bare\", behaviours: [] });\n const hit = interactions.hitProximity([0.09, 1, -1], 0.001);\n if (!hit || hit.targetId !== \"rc-kit-bare\") {\n fail(name, \"a point 9 cm from a bare target's centre did not reach it; the host is not using the 0.1 m radius\");\n }\n } finally {\n setup.dispose();\n testHost.clearTargets();\n }\n }),\n hostCase(\"interactions/endHold hands the host the release velocity\", ({ interactions, testHost }, name) => {\n testHost.clearTargets();\n try {\n testHost.placeTarget(\"rc-kit-throw\", [0, 1, -1], 0.1);\n const port = new NativeTransformPort(\"rc-kit-throw\", { interactions });\n const release: HoldRelease = { linearVelocity: [1, 2, 3], angularVelocity: [0, 0.5, 0] };\n port.beginHold();\n port.endHold(release);\n const received = testHost.lastRelease(\"rc-kit-throw\");\n if (JSON.stringify(received) !== JSON.stringify(release)) {\n fail(name, `the host received ${JSON.stringify(received)}, expected ${JSON.stringify(release)}`);\n }\n } finally {\n testHost.clearTargets();\n }\n }),\n hostCase(\"input/capabilities in a live session: rays, pokes and pose-only grabs\", ({ input }, name) => {\n const provider = new NativeInputProvider({ input });\n try {\n const caps = provider.getCapabilities();\n // Pose-only grabs follow from the same fact, so rays and pokes carry it.\n if (!caps.rays || !caps.pokes || caps.grabs !== \"poseOnly\") {\n fail(name, `a live session must report rays, pokes and pose-only grabs, got ${JSON.stringify(caps)}; run the kit inside a live session`);\n }\n } finally {\n provider.dispose();\n }\n }),\n hostCase(\"input/presence hides the models only, per side\", ({ input, testHost }, name) => {\n const provider = new NativeInputProvider({ input });\n try {\n if (!provider.getCapabilities().presence || !provider.setPresenceVisible) {\n fail(name, \"the host has no applyPresence, so presence cannot be shown or hidden\");\n }\n provider.setPresenceVisible(\"left\", false);\n const left = testHost.presenceShown(\"left\");\n if (!left || left.hand || left.controller) fail(name, `a hidden left side still draws ${JSON.stringify(left)}`);\n if (!exactlyOneFamily(testHost.presenceShown(\"right\"))) {\n fail(name, `the right side must still draw exactly one family, drew ${JSON.stringify(testHost.presenceShown(\"right\"))}`);\n }\n } finally {\n provider.setPresenceVisible?.(\"all\", true);\n provider.dispose();\n }\n }),\n hostCase('input/\"auto\" shows the family the live session uses', ({ input, testHost }, name) => {\n const provider = new NativeInputProvider({ input });\n try {\n provider.setPresenceModality?.(\"auto\");\n const handJoints = provider.getCapabilities().handJoints;\n for (const side of [\"left\", \"right\"] as const) {\n const shown = testHost.presenceShown(side);\n if (!shown || shown.hand !== handJoints || shown.controller !== !handJoints) {\n fail(name, `${side} draws ${JSON.stringify(shown)} with hand joints ${handJoints ? \"live\" : \"off\"}`);\n }\n }\n } finally {\n provider.dispose();\n }\n }),\n hostCase(\"input/eye gaze: a host that reports eye tracking poses the gaze, and the binding takes far targeting\", ({ input }, name) => {\n // Runs when the host reports eye tracking; a host without it (visionOS,\n // a Quest without eye tracking) passes without running. With it, the\n // host must hand the binding a valid pose in a live, focused session,\n // and the binding then samples one gaze snapshot with a ray. That the\n // hand and controller far rays drop is the shared contract case.\n if (!input.getFacts().eyeTracking) return;\n if (typeof input.getEyeGazePose !== \"function\") {\n fail(name, \"the host reports eyeTracking but has no getEyeGazePose(); the binding cannot use a fact it cannot pose\");\n }\n const provider = new NativeInputProvider({ input });\n try {\n if (!provider.getCapabilities().eyeGaze) {\n fail(name, \"the host reports eyeTracking in a live session, so capabilities.eyeGaze must be true; is the session focused?\");\n }\n const pose = input.getEyeGazePose();\n if (!pose || [...pose.position, ...pose.quaternion].some((n) => !Number.isFinite(n))) {\n fail(name, `getEyeGazePose() returned ${JSON.stringify(pose)}; run the kit while the user's eyes are tracked`);\n }\n const gaze = provider.sample().find((source) => source.kind === \"gaze\");\n if (!gaze?.ray) fail(name, \"with a valid gaze pose the binding must sample one gaze snapshot with a ray\");\n } finally {\n provider.dispose();\n }\n }),\n hostCase(\"input/eye gaze: a cone query never answers with a hidden target\", ({ interactions, testHost }, name) => {\n if (!interactions.hitCone) return;\n testHost.clearTargets();\n try {\n testHost.placeTarget(\"rc-kit-cone\", [0.2, 1, -2], 0.1);\n const ray = { origin: [0, 1, 0] as Vec3Tuple, direction: [0, 0, -1] as Vec3Tuple };\n const shown = interactions.hitCone(ray, (5 * Math.PI) / 180, 30);\n if (!shown || shown.targetId !== \"rc-kit-cone\") {\n fail(name, \"a target 0.2 m beside a ray 2 m out, inside a 5 degree cone, was not found\");\n }\n testHost.setTargetVisible?.(\"rc-kit-cone\", false);\n if (testHost.setTargetVisible && interactions.hitCone(ray, (5 * Math.PI) / 180, 30) !== null) {\n fail(name, \"the cone query answered with a hidden target\");\n }\n } finally {\n testHost.clearTargets();\n }\n }),\n hostCase(\"input/presence never hides the cursors\", ({ input, testHost }, name) => {\n const provider = new NativeInputProvider({ input });\n try {\n const before = testHost.cursors().length;\n provider.setPresenceVisible?.(\"all\", false);\n const after = testHost.cursors().length;\n if (after !== before) fail(name, `hiding presence changed the cursors drawn from ${before} to ${after}`);\n } finally {\n provider.setPresenceVisible?.(\"all\", true);\n provider.dispose();\n }\n }),\n ];\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  /**
2
- * NativeHitTester - resolves the core's ray and proximity queries against
3
- * the native host's `interactions` slice. The native app owns the scene and
4
- * physics, so targeting is entirely the host's answer; this class only
5
- * copies the result across and renames its `targetId` to the core's
6
- * `interactableId`.
2
+ * NativeHitTester - resolves the core's ray, proximity and cone queries
3
+ * against the native host's `interactions` slice. The native app owns the
4
+ * scene and physics, so targeting is entirely the host's answer; this class
5
+ * only copies the result across and renames its `targetId` to the core's
6
+ * `interactableId`. `hitCone` is present only when the host slice carries
7
+ * one, so the runtime falls back to `hitRay` for eye gaze on a host without.
7
8
  */
8
9
  import type { RayTuple, Vec3Tuple } from "@realitycollective/webxr-input";
9
10
  import type { HitTester, InteractableHit } from "@realitycollective/webxr-interactions";
@@ -14,6 +15,7 @@ export interface NativeHitTesterOptions {
14
15
  }
15
16
  export declare class NativeHitTester implements HitTester {
16
17
  private readonly host;
18
+ readonly hitCone?: (ray: RayTuple, halfAngle: number, maxLength: number) => InteractableHit | null;
17
19
  constructor(options?: NativeHitTesterOptions);
18
20
  hitRay(ray: RayTuple): InteractableHit | null;
19
21
  hitProximity(point: Vec3Tuple, radius: number): InteractableHit | null;
@@ -1,8 +1,16 @@
1
1
  import { copyRay, copyVec3, resolveHostSlice, } from "./native-types.js";
2
2
  export class NativeHitTester {
3
3
  host;
4
+ hitCone;
4
5
  constructor(options = {}) {
5
6
  this.host = resolveHostSlice("interactions", options.interactions);
7
+ const host = this.host;
8
+ if (host.hitCone) {
9
+ this.hitCone = (ray, halfAngle, maxLength) => {
10
+ const hit = host.hitCone(copyRay(ray), halfAngle, maxLength);
11
+ return hit ? toInteractableHit(hit) : null;
12
+ };
13
+ }
6
14
  }
7
15
  hitRay(ray) {
8
16
  const hit = this.host.hitRay(copyRay(ray));
@@ -1 +1 @@
1
- {"version":3,"file":"hit-tester.js","sourceRoot":"","sources":["../src/hit-tester.ts"],"names":[],"mappings":"AASA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAO3B,MAAM,OAAO,eAAe;IACT,IAAI,CAAwB;IAE7C,YAAY,UAAkC,EAAE;QAC9C,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,CAAC,GAAa;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;IAED,YAAY,CAAC,KAAgB,EAAE,MAAc;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;QAC5D,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,GAAc;IACvC,OAAO,EAAE,cAAc,EAAE,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["/**\n * NativeHitTester - resolves the core's ray and proximity queries against\n * the native host's `interactions` slice. The native app owns the scene and\n * physics, so targeting is entirely the host's answer; this class only\n * copies the result across and renames its `targetId` to the core's\n * `interactableId`.\n */\nimport type { RayTuple, Vec3Tuple } from \"@realitycollective/webxr-input\";\nimport type { HitTester, InteractableHit } from \"@realitycollective/webxr-interactions\";\nimport {\n copyRay,\n copyVec3,\n resolveHostSlice,\n type NativeHit,\n type NativeInteractionHost,\n} from \"./native-types.js\";\n\nexport interface NativeHitTesterOptions {\n /** The `interactions` slice. Omit to read `globalThis.__rcHost.interactions`. */\n interactions?: NativeInteractionHost;\n}\n\nexport class NativeHitTester implements HitTester {\n private readonly host: NativeInteractionHost;\n\n constructor(options: NativeHitTesterOptions = {}) {\n this.host = resolveHostSlice(\"interactions\", options.interactions);\n }\n\n hitRay(ray: RayTuple): InteractableHit | null {\n const hit = this.host.hitRay(copyRay(ray));\n return hit ? toInteractableHit(hit) : null;\n }\n\n hitProximity(point: Vec3Tuple, radius: number): InteractableHit | null {\n const hit = this.host.hitProximity(copyVec3(point), radius);\n return hit ? toInteractableHit(hit) : null;\n }\n}\n\nfunction toInteractableHit(hit: NativeHit): InteractableHit {\n return { interactableId: hit.targetId, distance: hit.distance, point: copyVec3(hit.point) };\n}\n"]}
1
+ {"version":3,"file":"hit-tester.js","sourceRoot":"","sources":["../src/hit-tester.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAO3B,MAAM,OAAO,eAAe;IACT,IAAI,CAAwB;IACpC,OAAO,CAAmF;IAEnG,YAAY,UAAkC,EAAE;QAC9C,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QACnE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE;gBAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;gBAC9D,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC7C,CAAC,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,CAAC,GAAa;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;IAED,YAAY,CAAC,KAAgB,EAAE,MAAc;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;QAC5D,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,GAAc;IACvC,OAAO,EAAE,cAAc,EAAE,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["/**\n * NativeHitTester - resolves the core's ray, proximity and cone queries\n * against the native host's `interactions` slice. The native app owns the\n * scene and physics, so targeting is entirely the host's answer; this class\n * only copies the result across and renames its `targetId` to the core's\n * `interactableId`. `hitCone` is present only when the host slice carries\n * one, so the runtime falls back to `hitRay` for eye gaze on a host without.\n */\nimport type { RayTuple, Vec3Tuple } from \"@realitycollective/webxr-input\";\nimport type { HitTester, InteractableHit } from \"@realitycollective/webxr-interactions\";\nimport {\n copyRay,\n copyVec3,\n resolveHostSlice,\n type NativeHit,\n type NativeInteractionHost,\n} from \"./native-types.js\";\n\nexport interface NativeHitTesterOptions {\n /** The `interactions` slice. Omit to read `globalThis.__rcHost.interactions`. */\n interactions?: NativeInteractionHost;\n}\n\nexport class NativeHitTester implements HitTester {\n private readonly host: NativeInteractionHost;\n readonly hitCone?: (ray: RayTuple, halfAngle: number, maxLength: number) => InteractableHit | null;\n\n constructor(options: NativeHitTesterOptions = {}) {\n this.host = resolveHostSlice(\"interactions\", options.interactions);\n const host = this.host;\n if (host.hitCone) {\n this.hitCone = (ray, halfAngle, maxLength) => {\n const hit = host.hitCone!(copyRay(ray), halfAngle, maxLength);\n return hit ? toInteractableHit(hit) : null;\n };\n }\n }\n\n hitRay(ray: RayTuple): InteractableHit | null {\n const hit = this.host.hitRay(copyRay(ray));\n return hit ? toInteractableHit(hit) : null;\n }\n\n hitProximity(point: Vec3Tuple, radius: number): InteractableHit | null {\n const hit = this.host.hitProximity(copyVec3(point), radius);\n return hit ? toInteractableHit(hit) : null;\n }\n}\n\nfunction toInteractableHit(hit: NativeHit): InteractableHit {\n return { interactableId: hit.targetId, distance: hit.distance, point: copyVec3(hit.point) };\n}\n"]}