fix probe cameras not rotating properly

This commit is contained in:
_nebula 2023-02-07 22:37:11 +00:00
parent f9dc544405
commit 6984421034

View File

@ -11,7 +11,6 @@ public class QSBProbeCamera : MonoBehaviour
private OWCamera _camera; private OWCamera _camera;
private RenderTexture _snapshotTexture; private RenderTexture _snapshotTexture;
private NoiseImageEffect _noiseEffect;
private static OWCamera _lastSnapshotCamera; private static OWCamera _lastSnapshotCamera;
private Quaternion _origLocalRotation; private Quaternion _origLocalRotation;
private Quaternion _origParentLocalRotation; private Quaternion _origParentLocalRotation;
@ -23,10 +22,10 @@ public class QSBProbeCamera : MonoBehaviour
private void Awake() private void Awake()
{ {
_origLocalRotation = transform.localRotation;
_origParentLocalRotation = transform.parent.localRotation;
_camera = this.GetRequiredComponent<OWCamera>(); _camera = this.GetRequiredComponent<OWCamera>();
_camera.enabled = false; _camera.enabled = false;
_noiseEffect = GetComponent<NoiseImageEffect>();
//this._snapshotTexture = ProbeCamera.GetSharedSnapshotTexture();
} }
private void OnDestroy() private void OnDestroy()
@ -58,11 +57,6 @@ public class QSBProbeCamera : MonoBehaviour
public RenderTexture TakeSnapshot() public RenderTexture TakeSnapshot()
{ {
_lastSnapshotCamera = _camera; _lastSnapshotCamera = _camera;
if (_noiseEffect != null)
{
_noiseEffect.enabled = HasInterference();
}
_camera.targetTexture = _snapshotTexture; _camera.targetTexture = _snapshotTexture;
_camera.Render(); _camera.Render();
return _snapshotTexture; return _snapshotTexture;