제 XNA 게임에서 2D 공간의 여러 Vector2 좌표를 기준으로 불규칙한 모양을 정의해야했습니다. 그 이유는 충돌 확인 (예 : Rectangle.Intersects()
) 때문이었습니다. 예를 들어일련의 Vector2 - XNA를 사용하여 모양 만들기
:
Vector2 point1 = new Vector(20,30);
Vector2 point2 = new Vector(60,30);
Vector2 point3 = new Vector(60,80);
Vector2 point4 = new Vector(40,90);
Vector2 point5 = new Vector(20,80);
이 point1
에서가는 경로가있는 형상을 만드는 것 - point1
의 뒤쪽으로>point5
->point2
->point3
->point4
합니다.
그러나 이것을 구현하기위한 적절한 해결책을 찾지 못했습니다. 도와주세요. 감사.