TransformTracker¶
Under Construction
This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/scenery/blob/main/js/util/TransformTracker.ts for the most up-to-date information.
Overview¶
Used for identifying when any ancestor transform of a node in a trail causes that node's global transform to change. It also provides fast computation of that global matrix, NOT recomputing every matrix, even on most transform changes.
@author Jonathan Olson <jonathan.olson@colorado.edu> @author Jesse Greenberg
Class TransformTracker¶
Constructor¶
new TransformTracker( trail : Trail, providedOptions? : TransformTrackerOptions )¶
Instance Methods¶
dispose()¶
Gets rid of all external references and listeners. This object is inoperable afterwards.
addListener( listener : () => void )¶
Adds a listener function that will be synchronously called whenever the transform for this Trail changes.
removeListener( listener : () => void )¶
Removes a listener that was previously added with addListener().
getMatrix() : Matrix3¶
Returns the local-to-global transformation matrix for the Trail, which transforms its leaf node's local coordinate frame into the global coordinate frame.
NOTE: The matrix returned should not be mutated. Please make a copy if needed.
Type TransformTrackerOptions¶
- isStatic?: boolean
Whether the bounds listeners should be added with on() or onStatic().
Source Code¶
See the source for TransformTracker.ts in the scenery repository.