Class WebXRHitTest
Hierarchy (View Summary)
- WebXRAbstractFeature
- WebXRHitTest
Implements
Constructors
constructor
-
new WebXRHitTest(
_xrSessionManager: WebXRSessionManager,
options?: IWebXRHitTestOptions,
): WebXRHitTestCreates a new instance of the hit test feature
Parameters
- _xrSessionManager: WebXRSessionManager
an instance of WebXRSessionManager
- options: IWebXRHitTestOptions = {}
options to use when constructing this feature
Returns WebXRHitTest
- _xrSessionManager: WebXRSessionManager
Properties
auto Clone Transformation
When set to true, each hit test will have its own position/rotation objects When set to false, position and rotation objects will be reused for each hit test. It is expected that the developers will clone them or copy them as they see fit.
Optionaldepends On
The dependencies of this feature, if any
disable Auto Attach
Should auto-attach be disabled?
is Disposed
Is this feature disposed?
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 Note - this will be called when results come back from the device. It can be an empty array!!
Readonlyoptions
[Empty Object] options to use when constructing this feature
paused
Use this to temporarily pause hit test checks.
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
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
Tested on chrome (mobile) 80.