mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -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
|
||||
Vertices.translate(body.vertices, body.velocity);
|
||||
Vertices.rotate(body.vertices, body.angularVelocity, body.position);
|
||||
Axes.rotate(body.axes, body.angularVelocity);
|
||||
if (body.angularVelocity !== 0) {
|
||||
Vertices.rotate(body.vertices, body.angularVelocity, body.position);
|
||||
Axes.rotate(body.axes, body.angularVelocity);
|
||||
}
|
||||
Bounds.update(body.bounds, body.vertices, body.velocity);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue