Constructor
new VrManager(app)
Manage and update pc.VrDisplays that are attached to this device.
Parameters:
Name | Type | Description |
---|---|---|
app |
pc.Application | The main application |
Properties:
Name | Type | Description |
---|---|---|
displays |
Array.<pc.VrDisplay> | The list of pc.VrDisplays that are attached to this device |
display |
pc.VrDisplay | The default pc.VrDisplay to be used. Usually the first in the `displays` list |
isSupported |
Boolean | Reports whether this device supports the WebVR API |
usesPolyfill |
Boolean | Reports whether this device supports the WebVR API using a polyfill |
- Source:
Members
(static) isSupported :Boolean
Reports whether this device supports the WebVR API
Type:
- Boolean
- Source:
(static) usesPolyfill :Boolean
Reports whether this device supports the WebVR API using a polyfill
Type:
- Boolean
- Source:
Methods
destroy()
Remove events and clear up manager
- Source:
poll()
Called once per frame to poll all attached displays
- Source:
Events
displayconnect
Fired when an VR display is connected
Parameters:
Name | Type | Description |
---|---|---|
display |
pc.VrDisplay | The pc.VrDisplay that has just been connected |
- Source:
Example
this.app.vr.on("displayconnect", function (display) {
// use `display` here
});
displaydisconnect
Fired when an VR display is disconnected
Parameters:
Name | Type | Description |
---|---|---|
display |
pc.VrDisplay | The pc.VrDisplay that has just been disconnected |
- Source:
Example
this.app.vr.on("displaydisconnect", function (display) {
// `display` is no longer connected
});