Class WebXRHitTestLegacy
Hierarchy (View Summary)
- WebXRAbstractFeature
- WebXRHitTestLegacy
Implements
Constructors
constructor
-
new WebXRHitTestLegacy(
_xrSessionManager: WebXRSessionManager,
options?: IWebXRLegacyHitTestOptions,
): WebXRHitTestLegacyCreates a new instance of the (legacy version) hit test feature
Parameters
- _xrSessionManager: WebXRSessionManager
an instance of WebXRSessionManager
- options: IWebXRLegacyHitTestOptions = {}
options to use when constructing this feature
Returns WebXRHitTestLegacy
- _xrSessionManager: WebXRSessionManager
Properties
Optionaldepends On
The dependencies of this feature, if any
disable Auto Attach
Should auto-attach be disabled?
is Disposed
Is this feature disposed?
last Native XR Hit Results
Populated with the last native XR Hit Results
on Feature Attach Observable
Observers registered here will be executed when the feature is attached
on Feature Detach Observable
Observers registered here will be executed when the feature is detached
on Hit Test Result Observable
Triggered when new babylon (transformed) hit test results are available
Readonlyoptions
[Empty Object] options to use when constructing this feature
Static ReadonlyName
The module's name
Static ReadonlyVersion
The (Babylon) version of this module. This is an integer representing the implementation version. This number does not correspond to the WebXR specs version
Accessors
attached
-
get attached(): boolean
Is this feature attached
Returns boolean
xr Native Feature Name
-
get xrNativeFeatureName(): string
The name of the native xr feature name (like anchor, hit-test, or hand-tracking)
Returns string
-
set xrNativeFeatureName(name: string): void
The name of the native xr feature name, if applicable (like anchor, hit-test, or hand-tracking)
Parameters
- name: string
Returns void
Methods
attach
-
attach this feature Will usually be called by the features manager
Returns boolean
true if successful.
detach
-
detach this feature. Will usually be called by the features manager
Returns boolean
true if successful.
dispose
-
Dispose this feature and all of the resources attached
Returns void
is Compatible
-
This function will be executed during before enabling the feature and can be used to not-allow enabling it. Note that at this point the session has NOT started, so this is purely checking if the browser supports it
Returns boolean
whether or not the feature is compatible in this environment
StaticXR Hit Test With Ray
-
XRHitTestWithRay(
xrSession: XRSession,
xrRay: XRRay,
referenceSpace: XRReferenceSpace,
filter?: (result: XRHitResult) => boolean,
): Promise<XRHitResult[]>execute a hit test with an XR Ray
Parameters
- xrSession: XRSession
a native xrSession that will execute this hit test
- xrRay: XRRay
the ray (position and direction) to use for ray-casting
- referenceSpace: XRReferenceSpace
native XR reference space to use for the hit-test
Optionalfilter: (result: XRHitResult) => booleanfilter function that will filter the results
Returns Promise<XRHitResult[]>
a promise that resolves with an array of native XR hit result in xr coordinates system
- xrSession: XRSession
StaticXR Hit Test With Select Event
-
XRHitTestWithSelectEvent(
event: XRInputSourceEvent,
referenceSpace: XRReferenceSpace,
): Promise<XRHitResult[]>Execute a hit test on the current running session using a select event returned from a transient input (such as touch)
Parameters
- event: XRInputSourceEvent
the (select) event to use to select with
- referenceSpace: XRReferenceSpace
the reference space to use for this hit test
Returns Promise<XRHitResult[]>
a promise that resolves with an array of native XR hit result in xr coordinates system
- event: XRInputSourceEvent
The currently-working hit-test module. Hit test (or Ray-casting) is used to interact with the real world. For further information read here - https://github.com/immersive-web/hit-test