示例#1
0
        private void Update()
        {
            // If an ability was just activated but was finished, invalidate all controller memory positions:
            //  We do not want gestures performed while an ability is activating to trigger an accidental follow-up activation.
            if (abilityActivated && !wallIsMaking && !rockIsActive && !leftHand.recognizeFist() && !rightHand.recognizeFist())
            {
                leftHand.invalidateTrackingMemory();
                rightHand.invalidateTrackingMemory();
                abilityActivated = false;
            }

            analyzeStaticGestures();
            analyzeDynamicGestures();
        }
示例#2
0
        private bool recognizePlayerFist(TrackedHand hand)
        {
            if (hand == null)
            {
                return(false);
            }

            SteamVR_Behaviour_Skeleton skeleton = hand.getSkeleton();

            if (skeleton != null)
            {
                return(hand.recognizeFist());
            }

            return(abilityActivated);
        }