C# 클래스 Source.Collisions.Polygon

Polygon, not necessarily axis-aligned
상속: Body
파일 보기 프로젝트 열기: HarkerGameDev/TheGame 1 사용 예제들

공개 메소드들

메소드 설명
Intersects ( Polygon other ) : Vector2

Intersection detection function Mostly derived from http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection

Polygon ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Vector2 size, Vector2 points = null, float rotation = 0f ) : System
Raycast ( Vector2 rayStart, Vector2 rayDir ) : float

Gets the parametric T value for the ray on start in direction dir, 0 if nothing Based on http://ncase.me/sight-and-light/

Rotate ( float angle ) : void

보호된 메소드들

메소드 설명
RotatePoint ( Vector2 pivot, Vector2 point, float angle ) : Vector2

비공개 메소드들

메소드 설명
IntervalDistance ( float minA, float maxA, float minB, float maxB ) : float
ProjectRectangle ( Vector2 axis, Polygon body, float &min, float &max ) : void

메소드 상세

Intersects() 공개 메소드

Intersection detection function Mostly derived from http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection
public Intersects ( Polygon other ) : Vector2
other Polygon The other Body to check intersection with
리턴 Vector2

Polygon() 공개 메소드

public Polygon ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Vector2 size, Vector2 points = null, float rotation = 0f ) : System
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
size Vector2
points Vector2
rotation float
리턴 System

Raycast() 공개 메소드

Gets the parametric T value for the ray on start in direction dir, 0 if nothing Based on http://ncase.me/sight-and-light/
public Raycast ( Vector2 rayStart, Vector2 rayDir ) : float
rayStart Vector2
rayDir Vector2
리턴 float

Rotate() 공개 메소드

public Rotate ( float angle ) : void
angle float
리턴 void

RotatePoint() 보호된 메소드

protected RotatePoint ( Vector2 pivot, Vector2 point, float angle ) : Vector2
pivot Vector2
point Vector2
angle float
리턴 Vector2