Hi Erwin,
Thanks for sharing this code, I am also working on an engine using ODE and Ogre but I would really like to have continuous collision with convex support. I would also be interested in using Bullets dynamics once they mature a bit more, but for now I am primarily interested in using it for contact determination only.
I already have implemented a broadphase collision system and custom compound geoms. (I didn't like their implementation of spaces or geom transforms). At this point I could drop using ODE geom objects altogether I think.
All I need is a way to get contact points from bullet.
I've browsed through the source code and it looks like I would need to ...
1. Have a BroadphaseProxy member within my Geom/Shape wrapper class.
2. Implement a method similar to SimpleBroadphase::DispatchAllCollisionPairs, since, (no offense!), I would like to continue using my own broadphase.
3. Make the virtual call to CollisionAlgorithm::ProcessCollision.
4. Hmmmmm... after looking at ConvexConvexAlgorithm::ProcessCollision I see that it is tied directly to the dynamics part of bullet and that my reasoning is at a dead end.
I know this is a lot to ask but do you think you could separate the collision from the dynamics code? I think it would be beneficial to you as well.
I'm trying to think of a way to tease the two apart.
It could be as simple as having a function that returns a contact point array like ODE.
Or maybe by creating an interface called ContactProcessor that gets passed to ProcessCollision and have it implement a ProcessContacts function?
Code: Select all
class ContactProcessor {
public:
int m_numContacts ;
Result *p_results ;
void ProcessContacts() ;
}
Only ... how do you do memory management for the Result object in that case? Wouldn't we want to reuse it and avoid creation and deletion overhead? That seems to imply that ContactProcessor creates and owns the Result object, only, I can see that you are using different Result classes created within the ProcessCollision function. I'm stuck.
I know this is pretty sloppy but It's the best I could do for tonight. Maybe I'll think of something better tomorrow.
Thanks again!