in .h file :
|
1 |
GLESDebugDraw *m_debugDraw; |
in .mm file :
in -(id) init function….Add following lines…
|
1 2 3 4 5 6 7 8 |
m_debugDraw = new GLESDebugDraw( PTM_RATIO ); world->SetDebugDraw(m_debugDraw); uint32 flags = 0; flags += b2DebugDraw::e_shapeBit; flags += b2DebugDraw::e_jointBit; flags += b2DebugDraw::e_aabbBit; flags += b2DebugDraw::e_pairBit; |
//.…..These are the different flags .Just try each flags…!!!
|
1 |
m_debugDraw->SetFlags(flags); |
Also add the following function….
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
-(void) draw{ // Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY // Needed states: GL_VERTEX_ARRAY, // Unneeded states: GL_TEXTURE_2D, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY glDisable(GL_TEXTURE_2D); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); world->DrawDebugData(); // restore default GL states glEnable(GL_TEXTURE_2D); glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); } |



