Class responsible for detecting intersections between a virtual ray and real-world surfaces.
Example
constworldQuery = require("LensStudio:WorldQueryModule") // Create a session with default options (currently, filtering disabled by default) varhitTestSession = worldQuery.createHitTestSession();
// Create a second session with a smoothing filter applied to the hit test result varoptions = HitTestSessionOptions.create(); options.filter = true; varhitTestSessionWithOptions = worldQuery.createHitTestSessionWithOptions(options);
// Depth computation is started once a session is started // Multiple sessions access the same depth data, thus there is no additional cost hitTestSession.start() hitTestSessionWithOptions.start()
Start the sesion. Depth computation is started once a session is started. Multiple sessions access the same depth data, thus there is no additional cost.
Returns void
stop
stop(): void
Stop the session. Depth computation stops once all hit test sessions are stopped.
Class responsible for detecting intersections between a virtual ray and real-world surfaces.
Example