C# Class Nez.PhysicsShapes.ShapeCollisions

Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Méthode Description
boxToBox ( Box first, Box second, CollisionResult &result ) : bool
boxToBoxCast ( Box first, Box second, Vector2 movement, RaycastHit &hit ) : bool

checks the result of a box being moved by deltaMovement with second

circleToBox ( Circle circle, Box box, CollisionResult &result ) : bool

works for circles whos center is in the box as well as just overlapping with the center out of the box.

circleToCircle ( Circle first, Circle second, CollisionResult &result ) : bool
circleToCircleCast ( Circle first, Circle second, Vector2 deltaMovement, RaycastHit &hit ) : bool
circleToPolygon ( Circle circle, Polygon polygon, CollisionResult &result ) : bool
collide ( Shape first, Shape second, Vector2 deltaMovement, RaycastHit &hit ) : bool

swept collision check

lineToCircle ( Vector2 start, Vector2 end, Circle s, RaycastHit &hit ) : bool
lineToLine ( Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2, Vector2 &intersection ) : bool
lineToPoly ( Vector2 start, Vector2 end, Polygon polygon, RaycastHit &hit ) : bool
pointToBox ( Vector2 point, Box box, CollisionResult &result ) : bool
pointToCircle ( Vector2 point, Circle circle, CollisionResult &result ) : bool
pointToPoly ( Vector2 point, Polygon poly, CollisionResult &result ) : bool
polygonToPolygon ( Polygon first, Polygon second, CollisionResult &result ) : bool

checks for a collision between two Polygons

Private Methods

Méthode Description
circleToPolygon2 ( Circle circle, Polygon polygon, CollisionResult &result ) : bool
closestPointOnLine ( Vector2 lineA, Vector2 lineB, Vector2 closestTo ) : Vector2
findMinimumTranslationDistance ( int iNumAxes, Vector2 &normal, float &timeOfIntersection ) : bool
getInterval ( Polygon polygon, int numVertices, Vector2 axis, float &min, float &max ) : void
getInterval ( Vector2 axis, Polygon polygon, float &min, float &max ) : void
intervalDistance ( float minA, float maxA, float minB, float maxB ) : float
intervalIntersect ( Polygon first, Polygon second, Vector2 &axis, Vector2 &shapeOffset, Vector2 &deltaMovement, float &taxis ) : bool
minkowskiDifference ( Box first, Box second ) : RectangleF
polygonToPolygon ( Polygon first, Polygon second, Vector2 deltaMovement, Vector2 &responseNormal, float &timeOfCollision ) : bool
polygonToPolygonCast ( Polygon first, Polygon second, Vector2 deltaMovement, RaycastHit &hit ) : bool
polygonToPolygonOLD ( Polygon first, Polygon second, CollisionResult &result ) : bool

Method Details

boxToBox() public static méthode

public static boxToBox ( Box first, Box second, CollisionResult &result ) : bool
first Box
second Box
result CollisionResult
Résultat bool

boxToBoxCast() public static méthode

checks the result of a box being moved by deltaMovement with second
public static boxToBoxCast ( Box first, Box second, Vector2 movement, RaycastHit &hit ) : bool
first Box First.
second Box Second.
movement Microsoft.Xna.Framework.Vector2
hit RaycastHit Hit.
Résultat bool

circleToBox() public static méthode

works for circles whos center is in the box as well as just overlapping with the center out of the box.
public static circleToBox ( Circle circle, Box box, CollisionResult &result ) : bool
circle Circle First.
box Box Second.
result CollisionResult Result.
Résultat bool

circleToCircle() public static méthode

public static circleToCircle ( Circle first, Circle second, CollisionResult &result ) : bool
first Circle
second Circle
result CollisionResult
Résultat bool

circleToCircleCast() public static méthode

public static circleToCircleCast ( Circle first, Circle second, Vector2 deltaMovement, RaycastHit &hit ) : bool
first Circle
second Circle
deltaMovement Microsoft.Xna.Framework.Vector2
hit RaycastHit
Résultat bool

circleToPolygon() public static méthode

public static circleToPolygon ( Circle circle, Polygon polygon, CollisionResult &result ) : bool
circle Circle
polygon Polygon
result CollisionResult
Résultat bool

collide() public static méthode

swept collision check
public static collide ( Shape first, Shape second, Vector2 deltaMovement, RaycastHit &hit ) : bool
first Shape First.
second Shape Second.
deltaMovement Microsoft.Xna.Framework.Vector2 Delta movement.
hit RaycastHit Hit.
Résultat bool

lineToCircle() public static méthode

public static lineToCircle ( Vector2 start, Vector2 end, Circle s, RaycastHit &hit ) : bool
start Microsoft.Xna.Framework.Vector2
end Microsoft.Xna.Framework.Vector2
s Circle
hit RaycastHit
Résultat bool

lineToLine() public static méthode

public static lineToLine ( Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2, Vector2 &intersection ) : bool
a1 Microsoft.Xna.Framework.Vector2
a2 Microsoft.Xna.Framework.Vector2
b1 Microsoft.Xna.Framework.Vector2
b2 Microsoft.Xna.Framework.Vector2
intersection Microsoft.Xna.Framework.Vector2
Résultat bool

lineToPoly() public static méthode

public static lineToPoly ( Vector2 start, Vector2 end, Polygon polygon, RaycastHit &hit ) : bool
start Microsoft.Xna.Framework.Vector2
end Microsoft.Xna.Framework.Vector2
polygon Polygon
hit RaycastHit
Résultat bool

pointToBox() public static méthode

public static pointToBox ( Vector2 point, Box box, CollisionResult &result ) : bool
point Microsoft.Xna.Framework.Vector2
box Box
result CollisionResult
Résultat bool

pointToCircle() public static méthode

public static pointToCircle ( Vector2 point, Circle circle, CollisionResult &result ) : bool
point Microsoft.Xna.Framework.Vector2
circle Circle
result CollisionResult
Résultat bool

pointToPoly() public static méthode

public static pointToPoly ( Vector2 point, Polygon poly, CollisionResult &result ) : bool
point Microsoft.Xna.Framework.Vector2
poly Polygon
result CollisionResult
Résultat bool

polygonToPolygon() public static méthode

checks for a collision between two Polygons
public static polygonToPolygon ( Polygon first, Polygon second, CollisionResult &result ) : bool
first Polygon Polygon a.
second Polygon Polygon b.
result CollisionResult
Résultat bool