Skip to content

Commit

Permalink
Some further restart logic updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinVallejo committed Nov 30, 2022
1 parent 85c9c7a commit 74f3b6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/common/model/CommonModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ abstract class CommonModel<EngineType extends Engine = Engine> {
this.availableBodies[ i ].positionProperty.setInitialValue( body.position );
this.availableBodies[ i ].velocityProperty.setInitialValue( body.velocity );
this.availableBodies[ i ].reset();
this.availableBodies[ i ].preventCollision( this.bodies );
}

// Update Center of Mass to avoid system's initial movement
Expand All @@ -263,6 +264,7 @@ abstract class CommonModel<EngineType extends Engine = Engine> {
const numberOfActiveBodies = this.bodies.length - 1;
const lastBody = this.bodies[ numberOfActiveBodies ];
lastBody.isActiveProperty.value = false;
this.updateDefaultModeInfo();
}

/**
Expand Down

0 comments on commit 74f3b6e

Please sign in to comment.