Hello! I'm sure this issue has been addressed in the forums recently, but I can't seem to craft a search query to ferret out the information.
I have an iPad project for which I was using Box2D 2.1.2 (I think). Today, I downloaded Box2D 2.2.0, and am trying to incorporate the new library into my project.
One of the first hiccups I hit was in GLES-Render.h. The class from which it was trying to derive GLESDebugDraw was b2DebugDraw. I *think* this needs to be b2Draw now. When I make that change, it seems happy.
The next area that I'm having trouble with is in GLES-Render.mm with the GLESDebugDraw::DrawTransform method. The b2Transform structure seems quite a bit different with the newer Box2D library. I see that the member variable position is now p. But there was an old bMath22 member variable called R, which seems to have been replaced with a b2Rot variable called q. It's not entirely clear to me how I would refactor this code to conform to the new structures:
Code:
void GLESDebugDraw::DrawTransform(const b2Transform& xf)
{
b2Vec2 p1 = xf.p, p2;
const float32 k_axisScale = 0.4f;
p2 = p1 + k_axisScale * xf.R.col1;
DrawSegment(p1,p2,b2Color(1,0,0));
p2 = p1 + k_axisScale * xf.R.col2;
DrawSegment(p1,p2,b2Color(0,1,0));
}
I tried to see if there were any new template GLES-Render.h/mm files provided with the latest Box2D library, but I couldn't find any. Maybe this is more of a Cocos2D issue?
If anyone has any suggestions, I'd be much obliged!