コード例 #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="priority"></param>
        /// <param name="profile"></param>
        public WindowsMixedRealityDataProvider(string name, uint priority, WindowsMixedRealityControllerDataProviderProfile profile)
            : base(name, priority, profile)
        {
#if UNITY_WSA
            this.profile                = profile;
            gestureRecognizer           = new GestureRecognizer();
            navigationGestureRecognizer = new GestureRecognizer();
#endif // UNITY_WSA
        }
        /// <inheritdoc />
        public WindowsMixedRealityControllerDataProvider(string name, uint priority,
                                                         WindowsMixedRealityControllerDataProviderProfile profile, IMixedRealityInputSystem parentService)
            : base(name, priority, profile, parentService)
        {
#if WINDOWS_UWP
            if (!MixedRealityToolkit.TryGetSystemProfile <IMixedRealityInputSystem, MixedRealityInputSystemProfile>(out var inputSystemProfile))
            {
                throw new ArgumentException($"Unable to get a valid {nameof(MixedRealityInputSystemProfile)}!");
            }

            var isGrippingThreshold = profile.GripThreshold != inputSystemProfile.GripThreshold
                ? profile.GripThreshold
                : inputSystemProfile.GripThreshold;

            postProcessor = new HandDataPostProcessor(TrackedPoses, isGrippingThreshold)
            {
                PlatformProvidesPointerPose = true
            };
        }