Esempio n. 1
0
    // Tracks HMD and Controller
    public static void TrackHeadAndController(int logSTID = -1)
    {
        string cs = SaveInfo.csvColSeparator;

        RaycastHit hitHead;
        Ray        rayHead = new Ray(Camera.main.transform.position, Camera.main.transform.forward);

        RaycastHit hitController;
        Ray        rayController = new Ray(steamController.transform.position, steamController.transform.forward);

        textBuffer += SaveInfo.strTimestamp() + cs + logSTID + cs;

        if (Physics.Raycast(rayHead, out hitHead, 100.0f))
        {
            textBuffer += hitHead.point.x + cs + hitHead.point.y + cs + hitHead.point.z + cs + Camera.main.transform.position.x + cs + Camera.main.transform.position.y + cs + Camera.main.transform.position.z + cs + hitHead.collider.gameObject.name + cs;
        }

        if (Physics.Raycast(rayController, out hitController, 100.0f))
        {
            textBuffer += hitController.point.x + cs + hitController.point.y + cs + hitController.point.z + cs + steamController.transform.position.x + cs + steamController.transform.position.y + cs + steamController.transform.position.z + cs + hitController.collider.gameObject.name;
        }

        textBuffer += "\n";

        // If it is an important move information (a selected item), write the buffer to disk immediately.
        if (logSTID != -1)
        {
            WriteToDisk();
        }
    }
Esempio n. 2
0
 /// <summary>
 /// Called at the frame when the new task is visible to the user for the first time.
 /// </summary>
 public void taskIsVisible()
 {
     timeAtTaskStart      = Time.time;
     timestampAtTaskStart = SaveInfo.strTimestamp();
 }