We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I see some code about debug draw, but they are commented out. Is there any preferred way to draw debug shapes?
The text was updated successfully, but these errors were encountered:
For any one who has the same questions. I wrote some code to draw debug shape/joint/boundingbox:
// debug draw func (b2 *B2System) DebugDraw() { w := b2.world if b2.debug.shape { // shape for b := w.GetBodyList(); b != nil; b = b.GetNext() { xf := b.GetTransform() for f := b.GetFixtureList(); f != nil; f = f.GetNext() { drawShape(f, xf) } } } if b2.debug.joint { // joint for j := w.GetJointList(); j != nil; j = j.GetNext() { drawJoint(j) } } if b2.debug.bounding { // bounding-box bp := &w.M_contactManager.M_broadPhase for b := w.GetBodyList(); b != nil; b = b.GetNext() { if !b.IsActive() { continue } for f := b.GetFixtureList(); f != nil; f = f.GetNext() { for i := 0; i < f.M_proxyCount; i++ { proxy := f.M_proxies[i] aabb := bp.GetFatAABB(proxy.ProxyId) vs := [4]box2d.B2Vec2{} vs[0] = box2d.B2Vec2{aabb.LowerBound.X, aabb.LowerBound.Y} vs[1] = box2d.B2Vec2{aabb.UpperBound.X, aabb.LowerBound.Y} vs[2] = box2d.B2Vec2{aabb.UpperBound.X, aabb.UpperBound.Y} vs[3] = box2d.B2Vec2{aabb.LowerBound.X, aabb.UpperBound.Y} drawPolygon(vs[:]) } } } } }
Here, you have to implement drawShape、drawJoint and drawPolygon method. In my engine , it's easy to use dbg system to implement these method.
drawShape
drawJoint
drawPolygon
Sorry, something went wrong.
No branches or pull requests
I see some code about debug draw, but they are commented out. Is there any preferred way to draw debug shapes?
The text was updated successfully, but these errors were encountered: