Ejemplo n.º 1
0
 private void Start()
 {
     // If this is the non-VR camera, then we don't need to find hand objects because we don't have hands
     mouseMode = GameManager.instance.nonVRCamera == gameObject;
     if (!mouseMode)
     {
         // Resolve which controller we are using. Left hand will be default
         rightHand = (raycastController.Equals(OVRInput.Controller.RTouch) || gameObject.name.Contains("right")) ? true : false;
         // Get the renderer of the static pointed finger and disable it initially
         // staticIndexRenderer = staticHandObject.GetComponent<MeshRenderer>();
         // Disable the static hand if we can find it
         if (staticIndexRenderer != null)
         {
             staticIndexRenderer.enabled = false;
         }
         else
         {
             Debug.LogWarning("No Static hand model found.");
         }
         // Try to find the line renderer
         lineRend = gameObject.GetComponentInChildren <LineRenderer>();
         if (lineRend == null)
         {
             Debug.LogWarning("Couldn't find line renderer in RaycastForward");
         }
     }
 }
Ejemplo n.º 2
0
        public OculusSensorManager(OVRInput.Controller controller, SensorType sensorType) : base(3, sensorType)
        {
            // Check that the given controller corresponds to a valid OTouch controller type.
            if (sensorType == SensorType.OculusSensor)
            {
                if (!(controller.Equals(OVRInput.Controller.LTouch) || controller.Equals(OVRInput.Controller.RTouch)))
                {
                    throw new System.PlatformNotSupportedException("Only LTouch and RTouch supported.");
                }
            }
            // Other Oculus controllers are currently unsupported.
            else
            {
                throw new System.PlatformNotSupportedException("Only Oculus Touch controllers supported.");
            }

            this.controller = controller;
        }