I\'m so used to working just with rectangles for collision detection that I\'m a bit stumped right now. I\'m working with diamond-like shapes, and for the past few hours, ha
You're trying to collide a moving convex polygon (your "diamond") with another moving convex polygon, is that right? Something like this:
Your first step should be to transform the problem to an equivalent one in which one of the polygons is stationary:
Then you can transform the moving polygon into a "shaft" that covers the area swept by the moving polygon. This is straightforward to do: if the original polygon has n sides, then the shaft has n + 2 sides, with the extra two sides being the same length and direction as the movement vector. You find where to insert these new sides by sorting the vertices according to their component that's orthogonal to the movement vector, and inserting new sides at the maxima.
Now you've reduced the problem to static polygon against static polygon. Taking a look at the handy table of collision algorithms courtesy of realtimerendering.com, and following the references, we can see that we need to use the separating axis test, for example as described in section 3 of this paper by David Eberly.
In two dimensions, two convex polygons fail to intersect if we can find a separating axis, a line such that one polygon falls on one side of the line, and the other polygon on the other:
If we are given a direction, we can easily discover if there exists a separating axis that runs in that direction, by projecting the two polygons onto a line running perpendicular to that direction, and looking to see whether the projections are disjoint:
How do we know which direction the separating axis will run in? Well, if any separating axis exists, then there's one that runs parallel to one of the sides of one of the convex polygons (see Eberly, page 3). So there's only a small set of directions to check, and if you've checked them all without finding a separating axis, then the two polygons intersect (and hence the original moving objects collide).
There are lots of refinements and optimizations you can make, certainly not limited to these:
But don't worry too much about optimizing: get it right first in the confidence that you'll be able to speed it up later.