C# 클래스 Nez.PhysicsShapes.Box

special case of a Polygon. When doing SAT collision checks we only need to check 2 axes instead of 8
상속: Polygon
파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
height float
width float

공개 메소드들

메소드 설명
Box ( float width, float height ) : Microsoft.Xna.Framework
collidesWithShape ( Shape other, CollisionResult &result ) : bool
containsPoint ( Vector2 point ) : bool
overlaps ( Shape other ) : bool
pointCollidesWithShape ( Vector2 point, CollisionResult &result ) : bool
updateBox ( float width, float height ) : void

updates the Box points, recalculates the center and sets the width/height

비공개 메소드들

메소드 설명
buildBox ( float width, float height ) : Vector2[]

helper that builds the points a Polygon needs in the shape of a box

메소드 상세

Box() 공개 메소드

public Box ( float width, float height ) : Microsoft.Xna.Framework
width float
height float
리턴 Microsoft.Xna.Framework

collidesWithShape() 공개 메소드

public collidesWithShape ( Shape other, CollisionResult &result ) : bool
other Shape
result CollisionResult
리턴 bool

containsPoint() 공개 메소드

public containsPoint ( Vector2 point ) : bool
point Vector2
리턴 bool

overlaps() 공개 메소드

public overlaps ( Shape other ) : bool
other Shape
리턴 bool

pointCollidesWithShape() 공개 메소드

public pointCollidesWithShape ( Vector2 point, CollisionResult &result ) : bool
point Vector2
result CollisionResult
리턴 bool

updateBox() 공개 메소드

updates the Box points, recalculates the center and sets the width/height
public updateBox ( float width, float height ) : void
width float Width.
height float Height.
리턴 void

프로퍼티 상세

height 공개적으로 프로퍼티

public float height
리턴 float

width 공개적으로 프로퍼티

public float width
리턴 float