# Crate collision [−] [src]

Companion library to cgmath, dealing with collision detection centric data structures and algorithms.

This crate provides useful data structures and algorithms for doing collision detection. It is organized into a few distinct parts: generic geometry (ray, line, plane, frustum etc), bounding volumes (AABB, OBB, Sphere etc), collision primitives and algorithms used for collision detection, distance computation etc.

## Modules

algorithm |
Collision detection algorithms |

dbvt |
A dynamic bounding volume tree implementation, index based (not pointer based). |

prelude |
Prelude provides all the traits of the library in a convenient form |

primitive |
Collision primitives |

## Structs

Aabb2 |
A two-dimensional AABB, aka a rectangle. |

Aabb3 |
A three-dimensional AABB, aka a rectangular prism. |

Contact |
Contact manifold for a single collision contact point. |

Cylinder |
Bounding cylinder |

Frustum |
View frustum, used for frustum culling |

FrustumPoints |
View frustum corner points |

Line |
A generic directed line segment from |

Obb |
Generic object bounding box, centered on |

Plane |
A 3-dimensional plane formed from the equation: |

Ray |
A generic ray starting at |

Sphere |
Bounding sphere. |

## Enums

CollisionStrategy |
Collision strategy to use for collisions. |

Relation |
Spatial relation between two objects. |

## Traits

Aabb |
Base trait describing an axis aligned bounding box. |

Bound |
Generic 3D bound. |

Contains |
Boolean containment test. |

Continuous |
An intersection test with a result. |

ContinuousTransformed |
Continuous intersection test on transformed primitive |

Discrete |
A boolean intersection test. |

DiscreteTransformed |
Discrete intersection test on transformed primitive |

HasAabb |
Primitive with axis aligned bounding box |

Interpolate |
Trait used for interpolation of values |

MinMax |
Compute the minimum/maximum of the given values |

Primitive |
Marker trait for a collision primitive. |

Projection |
Conversion trait for converting cgmath projection types into a view frustum |

SupportFunction |
Minkowski support function for primitive |

SurfaceArea |
Shape surface area |

TranslationInterpolate |
Trait used for interpolation of translation only in transforms |

Union |
Build the union of two shapes. |

## Type Definitions

Line2 |
2D directed line segment |

Line3 |
3D directed line segment |

Obb2 |
2D object bounding box |

Obb3 |
3D object bounding box |

Ray2 |
2D ray |

Ray3 |
3D ray |