MCPcopy Create free account
hub / github.com/melonjs/melonJS / strokeBodyHitbox

Function strokeBodyHitbox

packages/debug-plugin/src/patches.js:138–146  ·  view source on GitHub ↗

* Stroke the orange body AABB and the red collision shapes for the * given renderable. Caller is responsible for positioning the renderer * at the body's local-coordinate origin (i.e. the renderable origin * for general renderables, or the anchor-shifted body origin for * entities). Used by both

(renderer, panel, adapter, renderable, aabb)

Source from the content-addressed store, hash-verified

136 * @param {Bounds} aabb
137 */
138function strokeBodyHitbox(renderer, panel, adapter, renderable, aabb) {
139 renderer.setColor("orange");
140 renderer.stroke(aabb);
141 renderer.setColor("red");
142 for (const shape of adapter.getBodyShapes(renderable)) {
143 renderer.stroke(shape);
144 panel.counters.inc("shapes");
145 }
146}
147
148/**
149 * Stroke a blue velocity arrow from `(originX, originY)` along the

Callers 1

applyPatchesFunction · 0.85

Calls 4

incMethod · 0.80
getBodyShapesMethod · 0.65
setColorMethod · 0.45
strokeMethod · 0.45

Tested by

no test coverage detected