Skip to content

ProbeNode

Overview

ProbeNode is a physical-looking probe with a handle and a circular sensor region. It is used in simulations like Bending Light and Beer's Law Lab to show how much light is being received. It is typically connected to a body with readouts via a wire. The origin is in the center of the sensor.

This code was generalized from Bending Light, see https://github.com/phetsims/bending-light/issues/165

@author Sam Reid (PhET Interactive Simulations) @author Chandrashekar Bemagoni (Actual Concepts) @author Chris Malley (PixelZoom, Inc.)

Class ProbeNode

import { ProbeNode } from 'scenerystack/scenery-phet';

Constructor

new ProbeNode( providedOptions? : ProbeNodeOptions )

Instance Methods

dispose()

Static Properties

DEFAULT_PROBE_NODE_OPTIONS

(readonly)

glass

(readonly)

crosshairs

(readonly)

Type ProbeNodeOptions

import type { ProbeNodeOptions } from 'scenerystack/scenery-phet';
  • radius?: number
  • innerRadius?: number
  • handleWidth?: number
  • handleHeight?: number
  • handleCornerRadius?: number
  • lightAngle?: number
    in radians, the angle of the incoming light. 0 is from the right, PI/2 from the bottom, PI from the left, etc. The default is from the upper-left. Generally, it is difficult to know the global rotation of the ProbeNode and automatically update the lightAngle when the global rotation changes, so this is up to the developer to set properly. The light in PhET simulations often comes from the top-left, so please set this value accordingly depending on the context of how the probe is embedded in the simulation.
  • color?: TColor
  • sensorTypeFunction?: SensorTypeFunction | null
    Determines what is displayed in the sensor area, the circular cut-out part of the ProbeNode. Set this to null to display nothing in the sensor.
  • & NodeOptions

Source Code

See the source for ProbeNode.ts in the scenery-phet repository.