예제 #1
0
        /*--------------------------------------------------------------------------------------------*/
        public void Update()
        {
            int count = vGameObjects.Length;

            for (int i = 0; i < count; i++)
            {
                GameObject handGo = vGameObjects[i];

                if (InitializePalmsOnly && (i - 2) % TrackersPerHand != 0)
                {
                    handGo.SetActive(false);
                    continue;
                }

                bool isLeft = (i < TrackersPerHand);
                LeapAnalogs.HandInfo handInfo = (isLeft ? Analogs.LeftHand : Analogs.RightHand);

                if (!handInfo.IsAvailable)
                {
                    handGo.SetActive(false);
                    continue;
                }

                InterfaceState <Pose3> poseState = vInterfaces[i].GetState();
                Vector3    pos = Math.ConvertPosition(poseState.Value.translation);
                Quaternion rot = Math.ConvertOrientation(poseState.Value.rotation);

                handGo.SetActive(true);
                handGo.transform.localPosition = pos;
                handGo.transform.localRotation = rot;
                handGo.transform.localScale    =
                    Vector3.Lerp(Vector3.one, Vector3.one * 0.5f, handInfo.GrabStrength) * 0.01f;
            }
        }
예제 #2
0
        /*--------------------------------------------------------------------------------------------*/
        public void Update()
        {
            Quaternion rot = Math.ConvertOrientation(vInterface.GetState().Value);

            gameObject.transform.localRotation = rot;
        }