Game Development Reference
In-Depth Information
We now have a way to find the interval of time, bounded by t enter and
t leave , when the two boxes overlap on a single dimension. The intersection
of these intervals on all dimensions gives us the interval of time where the
boxes intersect with each other. This is illustrated in Figure A.16 for two
time intervals in 2D.
Figure A.16
Intersecting two
intervals of time
Don't confuse Figure A.16 with Figure A.15. In Figure A.16, the axis is
the time axis; in Figure A.15 the axis is the x-axis.
If the interval is empty, then the boxes never collide. If the interval lies
completely outside the range 0 ≤ t ≤ 1, then there is no collision over the
period of time of interest. Actually, the interval during which the boxes
overlap is more information than we wanted, since we are interested only in
the point in time when the boxes begin intersecting, not when they cease
to intersect. Still, we need to maintain this interval, mainly to determine
whether it is empty.
Unfortunately, in practice, bounding boxes for objects are rarely axially
aligned in the same coordinate space. However, because this test is rela-
tively fast, it is useful as a preliminary trivial rejection test, to be followed
by a more specific (and usually more expensive) test.
A.18
Intersection of a Ray and an AABB
Computing the intersection of a ray with an AABB is an important calcu-
lation because the result of this test is commonly used for trivial rejection
on more complicated objects. (For example, if we wish to raytrace against
multiple triangle meshes, we can first raytrace against the AABBs of the
meshes to trivially reject entire meshes at once, rather than having to check
each triangle.)
Search WWH ::




Custom Search