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

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

## Classes
struct | b2SeparationFunction
## Functions
void | b2TimeOfImpact (b2TOIOutput *output, const b2TOIInput *input)
## Variables
int32 | b2_toiCalls
int32 | b2_toiIters
int32 | b2_toiMaxIters
int32 | b2_toiRootIters
int32 | b2_toiMaxRootIters
int32 | b2_toiMaxOptIters

## Function Documentation

void b2TimeOfImpact | ( | b2TOIOutput * | output,
|  | const b2TOIInput * | input |
| ) |  |  |

Compute the upper bound on time before two shapes penetrate. Time is represented as a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, non-tunneling collision. If you change the time interval, you should call this function again. Note: use b2Distance to compute the contact point and normal at the time of impact.

## Variable Documentation

int32 b2_toiCalls

int32 b2_toiIters

int32 b2_toiMaxIters

int32 b2_toiMaxOptIters

int32 b2_toiMaxRootIters

int32 b2_toiRootIters