Ctrl+K

EdgeShape

Declaration

public class tainicom.Aether.Physics2D.Collision.Shapes.EdgeShape

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.

Inherits: tainicom.Aether.Physics2D.Collision.Shapes.Shape

Constructors

EdgeShape

Create a new EdgeShape with the specified start and end.

void EdgeShape(Vector2 start, Vector2 end)

Parameters:

Name Type Description
start Strawberry.Math.Vector2 The start of the edge.
end Strawberry.Math.Vector2 The end of the edge.

Properties

ChildCount override

int ChildCount { get }

HasVertex0

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

bool HasVertex0 { get set }

HasVertex3

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

bool HasVertex3 { get set }

Vertex0

Optional adjacent vertices. These are used for smooth collision.

Vector2 Vertex0 { get set }

Vertex3

Optional adjacent vertices. These are used for smooth collision.

Vector2 Vertex3 { get set }

Vertex1

These are the edge vertices

Vector2 Vertex1 { get set }

Vertex2

These are the edge vertices

Vector2 Vertex2 { get set }

Methods

Set

Set this as an isolated edge.

void Set(Vector2 start, Vector2 end)

Parameters:

Name Type Description
start Strawberry.Math.Vector2 The start.
end Strawberry.Math.Vector2 The end.

TestPoint override

bool TestPoint(ref Transform transform, ref Vector2 point)

Parameters:

Name Type Description
transform ref tainicom.Aether.Physics2D.Common.Transform
point ref Strawberry.Math.Vector2

RayCast override

bool RayCast(out RayCastOutput output, ref RayCastInput input, ref Transform transform, int childIndex)

Parameters:

Name Type Description
output out tainicom.Aether.Physics2D.Collision.RayCastOutput
input ref tainicom.Aether.Physics2D.Collision.RayCastInput
transform ref tainicom.Aether.Physics2D.Common.Transform
childIndex System.Int32

ComputeAABB override

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

Parameters:

Name Type Description
aabb out tainicom.Aether.Physics2D.Collision.AABB
transform ref tainicom.Aether.Physics2D.Common.Transform
childIndex System.Int32

ComputeProperties protected override

void ComputeProperties()

ComputeSubmergedArea override

float ComputeSubmergedArea(ref Vector2 normal, float offset, ref Transform xf, out Vector2 sc)

Parameters:

Name Type Description
normal ref Strawberry.Math.Vector2
offset System.Single
xf ref tainicom.Aether.Physics2D.Common.Transform
sc out Strawberry.Math.Vector2

CompareTo

bool CompareTo(EdgeShape shape)

Parameters:

Name Type Description
shape tainicom.Aether.Physics2D.Collision.Shapes.EdgeShape

Clone override

Shape Clone()