To read later:
If all the functions are polynomials, then:
The literature will presumably provide root-finding algorithms
Given a time t and four planes (vertex vs face), we can determine exactly (using integers) which side the vertex is on, including given the base times (so if we need to we can eliminate all rounding error on this side)
However, when doing "update_to_time", the locations round off. We can handle that part too (i.e. "given a time t and four planes, we can determine which side the vertex is on after the rounding error")
We'll tweak the root finding stuff to include that (always it should return a moment in time just BEFORE stuff switches sides).
And whenever we round off a plane's location, we recompute what it'll hit.
The only concern is that when we round it off, the rounding itself may cause a DIFFERENT one of its vertex/face sets to go over the edge.
We might want some kind of system of tolerances, but I don't know what that is.
Right now I'm having the coding difficulty of vertices passing through surfaces by colliding twice: They collide once and bounce off, but now they're moving away but somehow the math says they collide immediately, which means it's assumed that they collide from the other side.
Definitionally, the "reverse collision" things are geometrically impossible and we should be able to notice that and ignore them. But how?
Each collision has a single, unambiguous region associated with it (or should, at least).
A plane can know "which side" that region is on - hence, I'm pretty convinced that this is mathematically possible without (much, at least) extra data storage. Although if we don't split planes at three-region boundaries, then it's tricky because the four planes can share more than one region. Although the directionality is the same for both...
I guess the region issue doesn't really matter, because it has to do with the way the point is facing. Vertices only collide when they're pointing towards faces, not away from them. Edges too have to be pointing towards each other.
What quantifies "pointing towards"?
Hmm... with the current code, always (if there are any roots at all) exactly ONE of the roots represents a real collision, while the other does not. (And if we recognize this, we can include negative-time collisions, to cover for rounding error causing trouble). But which one? In which region is the vertex? Well, we can easily remember what regions a vertex touches.
In the 4x4 determinant, inverting any particular plane function inverts the answer. So the function is directional... supposing we standardize that all the normals point towards the common region, which direction is "from inside to outside the region"? But reversing the clockwiseness of the vertex planes also reverses it... so that doesn't really work very well unless we also standardize more stuff. Which might be a good idea?
Note, three planes genuinely don't indicate which side (they form more than one direction of vertex pointing at each other, if not given more information).
For a hack, I could just standardize "normals point out of rocks" and check whether the observed velocity at the collision time is going against that normal.
Can faces have holes in them? Not with the current data... I think we need to allow that. (Though we don't need to allow face holes to have holes in them because those can be separate faces.)
How do I keep track of the volume of a region? I think it's still, hrm, a rational function (in the sense of a ratio of polynomials) that we can compute. That could be useful.