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

`#include <Box2D/Common/b2Math.h>`
`#include <Box2D/Collision/b2Distance.h>`
`#include <climits>`

Go to the source code of this file.

## Classes
struct | b2TOIInput
| Input parameters for b2TimeOfImpact. More...
struct | b2TOIOutput
## Functions
void | b2TimeOfImpact (b2TOIOutput *output, const b2TOIInput *input)

## 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.