C# Class Sharpex2D.Math.Polygon

Datei anzeigen Open project: ThuCommix/Sharpex2D Class Usage Examples

Public Methods

Method Description
FromEllipse ( Ellipse ellipse ) : Polygon

Creates a new Polygon from ellipse.

FromRectangle ( Rectangle rectangle ) : Polygon

Creates a new Polygon from rectangle.

Intersects ( Polygon other ) : bool

Checks if this Polygon intersects with another Polygon.

Intersects ( Polygon other, Vector2 &minimumTranslationVector ) : bool

Checks if this Polygon intersects with another Polygon.

Polygon ( ) : System

Initializes a new Polygon class.

Polygon ( IEnumerable points ) : System

Initializes a new Polygon class.

Private Methods

Method Description
HasSeparatingAxisTo ( Polygon other, float &minOverlap, Vector2 &axis ) : bool

A value indicating whether the Polygon has a seperating axis.

ProjectTo ( Vector2 axis, float &min, float &max ) : void

Projects an axis.

Method Details

FromEllipse() public static method

Creates a new Polygon from ellipse.
public static FromEllipse ( Ellipse ellipse ) : Polygon
ellipse Ellipse The Ellipse.
return Polygon

FromRectangle() public static method

Creates a new Polygon from rectangle.
public static FromRectangle ( Rectangle rectangle ) : Polygon
rectangle Rectangle The Rectangle.
return Polygon

Intersects() public method

Checks if this Polygon intersects with another Polygon.
public Intersects ( Polygon other ) : bool
other Polygon The other Polygon.
return bool

Intersects() public method

Checks if this Polygon intersects with another Polygon.
public Intersects ( Polygon other, Vector2 &minimumTranslationVector ) : bool
other Polygon The other Polygon.
minimumTranslationVector Vector2 /// Returns a vector with which the Polygon has to be translated at minimum to not /// collide with the second Polygon. ///
return bool

Polygon() public method

Initializes a new Polygon class.
public Polygon ( ) : System
return System

Polygon() public method

Initializes a new Polygon class.
public Polygon ( IEnumerable points ) : System
points IEnumerable The Points.
return System