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
464 Chapter 8 Collision Detection
Capsule and Box
The natural choice for pseudodistance between a box and a capsule is to compute the
distance from the capsule segment to the box and subtract the radius. This quantity
is positive when the objects are separated, zero if they are just touching, and negative
when they are overlapping. The pseudocode is
float Pseudodistance (Capsule capsule, Box box)
{
float sd = SquaredDistance(capsule.segment,box);
return sd/(capsule.r*capsule.r) - 1;
}
The segment-box, squared-distance function is discussed in Section 14.9.3.
Sphere and Triangle
The natural choice for pseudodistance between a sphere and a triangle is to compute
the distance from the sphere center to the triangle and subtract the r adius. This
quantity is ...
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