Skip to Main Content
3D Game Engine Design, 2nd Edition
book

3D Game Engine Design, 2nd Edition

by David Eberly
November 2006
Intermediate to advanced content levelIntermediate to advanced
1040 pages
26h 31m
English
CRC Press
Content preview from 3D Game Engine Design, 2nd Edition
15.4 Linear Component and Sphere 701
{
// Ray is directed away from the sphere.
return false;
}
float discr = a1 * a1 - a0;
return discr >= 0;
}
15.4.3 Segment and Sphere
The test-intersection query for a segment versus sphere is slightly more complicated
algebraically than that of ray or line versus sphere, but the end result requires only a
minimum of calculation time. If a
0
0, then the segment center P is inside the sphere
and we have an intersection. Otherwise, P is outside the sphere. If = a
2
1
a
0
< 0,
the line containing the segment does not intersect the sphere, so neither does the
segment. If both of these tests do not provide a quick out, we have ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

3D Game Engine Architecture

3D Game Engine Architecture

David Eberly
Blender 3D By Example - Second Edition

Blender 3D By Example - Second Edition

Oscar Baechler, Xury Greer
Computer Graphics

Computer Graphics

Alexey Boreskov, Evgeniy Shikin

Publisher Resources

ISBN: 9781482267303