# Class TimeOfImpact

java.lang.Object
com.codename1.gaming.physics.box2d.collision.TimeOfImpact

public class TimeOfImpact extends Object

Class used for computing the time of impact. This class should not be constructed usually, just retrieve from the

invalid reference

    SingletonPool#getTOI()

.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `TimeOfImpact.TOIInput`
  Input parameters for TOI
  `static class`
  `TimeOfImpact.TOIOutput`
  Output parameters for TimeOfImpact
  `static enum`
  `TimeOfImpact.TOIOutputState`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `MAX_ITERATIONS`
  `static int`
  `toiCalls`
  `static int`
  `toiIters`
  `static int`
  `toiMaxIters`
  `static int`
  `toiMaxRootIters`
  `static int`
  `toiRootIters`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TimeOfImpact(IWorldPool argPool)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `timeOfImpact(TimeOfImpact.TOIOutput output, TimeOfImpact.TOIInput input)`
  Compute the upper bound on time before two shapes penetrate.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MAX_ITERATIONS

    public static final int MAX_ITERATIONS
    See Also:
      - Constant Field Values

  - ### toiCalls

    public static int toiCalls

  - ### toiIters

    public static int toiIters

  - ### toiMaxIters

    public static int toiMaxIters

  - ### toiRootIters

    public static int toiRootIters

  - ### toiMaxRootIters

    public static int toiMaxRootIters

- ## Constructor Details

  - ### TimeOfImpact

    public TimeOfImpact(IWorldPool argPool)

- ## Method Details

  - ### timeOfImpact

    public final void timeOfImpact(TimeOfImpact.TOIOutput output, TimeOfImpact.TOIInput 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 Distance to compute the contact point and normal at the time of impact.
    Parameters:
      `output` -
      `input` -