FOVE SUPPORT CENTER

Suggestion: Hot Key for Calibration

Answered

Comments

2 comments

  • Official comment
    Avatar
    Lochlainn Wilson

    There is an instant one point re-calibration feature that is not well documented. I am really sorry about this.

    Try creating this C# script and adding it to a small plain white sphere in the center of your vision, at a good distance if possible.

    Script:
    -------------------------------------------------------------------------------------
    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;
    }
    GameObject target;

    }

    // 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);
    }
    }
    }

     

    Comment actions Permalink
  • Avatar
    Iikka Pohjola

    How is this supposed to work? Am I supposed to be focusing my eyes on the object while holding M? That makes the calibration go completely weird for me, like, way worse than it was in the first place.

    1
    Comment actions Permalink

Please sign in to leave a comment.