|
@@ -24,9 +24,10 @@ export class UtilityLayerRenderer implements IDisposable {
|
|
|
|
|
|
/**
|
|
/**
|
|
* Gets the camera that is used to render the utility layer (when not set, this will be the last active camera)
|
|
* Gets the camera that is used to render the utility layer (when not set, this will be the last active camera)
|
|
|
|
+ * @param getRigParentIfPossible if the current active camera is a rig camera, should its parent camera be returned
|
|
* @returns the camera that is used when rendering the utility layer
|
|
* @returns the camera that is used when rendering the utility layer
|
|
*/
|
|
*/
|
|
- public getRenderCamera() {
|
|
|
|
|
|
+ public getRenderCamera(getRigParentIfPossible?: boolean) {
|
|
if (this._renderCamera) {
|
|
if (this._renderCamera) {
|
|
return this._renderCamera;
|
|
return this._renderCamera;
|
|
} else {
|
|
} else {
|
|
@@ -36,7 +37,11 @@ export class UtilityLayerRenderer implements IDisposable {
|
|
} else {
|
|
} else {
|
|
activeCam = <Camera>(this.originalScene.activeCamera!);
|
|
activeCam = <Camera>(this.originalScene.activeCamera!);
|
|
}
|
|
}
|
|
- return (activeCam && activeCam.isRigCamera) ? activeCam.rigParent! : activeCam;
|
|
|
|
|
|
+
|
|
|
|
+ if (getRigParentIfPossible && activeCam.isRigCamera) {
|
|
|
|
+ return activeCam.rigParent!;
|
|
|
|
+ }
|
|
|
|
+ return activeCam;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
@@ -313,7 +318,7 @@ export class UtilityLayerRenderer implements IDisposable {
|
|
}
|
|
}
|
|
|
|
|
|
private _updateCamera() {
|
|
private _updateCamera() {
|
|
- this.utilityLayerScene.cameraToUseForPointers = this.getRenderCamera();
|
|
|
|
- this.utilityLayerScene.activeCamera = this.getRenderCamera();
|
|
|
|
|
|
+ this.utilityLayerScene.cameraToUseForPointers = this.getRenderCamera(true);
|
|
|
|
+ this.utilityLayerScene.activeCamera = this.getRenderCamera(true);
|
|
}
|
|
}
|
|
}
|
|
}
|