Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is zeroForceIndex and why is it 31? #35

Closed
jessegreenberg opened this issue Mar 1, 2018 · 0 comments
Closed

What is zeroForceIndex and why is it 31? #35

jessegreenberg opened this issue Mar 1, 2018 · 0 comments
Assignees

Comments

@jessegreenberg
Copy link
Contributor

For #30. ISLCPullerNode has

    // @private - if in coulomb's law sim, add pusher and zero force images in proper order
    this.zeroForceIndex = null;

    if ( options.attractNegative ) {
      this.pullerPusherImages = pushImages.concat( zeroForceImage ).concat( pullImages );
      this.zeroForceIndex = 31;
    }

@mbarlow12 can you please include documentation about why it is necessary to keep a reference to zeroForceIndex? Also, could zeroForceIndex be set without the magic number? Would this work?

    // @private - if in coulomb's law sim, add pusher and zero force images in proper order
    this.zeroForceIndex = null;

    if ( options.attractNegative ) {
      this.pullerPusherImages = pushImages.concat( zeroForceImage ).concat( pullImages );
      this.zeroForceIndex = pushImages.length - 1;
      this.pullerPusherImages.concat( pullImages );
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants