Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The point with GJK is that it's a good algorithm, but hard to implement right. I struggled with this years ago, Steven Cameron at Oxford worked on it, and it's a solved problem now. I'm tempted to open-source the collision code from my old Falling Bodies product, but it's pre-STL C++ from the 1990s and I don't want to overhaul it now.

On collision detection generally, the performance advantage of OBBs over convex polyhedra is small and may be negative. If you use convex hulls, you get better looking collisions and it doesn't cost you much, if anything.



I'm tempted to open-source the collision code from my old Falling Bodies product, but it's pre-STL C++ from the 1990s and I don't want to overhaul it now.

You should release it and put that in the description.

The lack of STL means it's more likely to be thoughtfully designed. It's a merit, not a demerit. Or to put it a bit bluntly: Don't worry about that! I'd love to see the code.


I try not to do this, but you might be interested to know that four people upvoted me. So there are a bunch of people who want to see your code. I assure you, no one minds whether it's STL or not. The solution is the interesting bit.


If you use convex hulls, you get better looking collisions and it doesn't cost you much, if anything.

Very interesting.

Can you go into more detail here on what you mean by better looking?


The convex hull will represent the geometry more accurately than an OBB because it can have >8 points and doesn't have to be cuboid. So the collisions will be more representative.


Right. In particular, OBBs roll like square wheels.


I'm tempted to open-source the collision code from my old Falling Bodies product, but it's pre-STL C++ from the 1990s and I don't want to overhaul it now.

If you open source it, someone will port it, add tests and make it into a nice library... So don't hesitate.


"you get better looking collisions and it doesn't cost you much, if anything."

Yeah I dunno about this. Generating good convex polyhedra isn't free. Their cache missing extra memory isn't free. Nor is the test free.

I suppose it all really depends on the use case. The right balance of early out vs precision depends on your data set. Run too many early outs and it can be a net loss. Run too many precise tests and it's a net loss.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: