specs-world-query

Implements ray casting against real-world surfaces using the WorldQueryModule in Lens Studio.

16|2|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-world-query-lens-studio-devs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: specs-world-query
Source: https://github.com/lens-studio-devs/ls-extensions/tree/main/plugins/ls-clad/skills/specs-world-query
Command: npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-world-query-lens-studio-devs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Placing AR objects on physical surfaces in Spectacles apps requires depth hit testing, surface normals, and ground classification, which involves verbose session setup and interactor wiring that is easy to get wrong. ## Core Features & Use Cases - Surface Hit Testing: Create and configure HitTestSession instances with filtering options to ray cast against real-world geometry. - Surface Placement: Position and orient SceneObjects on detected surfaces using hit position, normal vectors, and SIK interactor rays, with spawn-on-pinch-release logic. - Semantic Ground Detection: Enable experimental surface classification to distinguish ground surfaces from unknown geometry. - Use Case: Build a Spectacles lens where a user points at a table, sees a preview object aligned to the surface normal, and pinches to spawn a copy at that location. ## Quick Start Ask the agent to write a Lens Studio TypeScript component that places an object on real-world surfaces using the WorldQueryModule and SIK interactor.

Frequently Asked Questions about specs-world-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I place objects on real-world surfaces in Lens Studio?

Create a HitTestSession via WorldQueryModule.createHitTestSessionWithOptions, call start(), then invoke hitTest with ray start and end points. Use the result's position and normal to set the target object's world transform.

How to detect ground surfaces in Spectacles apps?

Enable Experimental APIs in project settings, set options.classification = true on HitTestSessionOptions, and check result.classification for SurfaceClassification.Ground in the hit test callback.

Why does WorldQueryModule hitTest return null?

hitTest returns null when the ray falls outside the camera field of view, since the depth map only covers visible areas. It also returns nothing if session.start() was never called after creating the session.

WorldQueryModule vs DeviceTracking hitTestWorldMesh vs Physics raycast?

WorldQueryModule provides fast lightweight surface placement at roughly 5Hz updates. Use DeviceTracking.hitTestWorldMesh for precise mesh raycasting, Physics.Probe.raycast for physics-based queries, or DepthTexture.sampleDepthAtPoint for raw depth at a UV point.

Can WorldQueryModule track fast-moving surfaces?

No. The depth computation updates at approximately 5Hz, making it suitable only for static or slow-moving surfaces like floors, walls, and tables, not for fast-moving objects.