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
Fields
_vertex1
Edge start vertex
internal Vector2 _vertex1
Field Value
_vertex2
Edge end vertex
internal Vector2 _vertex2
Field Value
Properties
ChildCount
Gets the value of the child count
public override int ChildCount { get; }
Property Value
HasVertex0
Is true if the edge is connected to an adjacent vertex before vertex 1.
public bool HasVertex0 { get; set; }
Property Value
HasVertex3
Is true if the edge is connected to an adjacent vertex after vertex2.
public bool HasVertex3 { get; set; }
Property Value
Vertex0
Optional adjacent vertices. These are used for smooth collision.
public Vector2 Vertex0 { get; set; }
Property Value
Vertex1
These are the edge vertices
public Vector2 Vertex1 { get; set; }
Property Value
Vertex2
These are the edge vertices
public Vector2 Vertex2 { get; set; }
Property Value
Vertex3
Optional adjacent vertices. These are used for smooth collision.
public Vector2 Vertex3 { get; set; }
Property Value
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
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 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
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