예제 #1
0
        /// <summary>
        /// Transform a point from one rectangle onto another using this class's warp matrix.
        /// </summary>
        /// <param name="srcX">Source point, X coordinate.</param>
        /// <param name="srcY">Source point, Y coordinate.</param>
        /// <param name="dstX">Destination point, X coordinate.</param>
        /// <param name="dstY">Destination point, Y coordinate.</param>
        public void warp(float srcX, float srcY, ref float dstX, ref float dstY)
        {
            // If our matrix is out of date, recompute it.
            if (dirty)
            {
                computeWarp();
            }

            // Compute the coordinate transform.
            Warper.warp(warpMat, srcX, srcY, ref dstX, ref dstY);
        }
예제 #2
0
        /// <summary>
        /// Construct a new wiimote provider.
        /// </summary>
        public WiiProvider()
        {
            // Create a new classifer.
            this.InputClassifier = new SpatioTemporalClassifier();
            this.InputClassifier.DefaultSmoothSize = 4;

            // Bind events.
            this.InputClassifier.OnStart  += new SpatioTemporalClassifier.TrackerEventHandler(handleInputClassifier_OnStart);
            this.InputClassifier.OnUpdate += new SpatioTemporalClassifier.TrackerEventHandler(handleInputClassifier_OnUpdate);
            this.InputClassifier.OnEnd    += new SpatioTemporalClassifier.TrackerEventHandler(handleInputClassifier_OnEnd);

            // Set default source and destination rectangles.
            this.pWarper = new Warper();
            this.setCalibrationData(new CalibrationRectangle(), new CalibrationRectangle(), new Vector(1.0, 1.0));

            // Enable the calibration.
            this.TransformResults = true;
        }
예제 #3
0
        /// <summary>
        /// Construct a new wiimote provider.
        /// </summary>
        public WiiProvider()
        {
            // Create a new classifer.
            this.InputClassifier = new SpatioTemporalClassifier();
            this.InputClassifier.DefaultSmoothSize = 4;

            // Bind events.
            this.InputClassifier.OnStart += new SpatioTemporalClassifier.TrackerEventHandler(handleInputClassifier_OnStart);
            this.InputClassifier.OnUpdate += new SpatioTemporalClassifier.TrackerEventHandler(handleInputClassifier_OnUpdate);
            this.InputClassifier.OnEnd += new SpatioTemporalClassifier.TrackerEventHandler(handleInputClassifier_OnEnd);

            // Set default source and destination rectangles.
            this.pWarper = new Warper();
            this.setCalibrationData(new CalibrationRectangle(), new CalibrationRectangle(), new Vector(1.0, 1.0));

            // Enable the calibration.
            this.TransformResults = true;

            this.settingsControl = new WiiProviderSettings(this);
        }