mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:17:45 +02:00
Merge pull request #10863 from zfox23/spectatorCamera_clarifySetDisplay
Clarify setDisplayTexture() cases, also fixing crash bug
This commit is contained in:
commit
e85b6c870c
1 changed files with 12 additions and 2 deletions
|
@ -223,9 +223,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Function Name: setDisplay()
|
||||||
|
//
|
||||||
|
// Description:
|
||||||
|
// -There are two bool variables that determine what the "url" argument to "setDisplayTexture(url)" should be:
|
||||||
|
// Camera on/off switch, and the "Monitor Shows" on/off switch.
|
||||||
|
// This results in four possible cases for the argument. Those four cases are:
|
||||||
|
// 1. Camera is off; "Monitor Shows" is "HMD Preview": "url" is ""
|
||||||
|
// 2. Camera is off; "Monitor Shows" is "Camera View": "url" is ""
|
||||||
|
// 3. Camera is on; "Monitor Shows" is "HMD Preview": "url" is ""
|
||||||
|
// 4. Camera is on; "Monitor Shows" is "Camera View": "url" is "resource://spectatorCameraFrame"
|
||||||
function setDisplay(showCameraView) {
|
function setDisplay(showCameraView) {
|
||||||
// It would be fancy if (showCameraView && !cameraUpdateInterval) would show instructions, but that's out of scope for now.
|
// It would be fancy if the app would show instructions when (url === ""), but that's out of scope for now.
|
||||||
var url = (showCameraView && cameraUpdateInterval) ? "resource://spectatorCameraFrame" : "";
|
var url = (camera && showCameraView && cameraUpdateInterval) ? "resource://spectatorCameraFrame" : "";
|
||||||
Window.setDisplayTexture(url);
|
Window.setDisplayTexture(url);
|
||||||
}
|
}
|
||||||
const MONITOR_SHOWS_CAMERA_VIEW_DEFAULT = false;
|
const MONITOR_SHOWS_CAMERA_VIEW_DEFAULT = false;
|
||||||
|
|
Loading…
Reference in a new issue