0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

optimisation for non-rotating bodies

This commit is contained in:
liabru 2014-03-31 11:38:43 +01:00
parent 365152df6e
commit b421c38f74

View file

@ -213,8 +213,10 @@ var Body = {};
// transform the body geometry // transform the body geometry
Vertices.translate(body.vertices, body.velocity); Vertices.translate(body.vertices, body.velocity);
Vertices.rotate(body.vertices, body.angularVelocity, body.position); if (body.angularVelocity !== 0) {
Axes.rotate(body.axes, body.angularVelocity); Vertices.rotate(body.vertices, body.angularVelocity, body.position);
Axes.rotate(body.axes, body.angularVelocity);
}
Bounds.update(body.bounds, body.vertices, body.velocity); Bounds.update(body.bounds, body.vertices, body.velocity);
}; };