08-24-2017 07:06 AM
08-24-2017 11:00 AM
09-11-2017 11:21 AM
09-11-2017 02:04 PM
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ControlSwitch : MonoBehaviour {
// Input module
private OVRInputModule inputModule;
public OVRCameraRig cameraRig;
// Use this for initialization
void Start () {
AssignCameraRig ();
}
// Update is called once per frame
void Update () {
inputModule.rayTransform = OVRGazePointer.instance.rayTransform =
(OVRInput.GetActiveController() == OVRInput.Controller.Touch) ? cameraRig.rightHandAnchor :
(OVRInput.GetActiveController() == OVRInput.Controller.RTouch) ? cameraRig.rightHandAnchor :
(OVRInput.GetActiveController() == OVRInput.Controller.LTouch) ? cameraRig.leftHandAnchor :
cameraRig.centerEyeAnchor;
}
public void AssignCameraRig()
{
EventSystem eventSystem = GameObject.FindObjectOfType<EventSystem>();
inputModule = eventSystem.GetComponent<OVRInputModule>();
}
}
09-14-2017 06:22 AM
Hey idrez. Cool script. Glad you got it. I think you may have an older version. I'm using Unity 2017 and Oculus sample framework v1.15. I just checked for an update and it seems I have the latest framework version. This is what I have:
idrez said:
I'm having one issue. How do you set the GazePointer to righthandAnchor locator if the variable type is OVRCameraRig
03-19-2018 03:47 PM
08-05-2018 05:09 AM
06-12-2019 05:29 AM