why vr rig

This commit is contained in:
NotAKidoS 2023-03-03 19:06:38 -06:00
parent b4dfbcc2ef
commit 8525bbd019
2 changed files with 4 additions and 2 deletions

View file

@ -47,7 +47,7 @@ public class MainMenuHelper : MonoBehaviour
{ {
//VR specific anchor //VR specific anchor
GameObject vrAnchor = new GameObject("MSP_MMVR_Anchor"); GameObject vrAnchor = new GameObject("MSP_MMVR_Anchor");
vrAnchor.transform.parent = PlayerSetup.Instance.vrCameraRig.transform; vrAnchor.transform.parent = PlayerSetup.Instance.transform;
vrAnchor.transform.localPosition = Vector3.zero; vrAnchor.transform.localPosition = Vector3.zero;
worldAnchor = vrAnchor.transform; worldAnchor = vrAnchor.transform;
} }
@ -93,6 +93,7 @@ public class MainMenuHelper : MonoBehaviour
public void HandleDesktopPosition() public void HandleDesktopPosition()
{ {
if (MSP_MenuInfo.CameraTransform == null || MSP_MenuInfo.DisableMMHelper) return; if (MSP_MenuInfo.CameraTransform == null || MSP_MenuInfo.DisableMMHelper) return;
Transform activeAnchor = MSP_MenuInfo.isIndependentHeadTurn ? worldAnchor : MSP_MenuInfo.CameraTransform; Transform activeAnchor = MSP_MenuInfo.isIndependentHeadTurn ? worldAnchor : MSP_MenuInfo.CameraTransform;
transform.localScale = new Vector3(1.6f * MSP_MenuInfo.ScaleFactor, 0.9f * MSP_MenuInfo.ScaleFactor, 1f); transform.localScale = new Vector3(1.6f * MSP_MenuInfo.ScaleFactor, 0.9f * MSP_MenuInfo.ScaleFactor, 1f);
transform.position = activeAnchor.position + activeAnchor.forward * 1f * MSP_MenuInfo.ScaleFactor * MSP_MenuInfo.AspectRatio; transform.position = activeAnchor.position + activeAnchor.forward * 1f * MSP_MenuInfo.ScaleFactor * MSP_MenuInfo.AspectRatio;
@ -103,6 +104,7 @@ public class MainMenuHelper : MonoBehaviour
public void HandleVRPosition() public void HandleVRPosition()
{ {
if (worldAnchor == null || MSP_MenuInfo.DisableMMHelper_VR) return; if (worldAnchor == null || MSP_MenuInfo.DisableMMHelper_VR) return;
transform.localScale = new Vector3(1.6f * MSP_MenuInfo.ScaleFactor * 1.8f, 0.9f * MSP_MenuInfo.ScaleFactor * 1.8f, 1f); transform.localScale = new Vector3(1.6f * MSP_MenuInfo.ScaleFactor * 1.8f, 0.9f * MSP_MenuInfo.ScaleFactor * 1.8f, 1f);
transform.position = worldAnchor.position; transform.position = worldAnchor.position;
transform.rotation = worldAnchor.rotation; transform.rotation = worldAnchor.rotation;

View file

@ -45,7 +45,7 @@ public class QuickMenuHelper : MonoBehaviour
{ {
//VR specific anchor //VR specific anchor
GameObject vrAnchor = new GameObject("MSP_QMVR_Anchor"); GameObject vrAnchor = new GameObject("MSP_QMVR_Anchor");
vrAnchor.transform.parent = PlayerSetup.Instance.vrCameraRig.transform; vrAnchor.transform.parent = PlayerSetup.Instance.transform;
vrAnchor.transform.localPosition = Vector3.zero; vrAnchor.transform.localPosition = Vector3.zero;
worldAnchor = vrAnchor.transform; worldAnchor = vrAnchor.transform;
} }