コード例 #1
0
        public sealed override bool Overlaps(Collider collider, out CollisionResult result)
        {
            if (base.Overlaps(collider, out result))
            {
                if (collider is ShapeCollider)
                {
                    Manifold hit;
                    var      shape = (collider as ShapeCollider).Shape;

                    if (Shape.Overlaps(shape, out hit))
                    {
                        result.Add(hit);
                        return(true);
                    }
                }
                else if (collider is TileMapCollider)
                {
                    var tileMapCollider = collider as TileMapCollider;
                    return(tileMapCollider.Overlaps(this, out result));
                }
            }

            return(false);
        }
コード例 #2
0
ファイル: Collider.cs プロジェクト: SweetTini/FrogWorks
 public virtual bool Overlaps(Shape shape, out CollisionResult result)
 {
     result = new CollisionResult(this);
     return(shape != null && IsCollidable);
 }
コード例 #3
0
ファイル: Box.cs プロジェクト: SweetTini/FrogWorks
 public bool Overlaps(Shape shape, bool nearestAxis, out CollisionResult result)
 {
     result = default;
     return(false);
 }