//Check to see if two Rotated Rectangles have collided
        public bool Intersects(RotatedRectangle theRectangle)
        {
            //calculate the axis we will us to check collisions on
            //make 4, one for each side
            List<Vector2> rectangleAxis = new List<Vector2>();
            rectangleAxis.Add(UpperRightCorner() - UpperLeftCorner());
            rectangleAxis.Add(UpperRightCorner() - LowerRightCorner());
            rectangleAxis.Add(theRectangle.UpperLeftCorner() - theRectangle.LowerLeftCorner());
            rectangleAxis.Add(theRectangle.UpperLeftCorner() - theRectangle.UpperRightCorner());

            //loop through each axis, if one of them does not collide then there is no collision
            foreach (Vector2 axis in rectangleAxis)
            {
                if (!IsAxisCollision(theRectangle, axis))
                {
                    return false;
                }
            }

            return true;
        }
        //Check to see if two Rotated Rectangles have collided
        public bool Intersects(RotatedRectangle theRectangle)
        {
            //calculate the axis we will us to check collisions on
            //make 4, one for each side
            List <Vector2> rectangleAxis = new List <Vector2>();

            rectangleAxis.Add(UpperRightCorner() - UpperLeftCorner());
            rectangleAxis.Add(UpperRightCorner() - LowerRightCorner());
            rectangleAxis.Add(theRectangle.UpperLeftCorner() - theRectangle.LowerLeftCorner());
            rectangleAxis.Add(theRectangle.UpperLeftCorner() - theRectangle.UpperRightCorner());

            //loop through each axis, if one of them does not collide then there is no collision
            foreach (Vector2 axis in rectangleAxis)
            {
                if (!IsAxisCollision(theRectangle, axis))
                {
                    return(false);
                }
            }

            return(true);
        }
        //Determines if a collision has occurred on an Axis of one of the planes parallel to the Rectangle
        private bool IsAxisCollision(RotatedRectangle theRectangle, Vector2 axis)
        {
            //Project the corners of the Rectangle we are checking on to the Axis and
            //get a scalar value of that project we can then use for comparison
            List <int> rectangleAScalars = new List <int>();

            rectangleAScalars.Add(GenerateScalar(theRectangle.UpperLeftCorner(), axis));
            rectangleAScalars.Add(GenerateScalar(theRectangle.UpperRightCorner(), axis));
            rectangleAScalars.Add(GenerateScalar(theRectangle.LowerLeftCorner(), axis));
            rectangleAScalars.Add(GenerateScalar(theRectangle.LowerRightCorner(), axis));

            //Project the corners of the current Rectangle on to the Axis and
            //get a scalar value of that projection we can then use for comparison
            List <int> rectangleBScalars = new List <int>();

            rectangleBScalars.Add(GenerateScalar(UpperLeftCorner(), axis));
            rectangleBScalars.Add(GenerateScalar(UpperRightCorner(), axis));
            rectangleBScalars.Add(GenerateScalar(LowerLeftCorner(), axis));
            rectangleBScalars.Add(GenerateScalar(LowerRightCorner(), axis));

            //Get the Maximum and Minium Scalar values for each of the Rectangles
            int rectangleAMinimum = rectangleAScalars.Min();
            int rectangleAMaximum = rectangleAScalars.Max();
            int rectangleBMinimum = rectangleBScalars.Min();
            int rectangleBMaximum = rectangleBScalars.Max();

            //If we have overlaps between the Rectangles, then there is a collision between the rectangles on this Axis
            if (rectangleBMinimum <= rectangleAMaximum && rectangleBMaximum >= rectangleAMaximum)
            {
                return(true);
            }
            else if (rectangleAMinimum <= rectangleBMaximum && rectangleAMaximum >= rectangleBMaximum)
            {
                return(true);
            }

            return(false);
        }
        //Determines if a collision has occurred on an Axis of one of the planes parallel to the Rectangle
        private bool IsAxisCollision(RotatedRectangle theRectangle, Vector2 axis)
        {
            //Project the corners of the Rectangle we are checking on to the Axis and
            //get a scalar value of that project we can then use for comparison
            List<int> rectangleAScalars = new List<int>();
            rectangleAScalars.Add(GenerateScalar(theRectangle.UpperLeftCorner(), axis));
            rectangleAScalars.Add(GenerateScalar(theRectangle.UpperRightCorner(), axis));
            rectangleAScalars.Add(GenerateScalar(theRectangle.LowerLeftCorner(), axis));
            rectangleAScalars.Add(GenerateScalar(theRectangle.LowerRightCorner(), axis));

            //Project the corners of the current Rectangle on to the Axis and
            //get a scalar value of that projection we can then use for comparison
            List<int> rectangleBScalars = new List<int>();
            rectangleBScalars.Add(GenerateScalar(UpperLeftCorner(), axis));
            rectangleBScalars.Add(GenerateScalar(UpperRightCorner(), axis));
            rectangleBScalars.Add(GenerateScalar(LowerLeftCorner(), axis));
            rectangleBScalars.Add(GenerateScalar(LowerRightCorner(), axis));

            //Get the Maximum and Minium Scalar values for each of the Rectangles
            int rectangleAMinimum = rectangleAScalars.Min();
            int rectangleAMaximum = rectangleAScalars.Max();
            int rectangleBMinimum = rectangleBScalars.Min();
            int rectangleBMaximum = rectangleBScalars.Max();

            //If we have overlaps between the Rectangles, then there is a collision between the rectangles on this Axis
            if (rectangleBMinimum <= rectangleAMaximum && rectangleBMaximum >= rectangleAMaximum)
            {
                return true;
            }
            else if (rectangleAMinimum <= rectangleBMaximum && rectangleAMaximum >= rectangleBMaximum)
            {
                return true;
            }

            return false;
        }