コード例 #1
0
        protected static void Init()
        {
            QuickWebXRHandlersManager wxrHandlersManager = QuickSingletonManager.GetInstance <QuickWebXRHandlersManager>();
            QuickVRPlayArea           vrPlayArea         = QuickSingletonManager.GetInstance <QuickVRPlayArea>();

            wxrHandlersManager.transform.parent = vrPlayArea.transform;
            wxrHandlersManager.transform.ResetTransformation();
        }
コード例 #2
0
        protected override void Awake()
        {
            base.Awake();

            _vrPlayArea = QuickSingletonManager.GetInstance <QuickVRPlayArea>();
            _vrPlayArea.transform.parent = transform;

            CreateVRCursors();
            CreateFootPrints();
        }
        protected virtual void Start()
        {
            QuickVRPlayArea vrPlayArea = QuickSingletonManager.GetInstance <QuickVRPlayArea>();

            _leftHand = Instantiate(Resources.Load <QuickOVRHand>("Prefabs/pf_QuickOVRHandLeft"), vrPlayArea.GetVRNode(HumanBodyBones.LeftHand).transform);
            _leftHand.transform.ResetTransformation();

            _rightHand = Instantiate(Resources.Load <QuickOVRHand>("Prefabs/pf_QuickOVRHandRight"), vrPlayArea.GetVRNode(HumanBodyBones.RightHand).transform);
            _rightHand.transform.ResetTransformation();
        }
コード例 #4
0
        protected virtual void Start()
        {
            _skeleton = transform.GetOrCreateComponent <OVRSkeleton>();
            transform.GetOrCreateComponent <OVRMesh>();
            transform.GetOrCreateComponent <OVRMeshRenderer>();
            _renderer = transform.GetOrCreateComponent <SkinnedMeshRenderer>();
            //_renderer.material = Resources.Load<Material>("Materials/QuickDiffuseCyan");
            _renderer.material = Resources.Load <Material>("Materials/QuickOVRHandMaterial");
            _playArea          = GetComponentInParent <QuickVRPlayArea>();

            _vrNodeHand  = _playArea.GetVRNode(IsLeft() ? HumanBodyBones.LeftHand : HumanBodyBones.RightHand);
            _ovrNodeHand = IsLeft() ? OVRPlugin.Node.HandLeft : OVRPlugin.Node.HandRight;
        }
コード例 #5
0
        protected virtual void Awake()
        {
            Reset();

            _vrPlayArea       = QuickSingletonManager.GetInstance <QuickVRPlayArea>();
            _cameraController = QuickSingletonManager.GetInstance <QuickVRCameraController>();
            _inputManager     = QuickSingletonManager.GetInstance <InputManager>();
            _fpsCounter       = QuickSingletonManager.GetInstance <PerformanceFPS>();

            _copyPose = gameObject.GetOrCreateComponent <QuickCopyPoseBase>();
            //_copyPose = gameObject.GetOrCreateComponent<QuickCopyPoseDirect>();
            _copyPose.enabled = false;

            //Legacy XR Mode is deprecated on 2020 onwards.
#if UNITY_2020_1_OR_NEWER
            _XRMode = XRMode.XRPlugin;
#endif
        }
コード例 #6
0
        protected virtual void OnEndMove(LocomotionSystem lSystem)
        {
            Animator animator = _vrManager.GetAnimatorTarget();
            Camera   cam      = QuickVRCameraController.GetCamera();

            if (animator && cam)
            {
                QuickVRPlayArea playArea = QuickSingletonManager.GetInstance <QuickVRPlayArea>();
                Transform       tmp      = playArea.transform.parent;
                playArea.transform.parent = null;

                Vector3 fwd       = animator.transform.forward;
                Vector3 rotAxis   = animator.transform.up;
                Vector3 targetFwd = Vector3.ProjectOnPlane(cam.transform.forward, rotAxis);

                animator.GetBoneTransform(HumanBodyBones.Head).Rotate(rotAxis, Vector3.SignedAngle(targetFwd, fwd, rotAxis), Space.World);
                animator.transform.forward = targetFwd;

                playArea.transform.parent = tmp;
            }
        }
コード例 #7
0
        protected override void Awake()
        {
            _vrPlayArea = QuickSingletonManager.GetInstance <QuickVRPlayArea>();

            base.Awake();
        }
コード例 #8
0
 protected virtual void Awake()
 {
     _vrPlayArea = QuickSingletonManager.GetInstance <QuickVRPlayArea>();
     Reset();
 }