Table of Contents

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

vertices Vertices

The vertices.

density float

The density.

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

Vertices

Properties

ChildCount

Gets the value of the child count

public override int ChildCount { get; }

Property Value

int

Normals

Gets or sets the value of the normals

public Vertices Normals { get; private set; }

Property Value

Vertices

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

Vertices

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

normal Vector2

The normal

offset float

The offset

xf Transform

The xf

sc Vector2

The sc

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

transform Transform

The transform

point Vector2

The point

Returns

bool

The bool