Exemple #1
0
    void Update()
    {
        // Check if the system is currently streaming
        if (rtClient.GetStreamingStatus())
        {
            // Get the data of the tracked object based on the name supplied
            SixDOFBody trackedObj = rtClient.GetBody(objectName);

            // If this object has a position value, that means it's tracked!
            if (!float.IsNaN(trackedObj.Position.sqrMagnitude))
            {
                // Apply the position and rotation to the object
                transform.position = trackedObj.Position;
                transform.rotation = trackedObj.Rotation;
            }
        }
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        if (updateTimer > 0)
        {
            updateTimer -= Time.deltaTime;
        }

        if (rtClient.GetStreamingStatus())
        {
            SixDOFBody trackedObj = rtClient.GetBody(objectName);

            if (!float.IsNaN(trackedObj.Position.sqrMagnitude))
            {
                transform.position = trackedObj.Position;
                transform.rotation = trackedObj.Rotation;
            }
        }
    }