예제 #1
0
        private void Awake()
        {
            userRig = GetComponentInParent <UserRig>();
            skeletalControllerHand = GetComponent <SkeletalControllerHand>();

            ProviderSwitcher providerSwitcher = userRig.ProviderSwitcher;

            // get all of our handed stuff
            // break into the model manager
            handModelManagers = userRig.GetComponentsInChildren <HandModelManager>(true);

            FieldInfo[] privateFields = typeof(HandModelManager).GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
            modelGroupField = privateFields.First <FieldInfo>(item => item.Name == "ModelPool");
            modelGroupLists = new List <HandModelManager.ModelGroup> [handModelManagers.Length];

            // we need our datahands
            foreach (HandModelManager modelManager in handModelManagers)
            {
                DataHand[] dataHands = modelManager.GetComponentsInChildren <DataHand>(true);

                if (dataHands != null && dataHands.Length == 2)
                {
                    Chirality chirality = (IsLeft) ? Chirality.Left : Chirality.Right;
                    dataHand = dataHands.First(item => item is DataHand && item.Handedness == chirality);
                }
                else
                {
                    continue;
                }
            }

            GetModelGroupLists();
        }
예제 #2
0
        private void Awake()
        {
            controllerHand = GetComponent <SkeletalControllerHand>();
            handAnimator   = GetComponent <Animator>();

            hand     = controllerTransform.GetComponentInChildren <OVRHand>();
            skeleton = hand.GetComponent <OVRSkeleton>();

            GetControllerHashes();
        }
예제 #3
0
        private void Awake()
        {
            isPinchingHash      = Animator.StringToHash("IsPinching");
            pinchAmtHash        = Animator.StringToHash("PinchAmt");
            isGrabbedHash       = Animator.StringToHash("IsGrabbed");
            pinchThumbHorizHash = Animator.StringToHash("ThumbHoriz");

            if (!controllerHand)
            {
                controllerHand = GetComponent <SkeletalControllerHand>();
            }

            animator = steamVRPose.GetComponentInChildren <Animator>();
        }
예제 #4
0
        private void Awake()
        {
            isPinchingHash = Animator.StringToHash("IsPinching");
            pinchAmtHash   = Animator.StringToHash("PinchAmt");
            isGrabbedHash  = Animator.StringToHash("IsGrabbed");

            if (!controllerHand)
            {
                controllerHand = GetComponent <SkeletalControllerHand>();
            }
            steamVRPose      = wrist.GetComponentInParent <SteamVR_Behaviour_Pose>();
            skeletonBehavior = steamVRPose.GetComponentInChildren <MaskedSteamVRSkeleton>();

            animator = steamVRPose.GetComponentInChildren <Animator>();
        }
예제 #5
0
        private void Awake()
        {
            interactionManager = Leap.Unity.Interaction.InteractionManager.instance;

            if (interactionManager)
            {
                foreach (InteractionController controller in interactionManager.interactionControllers)
                {
                    if (controller is InteractionHand)
                    {
                        InteractionHand hand = (InteractionHand)controller;

                        if (hand.isLeft)
                        {
                            leftInteractionHand = hand;
                        }
                        else
                        {
                            rightInteractionHand = hand;
                        }

                        hand.leapProvider = defaultProvider;
                    }
                    else if (controller is SteamVRInteractionController)
                    {
                        SteamVRInteractionController interactionController = (SteamVRInteractionController)controller;

                        if (interactionController.isLeft)
                        {
                            leftInteractionController = interactionController;
                        }
                        else
                        {
                            rightInteractionController = interactionController;
                        }
                    }
                }
            }

            SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true);
            leftSkeletalControllerHand  = hands.First(item => item.IsLeft);
            rightSkeletalControllerHand = hands.First(item => !item.IsLeft);
        }
        /*private bool _graspButtonDown = false;
         * private bool _graspButtonUp = false;
         * private float _graspButtonDownSlopTimer = 0F;*/

        private void Awake()
        {
            SkeletalControllerHand[] controllerHands = FindObjectsOfType <SkeletalControllerHand>();

            foreach (SkeletalControllerHand controllerHand in controllerHands)
            {
                if (controllerHand.IsLeft == _isLeft)
                {
                    skeletalControllerHand = controllerHand;
                    break;
                }
            }

            steamVRRemapper = skeletalControllerHand.GetComponent <SteamVRRemapper>();
            _graspManipulatorPoints.Add(position);

            disableContactTimer = disableContactAfterGraspTime;
            _contactBones       = new ContactBone[] { };

            switcher = FindObjectOfType <ProviderSwitcher>();
        }
