Readonly
controllersGets XrController information.
Readonly
isWhether VIVERSE VR system is ready.
Send a specific event.
Event name
Optional
Rest
...args: any[]Event parameters
Unsubscribe from a specific event.
Event name.
Callback function.
Subscribe to a specific event.
Event name.
Callback function.
Start VIVERSE XR session. NOTE: WebXR requires a user action (key press, click, or touch) to enter and cannot start automatically.
XR session type
// The VIVERSE VR system might not be ready when the script is loaded.
button.active = false;
button.on('click', () => {
xrService.start(XrTypes.SessionTypes.Vr);
});
if(xrService.isVrReady){
button.active = true;
} else {
xrService.on('vr:ready', () => {
button.active = true;
xrService.off('vr:ready');
});
}
Define XrService interface.