Пример #1
0
        public override List <Vector2> CollisionAxes(FBCollider shapeToCheckAgainst)
        {
            var nearestPointOnOtherShape = shapeToCheckAgainst.NearestPoint(Position);
            var direction = Position - nearestPointOnOtherShape;

            if (direction == Vector2.Zero) //Centers are the same.
            {
                direction = new Vector2(0, 1);
            }
            direction.Normalize();
            return(new List <Vector2>()
            {
                direction
            });
        }