Draws all this object's fixtures * @param {Color} [color] * @param {Color} [lineColor] * @param {number} [lineWidth] * @param {boolean} [useWebGL=glEnable] * @param {CanvasRenderingContext2D} [context]
(color=WHITE, lineColor=BLACK, lineWidth=.1, useWebGL, context)
| 120 | * @param {boolean} [useWebGL=glEnable] |
| 121 | * @param {CanvasRenderingContext2D} [context] */ |
| 122 | drawFixtures(color=WHITE, lineColor=BLACK, lineWidth=.1, useWebGL, context) |
| 123 | { |
| 124 | // draw non-edge fixtures |
| 125 | this.getFixtureList().forEach((fixture)=> |
| 126 | { |
| 127 | const shape = box2d.castShapeObject(fixture.GetShape()); |
| 128 | if (shape.GetType() !== box2d.instance.b2Shape.e_edge) |
| 129 | { |
| 130 | box2d.drawFixture(fixture, this.pos, this.angle, color, lineColor, lineWidth, useWebGL, context); |
| 131 | } |
| 132 | }); |
| 133 | |
| 134 | // draw edges using a single draw line for better connections |
| 135 | this.edgeLists.forEach(points=> |
| 136 | drawLineList(points, lineWidth, lineColor, false, this.pos, this.angle)); |
| 137 | this.edgeLoops.forEach(points=> |
| 138 | drawLineList(points, lineWidth, lineColor, true, this.pos, this.angle)); |
| 139 | } |
| 140 | |
| 141 | /////////////////////////////////////////////////////////////////////////////// |
| 142 | // physics contact callbacks |
no test coverage detected