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

Electric Potential Sensor grabbed at different points #128

Closed
phet-steele opened this issue Aug 22, 2017 · 4 comments
Closed

Electric Potential Sensor grabbed at different points #128

phet-steele opened this issue Aug 22, 2017 · 4 comments

Comments

@phet-steele
Copy link
Contributor

phet-steele commented Aug 22, 2017

Mirror inputs for http://www.colorado.edu/physics/phet/dev/html/charges-and-fields/1.1.0-phetiodev.1/wrappers/mirror-inputs/mirror-inputs.html?sim=charges-and-fields&relativeSimPath has issues with the electric potential sensor. When grabbing it from the tool box, the "pick up point" is the crosshairs (the crosshairs jump underneath the cursor). This does not happen in the below sim where the little draggy thumb at the bottom of the sensor is the pick up point:

cafio04

Some things to note:

  • The tape measurer does not get out of sync in this way.
  • The potential sensor tool has the pick up point naturally (in all wrappers, not just mirror inputs)
  • Current master of BOTH brands does not have this pick up point. The tool is grabbed at the thumb on master.

Seen on macOS 10.12.6 Chrome. For phetsims/qa/issues/37

@samreid
Copy link
Member

samreid commented Aug 22, 2017

This code appears in ElectricFieldSensorNode.js

            if ( event.pointer.isTouch ) {
              globalPoint.addXY( 0, -2 * ChargesAndFieldsConstants.ELECTRIC_FIELD_SENSOR_CIRCLE_RADIUS );
            }

There is similar code in ChargedParticleNode.js

            if ( event.pointer.isTouch ) {
              globalPoint.addXY( 0, -2 * CIRCLE_RADIUS );
            }

@samreid
Copy link
Member

samreid commented Aug 22, 2017

False alarm, the sensor is called ElectricPotentialSensorNode, not ElectricFieldSensorNode

@samreid
Copy link
Member

samreid commented Aug 22, 2017

If I add this console.log at the top of ChargesAndFieldsToolboxPanel.js

  var SENSOR_HEIGHT = electricPotentialPanelOutlineImage.height;
  console.log(SENSOR_HEIGHT);

I can see that the recording sim is loading with height 0 and the playback sim is loading with height 535. Since the vertical offset is set by this image height, it creates the discrepancy:

var initialViewPosition = self.globalToParentPoint( event.pointer.point ).plusXY( 0, -SENSOR_HEIGHT * 6 / 25 );

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