Class Collision
- Namespace
- Alis.Core.Physic.Collision
- Assembly
- Alis.dll
Collision methods
public static class Collision
Inheritance
Inherited Members
Methods
ClipSegmentToLine(out FixedArray2<ClipVertex>, ref FixedArray2<ClipVertex>, Vector2, float, int)
Clipping for contact manifolds.
private static int ClipSegmentToLine(out FixedArray2<ClipVertex> vOut, ref FixedArray2<ClipVertex> vIn, Vector2 normal, float offset, int vertexIndexA)
Parameters
vOut
FixedArray2<ClipVertex>-
The v out.
vIn
FixedArray2<ClipVertex>-
The v in.
normal
Vector2-
The normal.
offset
float-
The offset.
vertexIndexA
int-
The vertex index A.
Returns
CollideCircles(ref Manifold, CircleShape, ref Transform, CircleShape, ref Transform)
Compute the collision manifold between two circles.
public static void CollideCircles(ref Manifold manifold, CircleShape circleA, ref Transform xfA, CircleShape circleB, ref Transform xfB)
Parameters
manifold
ManifoldcircleA
CircleShapexfA
TransformcircleB
CircleShapexfB
Transform
CollideEdgeAndCircle(ref Manifold, EdgeShape, ref Transform, CircleShape, ref Transform)
Compute contact points for edge versus circle. This accounts for edge connectivity.
public static void CollideEdgeAndCircle(ref Manifold manifold, EdgeShape edgeA, ref Transform transformA, CircleShape circleB, ref Transform transformB)
Parameters
manifold
Manifold-
The manifold.
edgeA
EdgeShape-
The edge A.
transformA
Transform-
The transform A.
circleB
CircleShape-
The circle B.
transformB
Transform-
The transform B.
CollideEdgeAndPolygon(ref Manifold, EdgeShape, ref Transform, PolygonShape, ref Transform)
Collides and edge and a polygon, taking into account edge adjacency.
public static void CollideEdgeAndPolygon(ref Manifold manifold, EdgeShape edgeA, ref Transform xfA, PolygonShape polygonB, ref Transform xfB)
Parameters
manifold
Manifold-
The manifold.
edgeA
EdgeShape-
The edge A.
xfA
Transform-
The xf A.
polygonB
PolygonShape-
The polygon B.
xfB
Transform-
The xf B.
CollidePolygonAndCircle(ref Manifold, PolygonShape, ref Transform, CircleShape, ref Transform)
Compute the collision manifold between a polygon and a circle.
public static void CollidePolygonAndCircle(ref Manifold manifold, PolygonShape polygonA, ref Transform xfA, CircleShape circleB, ref Transform xfB)
Parameters
manifold
Manifold-
The manifold.
polygonA
PolygonShape-
The polygon A.
xfA
Transform-
The transform of A.
circleB
CircleShape-
The circle B.
xfB
Transform-
The transform of B.
CollidePolygons(ref Manifold, PolygonShape, ref Transform, PolygonShape, ref Transform)
Compute the collision manifold between two polygons.
public static void CollidePolygons(ref Manifold manifold, PolygonShape polyA, ref Transform transformA, PolygonShape polyB, ref Transform transformB)
Parameters
manifold
Manifold-
The manifold.
polyA
PolygonShape-
The poly A.
transformA
Transform-
The transform A.
polyB
PolygonShape-
The poly B.
transformB
Transform-
The transform B.
EdgeSeparation(PolygonShape, ref Transform, int, PolygonShape)
Find the separation between poly1 and poly2 for a give edge normal on poly1.
private static float EdgeSeparation(PolygonShape poly1, ref Transform xf1To2, int edge1, PolygonShape poly2)
Parameters
poly1
PolygonShape-
The poly1.
xf1To2
Transformedge1
int-
The edge1.
poly2
PolygonShape-
The poly2.
Returns
FindIncidentEdge(out FixedArray2<ClipVertex>, PolygonShape, ref Transform, int, PolygonShape, ref Transform)
Finds the incident edge using the specified c
private static void FindIncidentEdge(out FixedArray2<ClipVertex> c, PolygonShape poly1, ref Transform xf1, int edge1, PolygonShape poly2, ref Transform xf2)
Parameters
c
FixedArray2<ClipVertex>-
The
poly1
PolygonShape-
The poly
xf1
Transform-
The xf
edge1
int-
The edge
poly2
PolygonShape-
The poly
xf2
Transform-
The xf
FindMaxSeparation(out int, PolygonShape, ref Transform, PolygonShape, ref Transform)
Find the max separation between poly1 and poly2 using edge normals from poly1.
private static float FindMaxSeparation(out int edgeIndex, PolygonShape poly1, ref Transform xf1, PolygonShape poly2, ref Transform xf2)
Parameters
edgeIndex
int-
Index of the edge.
poly1
PolygonShape-
The poly1.
xf1
Transform-
The XF1.
poly2
PolygonShape-
The poly2.
xf2
Transform-
The XF2.
Returns
GetPointStates(out FixedArray2<PointState>, out FixedArray2<PointState>, ref Manifold, ref Manifold)
Gets the point states using the specified state 1
public static void GetPointStates(out FixedArray2<PointState> state1, out FixedArray2<PointState> state2, ref Manifold manifold1, ref Manifold manifold2)
Parameters
state1
FixedArray2<PointState>-
The state
state2
FixedArray2<PointState>-
The state
manifold1
Manifold-
The manifold
manifold2
Manifold-
The manifold
TestOverlap(Shape, int, Shape, int, ref Transform, ref Transform)
Test overlap between the two shapes.
public static bool TestOverlap(Shape shapeA, int indexA, Shape shapeB, int indexB, ref Transform xfA, ref Transform xfB)
Parameters
shapeA
Shape-
The first shape.
indexA
int-
The index for the first shape.
shapeB
Shape-
The second shape.
indexB
int-
The index for the second shape.
xfA
Transform-
The transform for the first shape.
xfB
Transform-
The transform for the seconds shape.