Exemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
            if (rtClient == null)
            {
                rtClient = RTClient.GetInstance();
            }

            SixDOFBody body = rtClient.GetBody(ObjectName);

            if (body != null)
            {
                if (body.Position.magnitude > 0) //just to avoid error when position is NaN
                {
                    transform.position = body.Position + PositionOffset;
                    if (transform.parent)
                    {
                        transform.position += transform.parent.position;
                    }
                    transform.rotation = body.Rotation * Quaternion.Euler(EulerOffset);
                    if (transform.parent)
                    {
                        transform.rotation *= transform.parent.rotation;
                    }
                }
            }
        }
Exemplo n.º 2
0
        // Update is called once per frame
        void Update()
        {
            if (rtClient == null)
            {
                rtClient = RTClient.GetInstance();
            }

            body = rtClient.GetBody(ObjectName);
            if (body != null)
            {
                this.applyBody();
            }
        }
Exemplo n.º 3
0
        // Update is called once per frame
        void Update()
        {
            if (rtClient == null)
            {
                rtClient = RTClient.GetInstance();
            }

            var body = rtClient.GetBody(ObjectName);

            if (body != null)
            {
                applyBodyTransform(body);
            }
        }