Skip to content

Commit

Permalink
snap position tracked by model, see ##6
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed May 3, 2017
1 parent 5b77b1d commit 93c6a1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ define( function( require ) {
var leftBoundary = GravityForceLabBasicsConstants.LEFT_MASS_BOUNDARY;
var rightBoundary = GravityForceLabBasicsConstants.RIGHT_MASS_BOUNDARY;

InverseSquareLawModel.call( this, InverseSquareLawCommonConstants.G, mass1, mass2, leftBoundary, rightBoundary, tandem.createTandem( 'gravityForceLabBasicsModel' ) );
InverseSquareLawModel.call( this, InverseSquareLawCommonConstants.G, mass1, mass2, leftBoundary, rightBoundary, tandem.createTandem( 'gravityForceLabBasicsModel' ), {
snapObjectsToNearest: GravityForceLabBasicsConstants.MASS_POSITION_DELTA,
minSeparationBetweenObjects: 200 // in meters
} );

}

Expand Down
3 changes: 1 addition & 2 deletions js/gravity-force-lab-basics/view/GFLBMassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ define( function( require ) {
var inherit = require( 'PHET_CORE/inherit' );
var RangeWithValue = require('DOT/RangeWithValue');
var RadialGradient = require( 'SCENERY/util/RadialGradient' );
var GravityForceLabBasicsConstants = require( 'GRAVITY_FORCE_LAB_BASICS/gravity-force-lab-basics/GravityForceLabBasicsConstants' );
var PhetFont = require( 'SCENERY_PHET/PhetFont' );
var ObjectNode = require('INVERSE_SQUARE_LAW_COMMON/view/ObjectNode');

Expand All @@ -35,7 +34,7 @@ define( function( require ) {
labelFont: new PhetFont( 25 ),
labelMaxWidth: 40,
forceReadoutDecimalPlaces: 1,
snapToNearest: GravityForceLabBasicsConstants.MASS_POSITION_DELTA // in meters, charges will snap to the nearest 0.1 meters in model coordinates
snapToNearest: model.snapObjectsToNearest // in meters, charges will snap to the nearest 0.1 meters in model coordinates
}, options );

// @private
Expand Down

0 comments on commit 93c6a1e

Please sign in to comment.