C# 클래스 WarTornLands.Infrastructure.CollisionManager

파일 보기 프로젝트 열기: floAr/WarTornLands

공개 메소드들

메소드 설명
Collide ( CircleCollisionShape s1, CircleCollisionShape s2 ) : bool
Collide ( CircleCollisionShape s1, CompoundCollisionShape s2 ) : bool
Collide ( CompoundCollisionShape s1, CompoundCollisionShape s2 ) : bool
Collide ( ICollisionShape s1, ICollisionShape s2 ) : bool
Collide ( RectangleCollisionShape s1, CircleCollisionShape s2 ) : bool
Collide ( RectangleCollisionShape s1, CompoundCollisionShape s2 ) : bool
Collide ( RectangleCollisionShape s1, RectangleCollisionShape s2 ) : bool
IsAccessible ( Rectangle rect, bool testTiles, Entity source = null ) : bool

Check whether a rectangle is accessible or not.

OffsetRectangle ( Rectangle rect, Vector2 offset ) : Rectangle

Offset a rectangle by a given vector using the ceiling of the absolute vector values. The original rectangle is not modified, since the rect is passed by value.

TryMove ( Entity source, Vector2 moveVector, bool slide = true ) : Vector2

Tries to move an entity by a given move vector. Calls Entity.Collide functions of both the source and the entities it collides with along the way. The resulting move vector needs to be applied manually by the calling function!

비공개 메소드들

메소드 설명
CollisionManager ( ) : System

메소드 상세

Collide() 공개 정적인 메소드

public static Collide ( CircleCollisionShape s1, CircleCollisionShape s2 ) : bool
s1 WarTornLands.Entities.Modules.Collide.CollisionShape.CircleCollisionShape
s2 WarTornLands.Entities.Modules.Collide.CollisionShape.CircleCollisionShape
리턴 bool

Collide() 공개 정적인 메소드

public static Collide ( CircleCollisionShape s1, CompoundCollisionShape s2 ) : bool
s1 WarTornLands.Entities.Modules.Collide.CollisionShape.CircleCollisionShape
s2 WarTornLands.Entities.Modules.Collide.CollisionShape.CompoundCollisionShape
리턴 bool

Collide() 공개 정적인 메소드

public static Collide ( CompoundCollisionShape s1, CompoundCollisionShape s2 ) : bool
s1 WarTornLands.Entities.Modules.Collide.CollisionShape.CompoundCollisionShape
s2 WarTornLands.Entities.Modules.Collide.CollisionShape.CompoundCollisionShape
리턴 bool

Collide() 공개 정적인 메소드

public static Collide ( ICollisionShape s1, ICollisionShape s2 ) : bool
s1 ICollisionShape
s2 ICollisionShape
리턴 bool

Collide() 공개 정적인 메소드

public static Collide ( RectangleCollisionShape s1, CircleCollisionShape s2 ) : bool
s1 WarTornLands.Entities.Modules.Collide.CollisionShape.RectangleCollisionShape
s2 WarTornLands.Entities.Modules.Collide.CollisionShape.CircleCollisionShape
리턴 bool

Collide() 공개 정적인 메소드

public static Collide ( RectangleCollisionShape s1, CompoundCollisionShape s2 ) : bool
s1 WarTornLands.Entities.Modules.Collide.CollisionShape.RectangleCollisionShape
s2 WarTornLands.Entities.Modules.Collide.CollisionShape.CompoundCollisionShape
리턴 bool

Collide() 공개 정적인 메소드

public static Collide ( RectangleCollisionShape s1, RectangleCollisionShape s2 ) : bool
s1 WarTornLands.Entities.Modules.Collide.CollisionShape.RectangleCollisionShape
s2 WarTornLands.Entities.Modules.Collide.CollisionShape.RectangleCollisionShape
리턴 bool

IsAccessible() 공개 메소드

Check whether a rectangle is accessible or not.
public IsAccessible ( Rectangle rect, bool testTiles, Entity source = null ) : bool
rect Microsoft.Xna.Framework.Rectangle Rectangle to be tested.
testTiles bool Whether tile collision should be tested.
source Entity Entity that's colliding, e.g. if some thing's collide only with the player.
리턴 bool

OffsetRectangle() 공개 메소드

Offset a rectangle by a given vector using the ceiling of the absolute vector values. The original rectangle is not modified, since the rect is passed by value.
public OffsetRectangle ( Rectangle rect, Vector2 offset ) : Rectangle
rect Microsoft.Xna.Framework.Rectangle Rectangle to be modified.
offset Vector2 Offset vector, absolute value rounded up.
리턴 Microsoft.Xna.Framework.Rectangle

TryMove() 공개 메소드

Tries to move an entity by a given move vector. Calls Entity.Collide functions of both the source and the entities it collides with along the way. The resulting move vector needs to be applied manually by the calling function!
public TryMove ( Entity source, Vector2 moveVector, bool slide = true ) : Vector2
source Entity Entity that is to be moved.
moveVector Vector2 Vector by which the entity is to be moved.
slide bool
리턴 Vector2