Skip to content

Commit

Permalink
update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelBarbosatec committed Dec 1, 2023
1 parent 99f99c6 commit b961a83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- [BREAKING CHANGE] `BlockMovementCollision` big improvements.
Update `onBlockedMovement` method, adds `CollisionData(normal,depth,direction,intersectionPoints)`
Adds `onBlockMovementUpdateVelocity` method to do override if necessary.
- `HandleForces` improvements.
- Fix typo in params that contained `intencity` renaming it to `intensity`.
- Fix bug `playOnce` and `playOnceOther` when call again without finish the last.
- `BarLifeComponent` improvements.
Expand Down
2 changes: 1 addition & 1 deletion lib/forces/forces_2d.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AccelerationForce2D extends Force2D {

@override
Vector2 transform(Vector2 velocity, double mass, double dt) {
return (value * mass * dt);
return velocity + (value * mass * dt);
}
}

Expand Down
7 changes: 3 additions & 4 deletions lib/forces/handle_forces.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ mixin HandleForces on Movement {
Vector2 velocity,
double dt,
) {
final accelerations = forces.fold<Vector2>(
Vector2.zero(),
(p, e) => p + e.transform(p, mass, dt),
return forces.fold<Vector2>(
velocity,
(p, e) => e.transform(p, mass, dt),
);
return velocity + accelerations;
}

Vector2 onApplyResistenceForces(
Expand Down

0 comments on commit b961a83

Please sign in to comment.