示例#1
0
        public bool IntersectsRectangle(CollisionRectangle r, bool checkOther)
        {
            if (!mCollidable)
            {
                return(false);
            }

            if (PointInside(r.V1Transformed))
            {
                return(true);
            }
            if (PointInside(r.V2Transformed))
            {
                return(true);
            }
            if (PointInside(r.V3Transformed))
            {
                return(true);
            }
            if (PointInside(r.V4Transformed))
            {
                return(true);
            }

            if (checkOther)
            {
                return(r.IntersectsRectangle(this, false));
            }

            return(false);
        }
示例#2
0
 public CollisionRectangle(CollisionRectangle rectangle)
 {
     V1     = rectangle.V1;
     V2     = rectangle.V2;
     V3     = rectangle.V3;
     mScale = 1.0f;
     Translate(Matrix.Identity);
     mCollidable = rectangle.mCollidable;
 }