Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }