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:
parent
365152df6e
commit
b421c38f74
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||||
|
if (body.angularVelocity !== 0) {
|
||||||
Vertices.rotate(body.vertices, body.angularVelocity, body.position);
|
Vertices.rotate(body.vertices, body.angularVelocity, body.position);
|
||||||
Axes.rotate(body.axes, body.angularVelocity);
|
Axes.rotate(body.axes, body.angularVelocity);
|
||||||
|
}
|
||||||
Bounds.update(body.bounds, body.vertices, body.velocity);
|
Bounds.update(body.bounds, body.vertices, body.velocity);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue