Skip to main content

HitTestSessionOptions

Class

Options for configuring a HitTestSession.

  • Snapchat: not supported
  • SPECS: fully supported
  • Camera Kit Web: not supported
  • Camera Kit Mobile: not supported
  • SnapchatNot supported — SPECS only
  • SPECSFully supported
  • Camera Kit WebNot supported — SPECS only
  • Camera Kit MobileNot supported — SPECS only

Platform details

  • Snapchat — Not supported — SPECS only.

  • SPECS — Fully supported.

  • Camera Kit Web — Not supported — SPECS only.

  • Camera Kit Mobile — Not supported — SPECS only.

Options for configuring a HitTestSession.

Index

Example

const worldQuery = require("LensStudio:WorldQueryModule");
var options = HitTestSessionOptions.create();
options.filter = true;
var hitTestSessionWithOptions = worldQuery.createHitTestSessionWithOptions(options);

Extends

Properties

classification

classification: boolean

SPECS only

If set to true, the surface classification of the hit surface is enabled. By default the classification is set to false.

Since

Lens Scripting Version 377

Default Value

false
@wearableOnly

filter

filter: boolean

SPECS only

If true - a double exponential filter is applied to filter/smooth over multiple hit test results.

Since

Lens Scripting Version 270

Default Value

false
@wearableOnly

highAccuracy

highAccuracy: boolean

SPECS only

Enables high-accuracy hit tests for this session. This mode favors accuracy over response time and consumes more power while the session is active.

The additional power use continues until HitTestSession#stop is called. If multiple high-accuracy sessions are active, all must be stopped.

Since

Lens Scripting Version 377

Default Value

false
@wearableOnly

Example

const worldQuery = require("LensStudio:WorldQueryModule");
var options = HitTestSessionOptions.create();
options.highAccuracy = true;
var hitTestSession = worldQuery.createHitTestSessionWithOptions(options);

Methods

create()

static create(): HitTestSessionOptions

SPECS only

Create a new HitTestSessionOptions object.

Returns

HitTestSessionOptions

Since

Lens Scripting Version 270


getTypeName()

static getTypeName(): TypeName<HitTestSessionOptions>

SPECS only

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<HitTestSessionOptions>

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

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

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

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

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame