Inheritance: IGesture
        private void RegisterGestures()
        {
            bodyConverter = new BodyRelativePointConverter(uxPersonRectangle.GetBoundaryRect(), this._sharedData.PlayerOneController);

            setHitZone();
            if (hitGesture == null)
            {
                hitGesture = new HitGesture(_hitZones, bodyConverter, JointType.HandRight, JointType.HandLeft);
                hitGesture.RectHit += new EventHandler<RectHitEventArgs>(hitGesture_RectHit);
            }
            _sharedData.PlayerOneController.AddGesture(this, hitGesture);
            uxPlayerSkeleton.InitializeSkeleton(_sharedData.PlayerOneController, bodyConverter);
        }
Example #2
0
        private void RegisterGestures()
        {
            // TODO: Maybe clean up?
            playerOneConverter = new BodyRelativePointConverter(uxPlayerOneRect.GetBoundaryRect(), this._sharedData.PlayerOneController);
            playerTwoConverter = new BodyRelativePointConverter(uxPlayerTwoRect.GetBoundaryRect(), this._sharedData.PlayerTwoController);

            _playerOneHitGesture = new HitGesture(_hitZones, playerOneConverter, JointType.HandRight, JointType.HandLeft);
            _playerOneHitGesture.RectHit += new EventHandler<RectHitEventArgs>(hitGesture_RectHit);
            _sharedData.PlayerOneController.AddGesture(this, _playerOneHitGesture);

            _playerTwoHitGesture = new HitGesture(_hitZones, playerTwoConverter, JointType.HandRight, JointType.HandLeft);
            _playerTwoHitGesture.RectHit += new EventHandler<RectHitEventArgs>(hitGesture_RectHit);
            _sharedData.PlayerTwoController.AddGesture(this, _playerTwoHitGesture);

            uxPlayerOneSkeleton.InitializeSkeleton(_sharedData.PlayerOneController, playerOneConverter);
            uxPlayerTwoSkeleton.InitializeSkeleton(_sharedData.PlayerTwoController, playerTwoConverter);
        }