Table of Contents

Class EdgeShape

Namespace
Alis.Core.Physic.Collision.Shapes
Assembly
Alis.dll

A line segment (edge) shape. These can be connected in chains or loops to other edge shapes. The connectivity information is used to ensure correct contact normals.

public class EdgeShape : Shape

Inheritance

Inherited Members

Constructors

EdgeShape()

Initializes a new instance of the Alis.Core.Physic.Collision.Shapes.EdgeShape class

internal EdgeShape()

EdgeShape(Vector2, Vector2)

Create a new EdgeShape with the specified start and end.

public EdgeShape(Vector2 start, Vector2 end)

Parameters

start Vector2

The start of the edge.

end Vector2

The end of the edge.

Fields

_vertex1

Edge start vertex

internal Vector2 _vertex1

Field Value

Vector2

_vertex2

Edge end vertex

internal Vector2 _vertex2

Field Value

Vector2

Properties

ChildCount

Gets the value of the child count

public override int ChildCount { get; }

Property Value

int

HasVertex0

Is true if the edge is connected to an adjacent vertex before vertex 1.

public bool HasVertex0 { get; set; }

Property Value

bool

HasVertex3

Is true if the edge is connected to an adjacent vertex after vertex2.

public bool HasVertex3 { get; set; }

Property Value

bool

Vertex0

Optional adjacent vertices. These are used for smooth collision.

public Vector2 Vertex0 { get; set; }

Property Value

Vector2

Vertex1

These are the edge vertices

public Vector2 Vertex1 { get; set; }

Property Value

Vector2

Vertex2

These are the edge vertices

public Vector2 Vertex2 { get; set; }

Property Value

Vector2

Vertex3

Optional adjacent vertices. These are used for smooth collision.

public Vector2 Vertex3 { get; set; }

Property Value

Vector2

Methods

Clone()

Clones this instance

public override Shape Clone()

Returns

Shape

The clone

CompareTo(EdgeShape)

Describes whether this instance compare to

public bool CompareTo(EdgeShape shape)

Parameters

shape EdgeShape

The shape

Returns

bool

The bool

ComputeAABB(out AABB, ref Transform, int)

Computes the aabb using the specified aabb

public override void ComputeAABB(out AABB aabb, ref Transform transform, int childIndex)

Parameters

aabb AABB

The aabb

transform Transform

The transform

childIndex int

The child 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 float

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

Set(Vector2, Vector2)

Set this as an isolated edge.

public void Set(Vector2 start, Vector2 end)

Parameters

start Vector2

The start.

end Vector2

The end.

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