gwanyan-interactive-grassland - v0.1.0
    Preparing search index...

    PointerWindTracker converts a stream of mouse positions into a stable wind source description. The class deliberately averages multiple samples instead of trusting just the latest one because raw mouse data can be noisy and visually unpleasant when converted directly into physics forces.

    Index

    Constructors

    • Creates a pointer tracker with a timeout that determines when the mouse should stop contributing wind because it has gone still or left the canvas.

      Parameters

      • stalePointerTimeoutInMilliseconds: number

      Returns PointerWindTracker

    Methods

    • Records a freshly projected pointer location in world space.

      Parameters

      • recordedAtTimeInMilliseconds: number

        The timestamp provided by the browser.

      • groundCoordinate: GroundCoordinate

        The pointer position projected onto the ground.

      Returns void

    • Clears all recent samples. This is used when the pointer leaves the canvas or when the application loses focus and should stop generating wind.

      Returns void

    • Produces the smoothed state that the simulation consumes each frame.

      Parameters

      • currentTimeInMilliseconds: number

        The current frame timestamp.

      Returns WindSourceState

      A stable wind source description.