mirror of
https://github.com/liabru/matter-js.git
synced 2025-01-31 18:14:55 -05:00
Set part.angle
in Body.update
.
This change fixes a discrepency between `Body.setAngle` and `Body.update`. Calling `part.angle` should always return the world space angle of the part. In `Body.setAngle`, `part.angle` is correctly updated for every part. This maintains the invariant. In `Body.update`, `part.angle` was previously not being updated. This led to stale values returned for `part.angle`.
This commit is contained in:
parent
ee336863f7
commit
a36c6a6593
1 changed files with 1 additions and 0 deletions
|
@ -573,6 +573,7 @@ var Axes = require('../geometry/Axes');
|
|||
Vertices.rotate(part.vertices, body.angularVelocity, body.position);
|
||||
Axes.rotate(part.axes, body.angularVelocity);
|
||||
if (i > 0) {
|
||||
part.angle += body.angularVelocity;
|
||||
Vector.rotateAbout(part.position, body.angularVelocity, body.position, part.position);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue