C# 클래스 Buoyancy.BuoyancyBehavior

상속: Behavior
파일 보기 프로젝트 열기: WaveEngine/Samples 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
fixturePairs ICollider2D>>.List

Private Properties

프로퍼티 타입 설명
GetIntersect Vector2?
IsClockwise bool
IsInside bool
IsLeftOf bool?
IsNearZero bool
IterateEdgesClockwise IEnumerable
Simulate2D_BeginCollision void
Simulate2D_EndCollision void
b2Cross Vector2

공개 메소드들

메소드 설명
ComputeCentroid ( System.Vector2 vs, float &area ) : System.Vector2

Compute polygon centroid

GetIntersectedPolygon ( System.Vector2 subjectPoly, System.Vector2 clipPoly ) : System.Vector2[]

This clips the subject polygon against the clip polygon (gets the intersection of the two polygons)

Based on the psuedocode from: http://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman

GetPolygonPoints ( ICollider2D collider ) : System.Vector2[]

Get Polygon points of a physic collider

보호된 메소드들

메소드 설명
DefaultValues ( ) : void

Default values

Initialize ( ) : void

Initialize method

Update ( TimeSpan gameTime ) : void

Update method

비공개 메소드들

메소드 설명
GetIntersect ( System.Vector2 line1From, System.Vector2 line1To, System.Vector2 line2From, System.Vector2 line2To ) : Vector2?

Returns the intersection of the two lines (line segments are passed in, but they are treated like infinite lines)

Got this here: http://stackoverflow.com/questions/14480124/how-do-i-detect-triangle-and-rectangle-intersection

IsClockwise ( System.Vector2 polygon ) : bool
IsInside ( System.Edge edge, System.Vector2 test ) : bool
IsLeftOf ( System.Edge edge, System.Vector2 test ) : bool?

Tells if the test Vector2 lies on the left side of the edge line

IsNearZero ( double testValue ) : bool
IterateEdgesClockwise ( System.Vector2 polygon ) : IEnumerable

This iterates through the edges of the polygon, always clockwise

Simulate2D_BeginCollision ( WaveEngine contact ) : void

Begin collision world event

Simulate2D_EndCollision ( WaveEngine contact ) : void

End collision world event

b2Cross ( float s, Vector2 &a ) : Vector2

메소드 상세

ComputeCentroid() 공개 정적인 메소드

Compute polygon centroid
public static ComputeCentroid ( System.Vector2 vs, float &area ) : System.Vector2
vs System.Vector2 polygon vertex
area float polygon area
리턴 System.Vector2

DefaultValues() 보호된 메소드

Default values
protected DefaultValues ( ) : void
리턴 void

GetIntersectedPolygon() 공개 정적인 메소드

This clips the subject polygon against the clip polygon (gets the intersection of the two polygons)
Based on the psuedocode from: http://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman
public static GetIntersectedPolygon ( System.Vector2 subjectPoly, System.Vector2 clipPoly ) : System.Vector2[]
subjectPoly System.Vector2 Can be concave or convex
clipPoly System.Vector2 Must be convex
리턴 System.Vector2[]

GetPolygonPoints() 공개 정적인 메소드

Get Polygon points of a physic collider
public static GetPolygonPoints ( ICollider2D collider ) : System.Vector2[]
collider ICollider2D physic collider
리턴 System.Vector2[]

Initialize() 보호된 메소드

Initialize method
protected Initialize ( ) : void
리턴 void

Update() 보호된 메소드

Update method
protected Update ( TimeSpan gameTime ) : void
gameTime TimeSpan game time
리턴 void

프로퍼티 상세

fixturePairs 공개적으로 프로퍼티

public List> fixturePairs
리턴 ICollider2D>>.List