Class Collision
- Namespace
- Alis.Core.Physic.Collision
- Assembly
- Alis.dll
Collision methods
public static class CollisionInheritance
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
vOutFixedArray2<ClipVertex>-
The v out.
vInFixedArray2<ClipVertex>-
The v in.
normalVector2-
The normal.
offsetfloat-
The offset.
vertexIndexAint-
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
manifoldManifoldcircleACircleShapexfATransformcircleBCircleShapexfBTransform
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
manifoldManifold-
The manifold.
edgeAEdgeShape-
The edge A.
transformATransform-
The transform A.
circleBCircleShape-
The circle B.
transformBTransform-
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
manifoldManifold-
The manifold.
edgeAEdgeShape-
The edge A.
xfATransform-
The xf A.
polygonBPolygonShape-
The polygon B.
xfBTransform-
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
manifoldManifold-
The manifold.
polygonAPolygonShape-
The polygon A.
xfATransform-
The transform of A.
circleBCircleShape-
The circle B.
xfBTransform-
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
manifoldManifold-
The manifold.
polyAPolygonShape-
The poly A.
transformATransform-
The transform A.
polyBPolygonShape-
The poly B.
transformBTransform-
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
poly1PolygonShape-
The poly1.
xf1To2Transformedge1int-
The edge1.
poly2PolygonShape-
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
cFixedArray2<ClipVertex>-
The
poly1PolygonShape-
The poly
xf1Transform-
The xf
edge1int-
The edge
poly2PolygonShape-
The poly
xf2Transform-
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
edgeIndexint-
Index of the edge.
poly1PolygonShape-
The poly1.
xf1Transform-
The XF1.
poly2PolygonShape-
The poly2.
xf2Transform-
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
state1FixedArray2<PointState>-
The state
state2FixedArray2<PointState>-
The state
manifold1Manifold-
The manifold
manifold2Manifold-
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
shapeAShape-
The first shape.
indexAint-
The index for the first shape.
shapeBShape-
The second shape.
indexBint-
The index for the second shape.
xfATransform-
The transform for the first shape.
xfBTransform-
The transform for the seconds shape.