10.08.2013 Views

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.3. COMPONENTS 93<br />

of the corresponding matrix, when a row and a column is added to or removed from the matrix.<br />

The factorization classes are used to implement the internals of constraint and LCP solvers.<br />

7.3.2 Geometry<br />

Geometry library abstracts collision geometries and supports and implements collision detection<br />

according to [10] and [22]. Collision geometries are represented by CollisionGeometry superclass<br />

providing access to the collision geometry’s geometry hull (an axes aligned bounding box),<br />

an infrastructure for attaching geometries to parent geometries and rigid bodies and mapping<br />

of the local collision geometry spaces, the geometries are defined at, to the parent spaces (local<br />

spaces of the parent geometries or the world space). This allows to create geometry hierarchies<br />

and compose complex collision geometries from more primitive geometries. The library handles<br />

the following geometry types and implements classes to perform low-level collision detection<br />

among these types,<br />

• Convex polyhedra<br />

Convex polyhedra are volumes defined as the intersection of a set of half-spaces determined<br />

by their boundary planes. Convex polyhedra are represented by the instances of Polytope<br />

class, which store the boundary planes and other related information distilled from the<br />

polytope definitions, such as lists of polytope faces, edges and vertices together with the<br />

topology information, utilized by the collision detection code.<br />

• Spheres<br />

Spheres are defined as volumes with centers c and radii r that are parametrized by points<br />

p, where p − r ≤ r. They are represented by the instances of Sphere class.<br />

• Capped cylinders<br />

Capped cylinders are volumes defined by two end points a and b and radii r, parametrized<br />

by points p so that dist(p, −→ ab) ≤ r, where dist(p, −→ ab) denotes the distance of point p from<br />

line −→ ab. Capped cylinders are usual cylinders with radii r and their principal axes pointing<br />

along the directions of −→ ab with the addition of two sphere “caps” at their end points.<br />

Capped cylinders can be seen as volumes swept by spheres with radii r when they are<br />

translated from a to b along straight lines. Capped cylinders are represented by instances<br />

of CappedCylinder class.<br />

• Spaces<br />

Spaces are containers for other geometry types. They represent volumes corresponding to<br />

the unions of the (appropriately transformed) owned geometries and are implemented by<br />

Space class.<br />

CollisionDetection class manages collision geometries and implements higher-level and<br />

lower-level collision detection. Higher-level collision detection operates upon geometry hulls of<br />

collision geometries attached to rigid bodies and utilizes the sort and sweep algorithm to determine<br />

all overlapping geometry hull pairs. Geometry hulls are represented by bounding boxes<br />

with their sides aligned with the world space axes.<br />

Lower-level collision detection invokes geometry type pair specific algorithms, encapsulated<br />

by the subclasses of CollisionDetection::Collider class, that test for penetration and compute<br />

contacts if the tested geometries do not penetrate. Collider classes often rely on the fact that contacts<br />

need not be computed on penetrations (in fact it would be hard to define what the contacts<br />

should be if geometries already penetrated), which allows to use more efficient algorithms.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!