Interface IColliderShape2D
Interface for a Collider Shape of 2D physics.
Namespace: Evergine.Common.Physics2D
Assembly: Evergine.Common.dll
Syntax
public interface IColliderShape2D
Properties
ChildCount
Gets the number of child primitives.
Declaration
int ChildCount { get; }
Property Value
Type | Description |
---|---|
int |
InternalShape
Gets the internal shape.
Declaration
object InternalShape { get; }
Property Value
Type | Description |
---|---|
object |
Radius
Gets or sets.
Declaration
float Radius { get; set; }
Property Value
Type | Description |
---|---|
float |
Type
Gets the collider type.
Declaration
ColliderShapeType2D Type { get; }
Property Value
Type | Description |
---|---|
ColliderShapeType2D |
Methods
TestPoint(ref Vector2, ref Vector2, float)
Test a point for containment in this shape.
Declaration
bool TestPoint(ref Vector2 point, ref Vector2 shapePosition, float shapeAngle)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | point | a point in world coordinates. |
Vector2 | shapePosition | the shape world position. |
float | shapeAngle | the shape world angle. |
Returns
Type | Description |
---|---|
bool | True if the point is contained in the shape. |
TestRectangle(ref RectangleF, ref Vector2, float)
Test a rectangle for containment in this shape.
Declaration
bool TestRectangle(ref RectangleF rectangle, ref Vector2 shapePosition, float shapeAngle)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rectangle | a rectangle in world coordinates. |
Vector2 | shapePosition | the shape world position. |
float | shapeAngle | the shape world angle. |
Returns
Type | Description |
---|---|
bool | True if the point is contained in the shape. |
TestShape(Vector2, float, IColliderShape2D, Vector2, float)
Test another shape for containment in this shape.
Declaration
bool TestShape(Vector2 positionA, float angleA, IColliderShape2D shapeB, Vector2 positionB, float angleB)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | positionA | The position of A shape. |
float | angleA | The angle of A shape. |
IColliderShape2D | shapeB | The second shape. |
Vector2 | positionB | The position of B shape. |
float | angleB | The angle of B shape. |
Returns
Type | Description |
---|---|
bool | If the two shapes collides. |