C# Class Buoyancy.BuoyancyBehavior

Inheritance: Behavior
Afficher le fichier Open project: WaveEngine/Samples Class Usage Examples

Méthodes publiques

Свойство Type Description
fixturePairs ICollider2D>>.List

Private Properties

Свойство Type Description
GetIntersect Vector2?
IsClockwise bool
IsInside bool
IsLeftOf bool?
IsNearZero bool
IterateEdgesClockwise IEnumerable
Simulate2D_BeginCollision void
Simulate2D_EndCollision void
b2Cross Vector2

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
DefaultValues ( ) : void

Default values

Initialize ( ) : void

Initialize method

Update ( TimeSpan gameTime ) : void

Update method

Private Methods

Méthode Description
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

Method Details

ComputeCentroid() public static méthode

Compute polygon centroid
public static ComputeCentroid ( System.Vector2 vs, float &area ) : System.Vector2
vs System.Vector2 polygon vertex
area float polygon area
Résultat System.Vector2

DefaultValues() protected méthode

Default values
protected DefaultValues ( ) : void
Résultat void

GetIntersectedPolygon() public static méthode

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
Résultat System.Vector2[]

GetPolygonPoints() public static méthode

Get Polygon points of a physic collider
public static GetPolygonPoints ( ICollider2D collider ) : System.Vector2[]
collider ICollider2D physic collider
Résultat System.Vector2[]

Initialize() protected méthode

Initialize method
protected Initialize ( ) : void
Résultat void

Update() protected méthode

Update method
protected Update ( TimeSpan gameTime ) : void
gameTime TimeSpan game time
Résultat void

Property Details

fixturePairs public_oe property

public List> fixturePairs
Résultat ICollider2D>>.List