Example #1
0
 // Update is called once per frame
 public void Update()
 {
     if (sensoThread != null)
     {
         var now = System.DateTime.Now;
         if (HeadPositionSource != null && now >= orientationNextSend)
         {
             sensoThread.SetHeadLocationAndRotation(HeadPositionSource.transform.localPosition, HeadPositionSource.transform.rotation * Quaternion.Inverse(Quaternion.Euler(subtractFromOrientation)));
             orientationNextSend = now.AddMilliseconds(orientationSendEveryMS);
         }
         if (now >= pingNextSend)
         {
             sensoThread.SendPing();
             pingNextSend = now.AddMilliseconds(orientationSendEveryMS);
         }
     }
 }
 // Update is called once per frame
 public void Update()
 {
     if (sensoThread != null)
     {
         var now = System.DateTime.Now;
         if (now >= orientationNextSend)
         {
             if (HeadPositionSource != null)
             {
                 sensoThread.SetHeadLocationAndRotation(HeadPositionSource.transform.localPosition, HeadPositionSource.transform.localRotation);
             }
             else
             {
                 sensoThread.SendPing();
             }
             orientationNextSend = now.AddMilliseconds(orientationSendEveryMS);
         }
     }
 }