Class PolygonShape
- Namespace
- Alis.Core.Physic.Collision.Shapes
- Assembly
- Alis.dll
Represents a simple non-selfintersecting convex polygon. Create a convex hull from the given array of points.
public class PolygonShape : Shape
Inheritance
Inherited Members
Constructors
PolygonShape(Vertices, float)
Initializes a new instance of the Alis.Core.Physic.Collision.Shapes.PolygonShape class.
public PolygonShape(Vertices vertices, float density)
Parameters
PolygonShape(float)
Create a new PolygonShape with the specified density.
public PolygonShape(float density)
Parameters
density
float-
The density.
PolygonShape()
Initializes a new instance of the Alis.Core.Physic.Collision.Shapes.PolygonShape class
internal PolygonShape()
Fields
_vertices
The vertices
private Vertices _vertices
Field Value
Properties
ChildCount
Gets the value of the child count
public override int ChildCount { get; }
Property Value
Normals
Gets or sets the value of the normals
public Vertices Normals { get; private set; }
Property Value
Vertices
Create a convex hull from the given array of local points. The number of vertices must be in the range [3, Settings.MaxPolygonVertices]. Warning: the points may be re-ordered, even if they form a convex polygon Warning: collinear points are handled but not removed. Collinear points may lead to poor stacking behavior.
public Vertices Vertices { get; set; }
Property Value
Methods
Clone()
Clones this instance
public override Shape Clone()
Returns
- Shape
-
The clone
CompareTo(PolygonShape)
Describes whether this instance compare to
public bool CompareTo(PolygonShape shape)
Parameters
shape
PolygonShape-
The shape
Returns
- bool
-
The bool
ComputeAABB(out AABB, ref Transform, int)
Given a transform, compute the associated axis aligned bounding box for a child shape.
public override void ComputeAABB(out AABB aabb, ref Transform transform, int childIndex)
Parameters
aabb
AABB-
The aabb results.
transform
Transform-
The world transform of the shape.
childIndex
int-
The child shape index.
ComputeProperties()
Computes the properties
protected override void ComputeProperties()
ComputeSubmergedArea(ref Vector2, float, ref Transform, out Vector2)
Computes the submerged area using the specified normal
public override float ComputeSubmergedArea(ref Vector2 normal, float offset, ref Transform xf, out Vector2 sc)
Parameters
Returns
- float
-
The area
RayCast(out RayCastOutput, ref RayCastInput, ref Transform, int)
Describes whether this instance ray cast
public override bool RayCast(out RayCastOutput output, ref RayCastInput input, ref Transform transform, int childIndex)
Parameters
output
RayCastOutput-
The output
input
RayCastInput-
The input
transform
Transform-
The transform
childIndex
int-
The child index
Returns
- bool
-
The bool
TestPoint(ref Transform, ref Vector2)
Describes whether this instance test point
public override bool TestPoint(ref Transform transform, ref Vector2 point)
Parameters
Returns
- bool
-
The bool