IntersectsWith() публичный Метод

public IntersectsWith ( RectangleF rect ) : bool
rect RectangleF
Результат bool
Пример #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;
 }
Пример #2
0
 private void CheckEnvironmentTile(List<MapSquare> hitSquares, CollisionBox hitbox, RectangleF hitRect, MapSquare tile, ref PointF offset)
 {
     if (hitbox.EnvironmentCollisions(PositionSrc.Position, tile, ref offset))
     {
         hitSquares.Add(tile);
         if (hitbox.PushAway) PositionSrc.Offset(offset.X, offset.Y);
     }
     else if (hitRect.IntersectsWith(tile.BoundBox))
     {
         hitSquares.Add(tile);
     }
 }