Docsity

Collision Detection Design Issues - Outline | CS 470, Study notes of Computer Graphics

Partial preview of the text

Download Collision Detection Design Issues - Outline | CS 470 and more Study notes Computer Graphics in PDF only on Docsity!

Computer Graphics

CS 470

Computer Science and Electrical Engineering Dept.

West Virginia University

17th November 2006

Outline

1 Collision Detection Design Issues

2 Bounding Volumes

3 Bounding Volume Hierarchies

4 Spatial Partitioning

5 Collision Response

Collision Detection Design Issues Design Factors

Design Factors

Object representation

Types of Queries

Simulation Parameters

Performance

Robustness

Ease of Implementation and Use

Collision Detection Design Issues Object Representation

Object Representation

Triangles : ’triangle soup’ vs. structured meshes

Implicit : formulas for lines, planes, spheres

Explicit : parametric equations for curves and surfaces

Collision Detection Design Issues Types of Queries

Types of Queries

Boolean intersection queries (collision detection).

Find intersection points (collision determination).

Penetration / separation distance.

Closest points.

ETA : estimated time of arrival.

TOI : time of impact.

Collision Detection Design Issues Simulation Parameters

Simulation Parameters

Swept volume

Number of objects.

For n moving objects, and m static

objects :

nm +

n

brute-force comparisons.

Sequential vs. simultaneous motion.

Discrete vs. Continuous Motion.

I Discrete : Static detection

I Continuous : Swept volumes.

I Continuous : Speed boxes.

Bounding Volumes

Outline

1 Collision Detection Design Issues

2 Bounding Volumes

Characteristics

Axis-Aligned Bounding Boxes

Bounding Spheres

Oriented Bounding Boxes

Discrete Oriented Polytopes

3 Bounding Volume Hierarchies

4 Spatial Partitioning

5 Collision Response

Bounding Volumes Characteristics

Bounding Volume Characteristics

Bounding volume (BV) : a simple volume encapsulating complex object(s).

Inexpensive intersection tests.

Tight fitting.

Inexpensive to compute.

Easy to transform.

Use little memory.

Bounding volumes

Bounding Volumes Axis-Aligned Bounding Boxes

Axis-Aligned Bounding Boxes (AABB)

AABB update required when mesh rotates.

Bounding Volumes Axis-Aligned Bounding Boxes

Axis-Aligned Bounding Boxes (AABB)

Possible representation:

struct AABB

Vector3f min;

Vector3f max;

AABB - AABB overlap test:

bool AABBvsAABB(AABB a, AABB b)

if (a.max.x < b.min.x || b.max.x < a.min.x) return false;

if (a.max.y < b.min.y || b.max.y < a.min.y) return false;

if (a.max.z < b.min.z || b.max.z < a.min.z) return false;

return true;

Note early rejections. Order may affect performance.

Bounding Volumes Bounding Spheres

Bounding Spheres

Center and radius.

Circle in 2D.

Sphere in 3D.

Features:

Fast overlap testing against other spheres.

Rotationally invariant.

Loose fitting.

Bounding Volumes Bounding Spheres

Bounding Spheres

Possible representation:

struct Sphere

Vector3f center;

float radius;

Sphere - Sphere overlap test:

bool SpherevsSphere(Sphere a, Sphere b)

Vector3f d = a.center - b.center;

float sqrDist = DotProduct(d, d);

float sumRadii = a.radius + b.radius;

return sqrDist <= sumRadii * sumRadii;

Bounding Volumes Bounding Spheres

General Overlap Detection

The separating plane theorem

Given 2 convex objects,A and B, either

A and B are intersecting

or, there exists a separating plane, P, such that

A is on one side of P and B is on the opposite side of P.

Bounding Volumes Bounding Spheres

General Overlap Detection

The separating axis test

Given P separating A and B, let L be the line perpendicular to P.

L is called a separating axis because the orthogonal projections of A and B

onto L result in nonoverlapping intervals.

Existence of a separating axis implies that A and B do not overlap.