示例#1
0
        /// <summary>
        /// Send a request to Kinect service to update smoothing parameters
        /// </summary>
        /// <param name="transformSmooth">A value indicating whether to apply transform smooth</param>
        /// <param name="smoothing">The amount of smoothing to be applied</param>
        /// <param name="correction">The amount of correction to be applied</param>
        /// <param name="prediction">The amount of prediction to be made</param>
        /// <param name="jitterRadius">The radius for jitter processing</param>
        /// <param name="maxDeviationRadius">Maximum deviation radius</param>
        internal void UpdateSkeletalSmoothing(
            bool transformSmooth,
            float smoothing,
            float correction,
            float prediction,
            float jitterRadius,
            float maxDeviationRadius)
        {
            mskinect.TransformSmoothParameters newSmoothParams = new mskinect.TransformSmoothParameters();
            newSmoothParams.Correction         = correction;
            newSmoothParams.JitterRadius       = jitterRadius;
            newSmoothParams.MaxDeviationRadius = maxDeviationRadius;
            newSmoothParams.Prediction         = prediction;
            newSmoothParams.Smoothing          = smoothing;

            kinectProxy.UpdateSkeletalSmoothingRequest request = new kinectProxy.UpdateSkeletalSmoothingRequest();
            request.TransfrormSmooth = transformSmooth;
            request.SkeletalEngineTransformSmoothParameters = newSmoothParams;

            Activate(
                Arbiter.Choice(
                    this.kinectPort.UpdateSkeletalSmoothing(request),
                    success =>
            {
                // nothing to do
            },
                    fault =>
            {
                // the fault handler is outside the WPF dispatcher
                // to perfom any UI related operation we need to go through the WPF adapter

                // show an error message
                this.wpfServicePort.Invoke(() => this.userInterface.ShowFault(fault));
            }));
        }
        /// <summary>
        /// Send a request to Kinect service to update smoothing parameters
        /// </summary>
        /// <param name="transformSmooth"></param>
        /// <param name="smoothing"></param>
        /// <param name="correction"></param>
        /// <param name="prediction"></param>
        /// <param name="jitterRadius"></param>
        /// <param name="maxDeviationRadius"></param>
        internal void UpdateSkeletalSmoothing(
            bool transformSmooth,
            float smoothing,
            float correction,
            float prediction,
            float jitterRadius,
            float maxDeviationRadius)
        {
            nui.TransformSmoothParameters newSmoothParams = new nui.TransformSmoothParameters();
            newSmoothParams.Correction = correction;
            newSmoothParams.JitterRadius = jitterRadius;
            newSmoothParams.MaxDeviationRadius = maxDeviationRadius;
            newSmoothParams.Prediction = prediction;
            newSmoothParams.Smoothing = smoothing;

            kinectProxy.UpdateSkeletalSmoothingRequest request = new kinectProxy.UpdateSkeletalSmoothingRequest();
            request.TransfrormSmooth = transformSmooth;
            request.SkeletalEngineTransformSmoothParameters = newSmoothParams;

            Activate(
                Arbiter.Choice(
                    this.kinectPort.UpdateSkeletalSmoothing(request),
                    success =>
                    {
                        // nothing to do
                    },
                    fault =>
                    {
                        // the fault handler is outside the WPF dispatcher
                        // to perfom any UI related operation we need to go through the WPF adapter

                        // show an error message
                        this.wpfServicePort.Invoke(() => this.userInterface.ShowFault(fault));
                    }));
        }