Skip to content

Commit

Permalink
Store same number of points independent of speed, see #330
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 11, 2020
1 parent 53c1206 commit 86a1409
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/common/model/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class Body extends PhetioObject {
*
* @public
*/
allBodiesUpdated() {
modelStepped() {

// Only add to the path if the user isn't dragging it and if the body is not exploded and the body is movable
if ( !this.userControlled && !this.isCollidedProperty.get() && this.isMovableProperty.value ) {
Expand All @@ -397,7 +397,7 @@ class Body extends PhetioObject {
* Add a point to the collection of points that follow the trajectory of a moving body.
* This also removes points when the path gets too long.
*
* @public
* @private
*/
addPathPoint() {
const pathPoint = this.positionProperty.get();
Expand Down
8 changes: 4 additions & 4 deletions js/common/model/GravityAndOrbitsPhysicsEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ class GravityAndOrbitsPhysicsEngine {
// step the model by the smallest standard time step for the orbital mode
for ( let i = 0; i < numberOfSteps; i++ ) {
this.step( smallestTimeStep );
}

// Signify that the model completed an entire step so that any batch operations may be invoked
for ( let i = 0; i < this.bodies.length; i++ ) {
this.bodies[ i ].allBodiesUpdated();
// Signify that the model completed an entire step so that any batch operations may be invoked
for ( let i = 0; i < this.bodies.length; i++ ) {
this.bodies[ i ].modelStepped();
}
}

this.stepCompleteEmitter.emit();
Expand Down

0 comments on commit 86a1409

Please sign in to comment.