private IEnumerator Position() { while (true) { Vector3 pos = VRPN.vrpnTrackerPos(trackerAddress, channel) + trackerPositionOffset; if (convertToLeft) { pos.x = Interlocked.Exchange(ref pos.z, pos.x); pos.y *= -1; transform.localPosition = pos; } else if (viveTracker) { Vector3 vivePos; vivePos.x = pos.z; vivePos.y = pos.x; vivePos.z = pos.y; transform.localPosition = vivePos; } else { transform.localPosition = pos; } yield return(null); } }
private IEnumerator Position() { while (true) { Vector3 pos = VRPN.vrpnTrackerPos(trackerAddress, channel) + trackerPositionOffset; if (convertToLeft) { pos.x = Interlocked.Exchange(ref pos.z, pos.x); pos.y *= -1; transform.localPosition = pos; } else { transform.localPosition = pos; } //float temp = pos.z; //pos.z = pos.x; //pos.x = temp; // pos.y = -pos.y; yield return(null); } }