MegaMan.Common.Geometry.RectangleF.IntersectsWith C# (CSharp) Method

IntersectsWith() public method

public IntersectsWith ( RectangleF rect ) : bool
rect RectangleF
return bool
        public bool IntersectsWith(RectangleF rect)
        {
            return rect.X < this.X + this.Width && this.X < rect.X + rect.Width && rect.Y < this.Y + this.Height && this.Y < rect.Y + rect.Height;
        }

Usage Example

Example #1
0
 private RectangleF CheckTargetBox(CollisionBox hitbox, RectangleF boundBox, IEntity entity, CollisionComponent coll, CollisionBox targetBox)
 {
     RectangleF rect = targetBox.BoxAt(coll.PositionSrc.Position);
     if (boundBox.IntersectsWith(rect))
     {
         coll.Touch(hitbox, targetBox);
         Touch(targetBox, hitbox);
         CollideWith(entity, hitbox, targetBox);
     }
     return boundBox;
 }
All Usage Examples Of MegaMan.Common.Geometry.RectangleF::IntersectsWith