예제 #7
0
        private void Awake()
        {
            platformManager    = GetComponent <PlatformManager>();
            interactionManager = Leap.Unity.Interaction.InteractionManager.instance;
            if (interactionManager != null)
            {
                controllerManager = interactionManager.GetComponent <PlatformControllerManager>();
            }

            DataHand[] dataHands = modelManager.GetComponentsInChildren <DataHand>(true);

            leftAbstractHand  = (HandModelBase)dataHands.First(item => item is DataHand && item.Handedness == Chirality.Left);
            rightAbstractHand = (HandModelBase)dataHands.First(item => item is DataHand && item.Handedness == Chirality.Right);

            if (interactionManager)
            {
                foreach (InteractionController controller in interactionManager.interactionControllers)
                {
                    if (controller is InteractionHand)
                    {
                        InteractionHand hand = (InteractionHand)controller;

                        if (hand.isLeft)
                        {
                            leftInteractionHand = hand;
                        }
                        else
                        {
                            rightInteractionHand = hand;
                        }

                        hand.leapProvider = defaultProvider;
                    }
                }
            }

            SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true);
            leftSkeletalControllerHand  = hands.First(item => item.IsLeft);
            rightSkeletalControllerHand = hands.First(item => !item.IsLeft);
        }
예제 #8
0
        private void Awake()
        {
            SkeletalControllerHand[] controllerHands = FindObjectsOfType <SkeletalControllerHand>();

            foreach (SkeletalControllerHand controllerHand in controllerHands)
            {
                if (controllerHand.IsLeft == _isLeft)
                {
                    skeletalControllerHand = controllerHand;
                    break;
                }
            }

            steamVRRemapper = skeletalControllerHand.GetComponent <SteamVRRemapper>();
            _graspManipulatorPoints.Add(position);

            _contactBones = new ContactBone[] { };

            primaryHoverPoints.Add(skeletalControllerHand.IndexMetacarpal.GetChild(0).GetChild(0).GetChild(0));

            userRig = FindObjectOfType <UserRig>();
        }
예제 #9
0
        private void Awake()
        {
            userRig            = GetComponentInParent <UserRig>();
            platformManager    = GetComponent <PlatformManager>();
            interactionManager = Leap.Unity.Interaction.InteractionManager.instance;
            if (interactionManager != null)
            {
                controllerManager = interactionManager.GetComponent <PlatformControllerManager>();
            }

            if (interactionManager)
            {
                foreach (InteractionController controller in interactionManager.interactionControllers)
                {
                    if (controller is InteractionHand)
                    {
                        InteractionHand hand = (InteractionHand)controller;

                        if (hand.isLeft)
                        {
                            leftInteractionHand = hand;
                        }
                        else
                        {
                            rightInteractionHand = hand;
                        }

                        hand.leapProvider = defaultProvider;
                    }
                }
            }

            SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true);
            leftSkeletalControllerHand  = hands.First(item => item.IsLeft);
            rightSkeletalControllerHand = hands.First(item => !item.IsLeft);
        }
예제 #10
0
 protected virtual void Awake()
 {
     controllerHand = GetComponent <SkeletalControllerHand>();
     handAnimator   = GetComponent <Animator>();
 }
예제 #11
0
 private void OnEnable()
 {
     controllerHand = target as SkeletalControllerHand;
 }