C# 클래스 Source.Collisions.Body

A body, could be any polygon or circle
파일 보기 프로젝트 열기: HarkerGameDev/TheGame

공개 프로퍼티들

프로퍼티 타입 설명
Color Color
Velocity Vector2

보호된 프로퍼티들

프로퍼티 타입 설명
Points Vector2[]

공개 메소드들

메소드 설명
Body ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Vector2 size, float rotation = 0f ) : System
Draw ( SpriteBatch spriteBatch ) : void
Intersects ( Polygon other ) : Vector2

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

MoveByPosition ( Vector2 by ) : void
MoveToPosition ( Vector2 pos ) : void
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/

TestPoint ( Vector2 point ) : bool

Currently making a small rectangle and using Intersect to TestPoint

Update ( float deltaTime ) : void

메소드 상세

Body() 공개 메소드

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

Draw() 공개 메소드

public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
리턴 void

Intersects() 공개 추상적인 메소드

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

MoveByPosition() 공개 메소드

public MoveByPosition ( Vector2 by ) : void
by Vector2
리턴 void

MoveToPosition() 공개 메소드

public MoveToPosition ( Vector2 pos ) : void
pos Vector2
리턴 void

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 abstract Raycast ( Vector2 rayStart, Vector2 rayDir ) : float
rayStart Vector2
rayDir Vector2
리턴 float

TestPoint() 공개 메소드

Currently making a small rectangle and using Intersect to TestPoint
public TestPoint ( Vector2 point ) : bool
point Vector2
리턴 bool

Update() 공개 메소드

public Update ( float deltaTime ) : void
deltaTime float
리턴 void

프로퍼티 상세

Color 공개적으로 프로퍼티

public Color Color
리턴 Color

Points 보호되어 있는 프로퍼티

protected Vector2[] Points
리턴 Vector2[]

Velocity 공개적으로 프로퍼티

public Vector2 Velocity
리턴 Vector2