I'm also having a problem with GLESDebugDraw. I'm using Box2D 2.2.0. I have updated the GLES-Render files to use b2Draw and have patched the
GLESDebugDraw::DrawTranform method. I have setup and registered GLESDebugDraw with my world but not matter what I do, I cannot get it to draw any shapes around my bodies. Has anyone found a fix for this? What am I missing?
DrawTranform method:
init in
I should do now?I want to draw any shapes around my bodies.I'm very worried!!!
GLESDebugDraw::DrawTranform method. I have setup and registered GLESDebugDraw with my world but not matter what I do, I cannot get it to draw any shapes around my bodies. Has anyone found a fix for this? What am I missing?
DrawTranform method:
Code: Select all
void GLESDebugDraw::DrawTransform(const b2Transform& xf)
{
b2Vec2 p1 = xf.p, p2;
const float32 k_axisScale = 0.4f;
p2 = p1 + k_axisScale * xf.q.GetXAxis();
DrawSegment(p1,p2,b2Color(1,0,0));
p2 = p1 + k_axisScale * xf.q.GetYAxis();
DrawSegment(p1,p2,b2Color(0,1,0));
}
Code: Select all
#import"GLES-Render.h"
GLESDebugDraw *_debugDraw;
init in
Code: Select all
// Enable debug draw
_debugDraw = new GLESDebugDraw();
_world->SetDebugDraw(_debugDraw);
uint32 flags =0;
flags += b2Draw::e_shapeBit;
_debugDraw->SetFlags(flags);
Code: Select all
-(void) draw
{
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
_world->DrawDebugData();
glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
I should do now?I want to draw any shapes around my bodies.I'm very worried!!!