# Box2D/Box2D/Collision/b2Distance.cpp File Reference

`#include <Box2D/Collision/b2Distance.h>`
`#include <Box2D/Collision/Shapes/b2CircleShape.h>`
`#include <Box2D/Collision/Shapes/b2PolygonShape.h>`

## Classes
struct | b2SimplexVertex
struct | b2Simplex
## Functions
void | b2Distance (b2DistanceOutput *output, b2SimplexCache *cache, const b2DistanceInput *input)
## Variables
int32 | b2_gjkCalls
int32 | b2_gjkIters
int32 | b2_gjkMaxIters

## Function Documentation

void b2Distance | ( | b2DistanceOutput * | output,
|  | b2SimplexCache * | cache,
|  | const b2DistanceInput * | input |
| ) |  |  |

Compute the closest points between two shapes. Supports any combination of: b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. On the first call set b2SimplexCache.count to zero.

## Variable Documentation

int32 b2_gjkCalls

int32 b2_gjkIters

int32 b2_gjkMaxIters