Class HitTestSessionWearable Only

Class responsible for detecting intersections between a virtual ray and real-world surfaces.

const worldQuery = require("LensStudio:WorldQueryModule")
// Create a session with default options (currently, filtering disabled by default)
var hitTestSession = worldQuery.createHitTestSession();

// Create a second session with a smoothing filter applied to the hit test result
var options = HitTestSessionOptions.create();
options.filter = true;
var hitTestSessionWithOptions = 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()

hitTestSession.hitTest(rayStart, rayEnd, onHitTestResult1);
hitTestSessionWithOptions.hitTest(rayStart, rayEnd, onHitTestResult2);

// Depth computation stops once all hit test sessions are stopped
hitTestSession.stop()
hitTestSessionWithOptions.stop()

Hierarchy (View Summary, Expand)

Constructors

Methods

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Reset the session.

    Returns void

  • 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 the session. Depth computation stops once all hit test sessions are stopped.

    Returns void

MMNEPVFCICPMFPCPTTAAATR