Oculus VRTK头盔位置调整

 分清楚玩家根节点的位置和头(OVRCameraRig)的位置


VRTK_DeviceFinder.HeadsetTransform()



 Oculus VRTK头盔位置调整_第1张图片



Player.Instance.transform.localPosition = ObjManager.instance.playerPos02.transform.localPosition;
Player.Instance.transform.localEulerAngles = ObjManager.instance.playerPos02.transform.localEulerAngles;
Player.Instance.HeadGoTo(ObjManager.instance.playerPos02.transform.position);
        Player.Instance.CamRigGoRoat(ObjManager.instance.playerPos02.transform.eulerAngles);

    /// 
    /// 以头为基准移动CamRig
    /// 
    /// 想要让头去的位置
    public void HeadGoTo(Vector3 headPostion)
    {
        if (!Head)
            return;
        camRig.position = headPostion - Head.localPosition;
    }

    public void CamRigGoRoat(Vector3 roat) {

        camRig.eulerAngles = roat;
    }


FR:海涛高软(hunk Xu)
QQ技术交流群:386476712

你可能感兴趣的:(Unity)