polygonToPolygon() 공개 정적인 메소드

checks for a collision between two Polygons
public static polygonToPolygon ( Polygon first, Polygon second, CollisionResult &result ) : bool
first Polygon Polygon a.
second Polygon Polygon b.
result CollisionResult
리턴 bool
예제 #1
0
파일: Polygon.cs 프로젝트: fusspawn/Nez
        public override bool collidesWithShape(Shape other, out CollisionResult result)
        {
            if (other is Polygon)
            {
                return(ShapeCollisions.polygonToPolygon(this, other as Polygon, out result));
            }

            if (other is Circle && ShapeCollisions.circleToPolygon(other as Circle, this, out result))
            {
                result.invertResult();
                return(true);
            }

            throw new NotImplementedException(string.Format("overlaps of Polygon to {0} are not supported", other));
        }
예제 #2
0
파일: Polygon.cs 프로젝트: fusspawn/Nez
        public override bool overlaps(Shape other)
        {
            CollisionResult result;

            if (other is Polygon)
            {
                return(ShapeCollisions.polygonToPolygon(this, other as Polygon, out result));
            }

            if (other is Circle)
            {
                ShapeCollisions.circleToPolygon(other as Circle, this, out result);
            }

            throw new NotImplementedException(string.Format("overlaps of Polygon to {0} are not supported", other));
        }
예제 #3
0
파일: Polygon.cs 프로젝트: Pyxlre/Nez
        public override bool collidesWithShape(Shape other, out CollisionResult result)
        {
            if (other is Polygon)
            {
                return(ShapeCollisions.polygonToPolygon(this, other as Polygon, out result));
            }

            if (other is Circle && ShapeCollisions.circleToPolygon(other as Circle, this, out result))
            {
                // TODO: flip the result since the colliding objects are reversed
                throw new NotImplementedException("ShapeCollisionResult will probably be wrong due to the result needing to be flipped. TODO");
                //return true;
            }

            throw new NotImplementedException(string.Format("overlaps of Polygon to {0} are not supported", other));
        }