FOVE SUPPORT CENTER

Comments

1 comment

  • Avatar
    Lochlainn Wilson

    It is possible, however non standard. There is a single point calibration exposed in the untiy plugin. If you use this, it will mostly work with anyone's eyes. Extreme variation between users eyes can cause unsatisfactory results. 

    Attach the following script to a gameObject under your fove interface, I use a small white self lit sphere. 

    //Script starts here.

    using UnityEngine;
    using System.Collections;

    public class ManualDriftCorrection : MonoBehaviour
    {
    FoveInterface foveInterface;
    bool down = false;
    // Use this for initialization
    void Start()
    {
    //setup
    foveInterface = FindObjectOfType<FoveInterface>();
    //do not let self collission occur! the calibration object itself should not have a collider, but if it does, disable it.
    Collider collider = this.gameObject.GetComponent<Collider> ();
    if (collider)
    {
    collider.enabled = false;
    }
    }

    // Update is called once per frame
    void Update()
    {
    if (Input.GetKeyDown(KeyCode.M))
    {
    this.GetComponent<Renderer>().enabled = true;
    down = true;
    }
    if (down)
    {
    RaycastHit hit;
    Ray ray = new Ray(foveInterface.transform.position, foveInterface.transform.forward);
    if (Physics.Raycast(ray, out hit, 20.0f))
    {
    transform.position = hit.point;
    }
    else
    {
    transform.position = foveInterface.transform.position + foveInterface.transform.forward * 10f;
    }
    }
    if (Input.GetKeyUp (KeyCode.M))
    {
    down = false;
    this.GetComponent<Renderer>().enabled = false;
    Fove.FoveHeadset.GetHeadset ().ManualDriftCorrection3D (this.transform.localPosition);
    }
    }
    }

    0
    Comment actions Permalink

Please sign in to leave a comment.