fix: always set last position
This commit is contained in:
parent
7c976ad8c0
commit
9cfb06f66c
|
@ -23,14 +23,14 @@ export default class IntegratePhysics extends System {
|
|||
if (!Forces || !Position) {
|
||||
return;
|
||||
}
|
||||
Position.lastX = Position.$$x;
|
||||
Position.lastY = Position.$$y;
|
||||
const xd = elapsed * (Forces.$$impulseX + Forces.$$forceX);
|
||||
if (xd) {
|
||||
Position.lastX = Position.$$x;
|
||||
Position.x = Position.$$x + xd;
|
||||
}
|
||||
const yd = elapsed * (Forces.$$impulseY + Forces.$$forceY);;
|
||||
if (yd) {
|
||||
Position.lastY = Position.$$y;
|
||||
Position.y = Position.$$y + yd;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user