0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

render normals pointing out of static bodies

This commit is contained in:
liabru 2015-03-02 22:30:38 +00:00
parent 8bf3278304
commit d082b3adcc

View file

@ -855,7 +855,7 @@ var Render = {};
normalPosY = (pair.activeContacts[0].vertex.y + pair.activeContacts[1].vertex.y) / 2;
}
if (collision.bodyB === collision.supports[0].body) {
if (collision.bodyB === collision.supports[0].body || collision.bodyA.isStatic === true) {
c.moveTo(normalPosX - collision.normal.x * 8, normalPosY - collision.normal.y * 8);
} else {
c.moveTo(normalPosX + collision.normal.x * 8, normalPosY + collision.normal.y * 8);