예제 #1
0
    // Update is called once per frame
    public void Update()
    {
        if (m_tracker == null && MiddleVR.VRDeviceMgr != null)
        {
            ShareName = "S_" + m_ShareID.ToString();
            m_tracker = MiddleVR.VRDeviceMgr.CreateTracker(ShareName);
            MiddleVRTools.Log("[+] Created shared tracker " + ShareName);
            MiddleVR.VRClusterMgr.AddSynchronizedObject(m_tracker, 1);
        }

        if (MiddleVR.VRClusterMgr.IsServer() && m_tracker != null)
        {
            Vector3    p = transform.position;
            Quaternion q = transform.rotation;

            vrVec3 pos = new vrVec3(p.x, p.y, p.z);
            vrQuat or  = new vrQuat(q.x, q.y, q.z, q.w);

            m_tracker.SetPosition(pos);
            m_tracker.SetOrientation(or);

            //MiddleVRTools.Log("Server pushing data : " + p.z );
        }
    }