I am working on a Box2d Editor for iOS, using cocos2d.
I wrapped b2World into my own World class. I want to implement my own draw functionality. Since I will be drawing higher level classes (Wall, Rope, etc) it is not enough to create a b2Draw subclass and set it as DebugDraw of the world, but I also need to change the b2World DrawDebugData.
Is it a good idea to inherit my World class from CCLayer and override the draw method? Whats a better approach?
The answer I would like people to read.
Even if the b2World implements some drawing functionality, it is just meant for debugging purposes and should be used as it is (unless you want to change one or two lines).
If you want to draw your higher level objects (or to change debug draw’s behaviour) you are not supposed to modify b2World’s draw or the GLES-Render. Instead, you override CCSprite / CCLayer drawing methods.