Optional
dataOptional: if assigned it will be instantiated per tracked plane/tracked mesh.
If not assigned a simple mesh will be used. Use occluder
to create occlusion meshes that don't render color but only depth.
the object this component is attached to. Note that this is a threejs Object3D with some additional features
the unique identifier for this component
If true the system will try to initiate room capture if no planes are detected.
If true an occluder material will be applied to the tracked planes/meshes.
Note: this will only be applied if dataTemplate is not assigned
when enabled mesh or plane tracking will also be used in VR
Optional
sourceholds the source identifier this object was created with/from (e.g. if it was part of a glTF file the sourceId holds the url to the glTF)
If true mesh tracking will be enabled
If true plane tracking will be enabled
true if the object is enabled and active in the hierarchy
true if this component was destroyed (this.destroy()
) or the whole object this component was part of
the layer of the gameObject this component is attached to
the name of the gameObject this component is attached to
shorthand for this.context.scene
the scene of the context
Is the gameObject marked as static
the tag of the gameObject this component is attached to
Returns all tracked planes
Optional
init: Partial<NoInternalNeedleEngineState<FilterStartingWith<FilterTypes<WebXRPlaneTracking, Function>, "_">>>Optional
earlyOptional
lateOptional
onOptional
onOptional
onOptional
onOptional
onCallback when this component exists a xr session (or when it becomes inactive in a running XR session)
Optional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onXRControllerCallback when a controller is connected/added while in a XR session
OR when the component joins a running XR session that has already connected controllers
OR when the component becomes active during a running XR session that has already connected controllers
Optional
onXRControllerOptional
resolveOptional
startstarts a coroutine (javascript generator function)yield
will wait for the next frame:
yield WaitForSeconds(1)
to wait for 1 second.yield WaitForFrames(10)
to wait for 10 frames.yield new Promise(...)
to wait for a promise to resolve.generator function to start
event to register the coroutine for (default: FrameEvent.Update). Note that all coroutine FrameEvent callbacks are invoked after the matching regular component callbacks. For example FrameEvent.Update
will be called after regular component update()
methods)
the generator function (use it to stop the coroutine with stopCoroutine
)
onEnable() { this.startCoroutine(this.myCoroutine()); }
private *myCoroutine() {
while(this.activeAndEnabled) {
console.log("Hello World", this.context.time.frame);
// wait for 5 frames
for(let i = 0; i < 5; i++) yield;
}
}
Stop a coroutine that was previously started with startCoroutine
the routine to be stopped
the frame event to unregister the routine from (default: FrameEvent.Update)
Optional
supportsXROptional callback, you can implement this to only get callbacks for VR or AR sessions if necessary.
true if the mode is supported (if false the mode is not supported by this component and it will not receive XR callbacks for this mode)
Optional
updateGenerated using TypeDoc
Use this component to track planes and meshes in the real world when in immersive-ar (e.g. on Oculus Quest).