Skip to content

Commit

Permalink
GFLB constant radius should be the same as min radius, convert Mass a…
Browse files Browse the repository at this point in the history
…nd Charge to es6, removing ISLCObject.calculateRadius abstract method. #183
  • Loading branch information
zepumph committed Oct 8, 2019
1 parent 1f02d42 commit f539a48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion js/gravity-force-lab-basics/GFLBConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define( require => {

// modules
const gravityForceLabBasics = require( 'GRAVITY_FORCE_LAB_BASICS/gravityForceLabBasics' );
const Mass = require( 'GRAVITY_FORCE_LAB/gravity-force-lab/model/Mass' );
const Property = require( 'AXON/Property' );
const Range = require( 'DOT/Range' );

Expand All @@ -18,12 +19,14 @@ define( require => {
const MIN_MASS = 1.00 * BILLION_MULTIPLIER; // kg
const MAX_MASS = 10.0 * BILLION_MULTIPLIER; // kg
const MAX_DISTANCE_FROM_CENTER = 4800; // meters, empirically determined boundary for masses
const MASS_DENSITY = 1.5; // kg/m^3

const GFLBConstants = {
BACKGROUND_COLOR_PROPERTY: new Property( '#ffffc2' ),
BILLION_MULTIPLIER: BILLION_MULTIPLIER, // a billion for scaling values (since basics version uses billions of kg)
MASS_RANGE: new Range( MIN_MASS, MAX_MASS ),
CONSTANT_RADIUS: 600, // meters
MASS_DENSITY: MASS_DENSITY,
CONSTANT_RADIUS: Mass.calculateRadius( MIN_MASS, MASS_DENSITY ), // meters
MIN_DISTANCE_BETWEEN_MASSES: 200, // meters
PULL_LOCATION_RANGE: new Range( -MAX_DISTANCE_FROM_CENTER, MAX_DISTANCE_FROM_CENTER ),
MASS_POSITION_DELTA: 100, // in m, masses can move in 0.1 km increments and will snap to these locations
Expand Down
2 changes: 1 addition & 1 deletion js/gravity-force-lab-basics/model/GFLBModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ define( require => {
const INITIAL_POTISION_2 = 2000;

const VALUE_RANGE = GFLBConstants.MASS_RANGE;
const DENSITY = 1.5; // kg/m^3
const DENSITY = GFLBConstants.MASS_DENSITY;

const MASS_OPTIONS = {
constantRadius: GFLBConstants.CONSTANT_RADIUS,
Expand Down

0 comments on commit f539a48

Please sign in to comment.