Interface IPolygonColliderShape2D
Interface for a Polygon Shape of 2D physics.
Inherited Members
Namespace: Evergine.Common.Physics2D
Assembly: Evergine.Common.dll
Syntax
public interface IPolygonColliderShape2D : IColliderShape2D
Properties
Data
Gets the data.
Declaration
List<List<Vector2>> Data { get; }
Property Value
Type | Description |
---|---|
List<List<Vector2>> |
Normals
Gets the polygon normals.
Declaration
Vector2[] Normals { get; }
Property Value
Type | Description |
---|---|
Vector2[] |
Vertices
Gets the polygon shapes.
Declaration
Vector2[] Vertices { get; }
Property Value
Type | Description |
---|---|
Vector2[] |
Methods
SetShapeFromData(Vector2[], List<List<Vector2>>, float, float, Vector2, Vector2, float)
Shape generated from the implementation data.
Declaration
void SetShapeFromData(Vector2[] vertices, List<List<Vector2>> data, float width, float height, Vector2 scale, Vector2 center, float angle)
Parameters
Type | Name | Description |
---|---|---|
Vector2[] | vertices | The polygon vertices. |
List<List<Vector2>> | data | The internal data. |
float | width | The width. |
float | height | The height. |
Vector2 | scale | The scale of the shape. |
Vector2 | center | The box center. |
float | angle | The box angle. |
SetShapeFromTexture(Texture, RectangleF, float, bool, Vector2, Vector2, float)
Build the polygon shape from a texture.
Declaration
void SetShapeFromTexture(Texture texture, RectangleF rectangle, float alphaThreshold, bool holeDetection, Vector2 scale, Vector2 center, float angle)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture | The texture. |
RectangleF | rectangle | The source rectangle. |
float | alphaThreshold | The alpha threshold. |
bool | holeDetection | Hole detection in the image. |
Vector2 | scale | The scale of the shape. |
Vector2 | center | The box center. |
float | angle | The box angle. |
SetShapeFromVertices(Vector2[])
Copy vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.
Declaration
void SetShapeFromVertices(Vector2[] vertices)
Parameters
Type | Name | Description |
---|---|---|
Vector2[] | vertices | The polygon vertices. |
SetShapeFromVertices(Vector2[], float, float, Vector2, Vector2, float)
Copy vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.
Declaration
void SetShapeFromVertices(Vector2[] vertices, float width, float height, Vector2 scale, Vector2 center, float angle)
Parameters
Type | Name | Description |
---|---|---|
Vector2[] | vertices | The polygon vertices. |
float | width | The width. |
float | height | The height. |
Vector2 | scale | The scale of the shape. |
Vector2 | center | The box center. |
float | angle | The box angle. |