I've been trying to write my own collision code, less because I want to, more because I want to understand its working.
To do this, i've been working off of the popular collision book i'm sure you've all heard of: Morgan Kaufmann Real Time Collision.
I'm on the subject of Oriented Bounding Boxes. These are boxes that can have an orientaiton applied to them. If it matters, i'm doing my code in 2D. It seems easy enough to just cut out an axis from the books calculations.
Here is the OBB they define:
// Region R = { x | x = c+r*u[0]+s*u[1]+t*u[2] }, |r|<=e[0], |s|<=e[1], |t|<=e[2]
struct OBB {
Point c; // OBB Center Point
Vector u[3]; // Local x-, y-, and z-axes
Vector e // Positive halfwidth extents of OBB along each axis
};
The confusing one is the Vector array, u.
Point c is the center 3 axis position of the box. Vector e is the width, height, and length of the box. Vector u[3] baffles me. My best guess is that it is the center-point of each of the 3 sides (with the reflected 3 finishing the box)
How does rotation work into this? Is the Vector u[3] taking the roation in somehow? How?