kripken / box2d.js

Port of Box2D to JavaScript using Emscripten
1.32k stars 198 forks source link

How to reference a body while drawing with debugdraw #53

Closed manideepabc closed 10 years ago

manideepabc commented 10 years ago

I want to draw a sprite while drawing using debug draw method. so,I want to reference a body to know whether it is the shape I wanted or not .How can I reference a body in the customizeVTable method.Further I wanted to know what is 'ths' referring to in the following code.How can we use it .

Box2D.customizeVTable(debugDraw, [{ original: Box2D.b2Draw.prototype.DrawSegment, replacement: function(ths, vert1, vert2, color) { alert('called'); } }]);

can someone help regarding this.