Hi guys. I was wondering if a more experienced C++ programmer could explain to me why Box2D uses so many switch statements instead of virtual methods. A typical example is b2Shape::Create.
Do virtual methods not work on some platforms, or is it just a performance issue, or am I missing something?
I ask as I am looking at porting my controller code. Unlike shapes, I don't expect a fixed list of controllers, so it's preferable to encapsulate each controller.
From my AS3 background, virtual methods are the natural approach, but this seems against the Box2D paradigm for some reason.
Don't be afraid to point out the obvious; I am an amateur programmer, and I'm sure my knowledge is very patchy.
Do virtual methods not work on some platforms, or is it just a performance issue, or am I missing something?
I ask as I am looking at porting my controller code. Unlike shapes, I don't expect a fixed list of controllers, so it's preferable to encapsulate each controller.
From my AS3 background, virtual methods are the natural approach, but this seems against the Box2D paradigm for some reason.
Don't be afraid to point out the obvious; I am an amateur programmer, and I'm sure my knowledge is very patchy.