示例#1
0
        public void SetHandPhysics(HandModel hand, bool enabled)
        {
            PuppetView view = BasicHelpers.FindFirst <HPTKView, PuppetView>(hand.view.registry);

            if (view)
            {
                view.SetPhysics(enabled);
            }
        }
示例#2
0
        void Init(AvatarView avatar)
        {
            if (detector != null)
            {
                return;
            }

            if (side == Side.Left)
            {
                detector = BasicHelpers.FindFirst <HPTKView, GestureDetectionView>(avatar.body.leftHand.registry);
            }
            else
            {
                side     = Side.Right;
                detector = BasicHelpers.FindFirst <HPTKView, GestureDetectionView>(avatar.body.rightHand.registry);
            }

            if (detector == null)
            {
                Debug.LogWarning(side.ToString() + " hand of avatar " + avatar.name + " does not have a GestureDetectionController registered. Searching in the next avatar");
                avatarToSearch++;
                FindAvatar();
                return;
            }

            thumb.finger  = detector.thumb;
            index.finger  = detector.index;
            middle.finger = detector.middle;
            ring.finger   = detector.ring;
            pinky.finger  = detector.pinky;

            if (detector.extra.Count > 0)
            {
                extra = detector.extra[0];
            }

            thumb.SearchExtraGesture();
            index.SearchExtraGesture();
            middle.SearchExtraGesture();
            ring.SearchExtraGesture();
            pinky.SearchExtraGesture();
        }
示例#3
0
 public Tout GetRegisteredView <Tout>() where Tout : HPTKView
 {
     return(BasicHelpers.FindFirst <HPTKView, Tout>(registry));
 }