Package org.jbox2d.collision
Class TimeOfImpact
- java.lang.Object
-
- org.jbox2d.collision.TimeOfImpact
-
public class TimeOfImpact extends java.lang.Object
Class used for computing the time of impact. This class should not be constructed usually, just retrieve from theSingletonPool#getTOI()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeOfImpact.TOIInput
Input parameters for TOIstatic class
TimeOfImpact.TOIOutput
Output parameters for TimeOfImpactstatic class
TimeOfImpact.TOIOutputState
-
Field Summary
Fields Modifier and Type Field Description private Distance.SimplexCache
cache
private DistanceInput
distanceInput
private DistanceOutput
distanceOutput
private SeparationFunction
fcn
private int[]
indexes
static int
MAX_ITERATIONS
private IWorldPool
pool
private Sweep
sweepA
private Sweep
sweepB
static int
toiCalls
static int
toiIters
static int
toiMaxIters
static int
toiMaxRootIters
static int
toiRootIters
private Transform
xfA
private Transform
xfB
-
Constructor Summary
Constructors Constructor Description TimeOfImpact(IWorldPool argPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
timeOfImpact(TimeOfImpact.TOIOutput output, TimeOfImpact.TOIInput input)
Compute the upper bound on time before two shapes penetrate.
-
-
-
Field Detail
-
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
-
cache
private final Distance.SimplexCache cache
-
distanceInput
private final DistanceInput distanceInput
-
xfA
private final Transform xfA
-
xfB
private final Transform xfB
-
distanceOutput
private final DistanceOutput distanceOutput
-
fcn
private final SeparationFunction fcn
-
indexes
private final int[] indexes
-
sweepA
private final Sweep sweepA
-
sweepB
private final Sweep sweepB
-
pool
private final IWorldPool pool
-
-
Constructor Detail
-
TimeOfImpact
public TimeOfImpact(IWorldPool argPool)
-
-
Method Detail
-
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
-
-
-