Beispiel #1
0
        public static QuickHumanFingers[] GetHumanFingers()
        {
            if (_fingers == null)
            {
                _fingers = QuickUtils.GetEnumValues <QuickHumanFingers>().ToArray();
            }

            return(_fingers);
        }
Beispiel #2
0
        public static HumanBodyBones[] GetHumanBodyBones()
        {
            if (_humanBodyBones == null)
            {
                List <HumanBodyBones> tmp = QuickUtils.GetEnumValues <HumanBodyBones>();
                tmp.RemoveAt(tmp.Count - 1);  //Remove the LastBone, which is not a valid HumanBodyBone ID
                _humanBodyBones = tmp.ToArray();
            }

            return(_humanBodyBones);
        }
Beispiel #3
0
        public static Dictionary <HumanBodyBones, Vector3> GetLocalPositions(this Animator animator)
        {
            List <HumanBodyBones> bones = QuickUtils.GetEnumValues <HumanBodyBones>();
            Dictionary <HumanBodyBones, Vector3> result = new Dictionary <HumanBodyBones, Vector3>();

            foreach (HumanBodyBones boneID in bones)
            {
                Transform b = animator.GetBoneTransform(boneID);
                result[boneID] = b ? b.localPosition : Vector3.zero;
            }
            return(result);
        }
Beispiel #4
0
        protected override void Awake()
        {
            foreach (U u in QuickUtils.GetEnumValues <U>())
            {
                _stringToAxis[u.ToString()] = u;
            }

            foreach (V v in QuickUtils.GetEnumValues <V>())
            {
                _stringToButton[v.ToString()] = v;
            }

            base.Awake();
        }
Beispiel #5
0
        private static void Init()
        {
            _allJoints = QuickUtils.ParseEnum <QuickHumanBodyBones, TrackedJointBody>();
            foreach (QuickHumanFingers f in QuickHumanTrait.GetHumanFingers())
            {
                _allJoints.AddRange(QuickHumanTrait.GetBonesFromFinger(f, true));
                _allJoints.AddRange(QuickHumanTrait.GetBonesFromFinger(f, false));
            }

            foreach (TrackedJointBody j in QuickUtils.GetEnumValues <TrackedJointBody>())
            {
                _toTrackedJointBody[QuickUtils.ParseEnum <QuickHumanBodyBones>(j.ToString())] = j;
            }
        }
Beispiel #6
0
        public override string[] GetButtonCodes()
        {
            string[]      sufix = { "Left", "Right" };
            List <string> codes = new List <string>();

            foreach (string s in sufix)
            {
                foreach (ButtonCodes b in QuickUtils.GetEnumValues <ButtonCodes>())
                {
                    codes.Add(b.ToString() + s);
                }
            }

            return(GetCodes(codes));
        }
Beispiel #7
0
        protected virtual void Awake()
        {
            Reset();
            CheckPrefabs();
            CheckEventSystem();

            _vrManager            = QuickSingletonManager.GetInstance <QuickVRManager>();
            _xrInteractionManager = QuickSingletonManager.GetInstance <XRInteractionManager>();

            _interactorHandLeft         = transform.CreateChild("__InteractorHandLeft__").GetOrCreateComponent <QuickVRInteractor>();
            _interactorHandLeft._xrNode = XRNode.LeftHand;

            _interactorHandRight         = transform.CreateChild("__InteractorHandRight__").GetOrCreateComponent <QuickVRInteractor>();
            _interactorHandRight._xrNode = XRNode.RightHand;

            //By default, disable all the locomotion providers
            foreach (DefaultLocomotionProvider lProvider in QuickUtils.GetEnumValues <DefaultLocomotionProvider>())
            {
                EnableLocomotionSystem(lProvider, false);
            }

            BaseTeleportationInteractable[] teleportationInteractables = FindObjectsOfType <BaseTeleportationInteractable>();
            foreach (BaseTeleportationInteractable t in teleportationInteractables)
            {
                t.teleportationProvider = _teleportProvider;
            }

            _grabInteractables = new List <XRGrabInteractable>(FindObjectsOfType <XRGrabInteractable>());
            foreach (XRGrabInteractable g in _grabInteractables)
            {
                if (!g.attachTransform)
                {
                    //Try to find the default attach transform
                    g.attachTransform = g.transform.Find(GRAB_PIVOT_NAME);
                }
            }
        }
Beispiel #8
0
 protected static void Init()
 {
     _typeList = QuickUtils.ParseEnum <QuickHumanBodyBones, Type>(QuickUtils.GetEnumValues <Type>());
 }