Skip to content

v4.0.0

Compare
Choose a tag to compare
@vanruesc vanruesc released this 24 Feb 16:47
· 212 commits to main since this release

Changelog

Bold text indicates a breaking change.

Package

  • Changed type to module and removed CJS exports.
  • Changed recommended engine to node ≥ 14.

Core

  • Added PointerBehaviour enum.
  • Added ControlMode enum.
  • SpatialControls
    • Removed setOrbitEnabled. Use constrols.settings.general.setMode instead.
    • The update method now expects a timestamp in milliseconds.
    • The method getTarget now returns the internal target vector and no longer has any parameters.
    • Pointer listeners are now marked as passive to prevent freezes.
    • Controls now listen for mouseleave and visibilitychange events to stop interaction on focus loss.
    • The methods setPosition, setTarget, moveTo and lookAt now support (x, y, z) as parameters.
    • The initial rotation will now be properly preserved. (This wasn't possible before with third person mode as default.)

Managers

  • TranslationManager
    • The method moveTo will now move both the target and the position in third person mode.
  • RotationManager
    • Added restrictSpherical method.
    • Added updateSpherical method.
    • Added updatePosition method.

Settings

  • Individual data fields are now private and must be accessed via setter/getter methods.
  • Removed SensitivitySettings and added sensitivity settings to RotationSettings, TranslationSettings and ZoomSettings.
  • Added fromJSON method to all settings.
  • Settings will now dispatch change events whenever a value is changed via one of the setter methods.
    • Changes to constraints will immediately be applied to the internal spherical coordinates.
  • Settings
    • Removed toDataURL method.
    • Added toBlob method.
  • GeneralSettings
    • The default control mode is now first person.
    • Orbit mode is now third person mode.
    • Switching from first person mode to third person will now push the position back to look at the previous position. The rotation will be preserved.
  • PointerSettings
    • Removed lock and hold flags. Use setBehaviour instead.
    • Added a baseline pointer sensitivity. Default is 1e-3.
  • RotationSettings
    • Removed invertX and invertY flags. Use setInvertedX and setInvertedY instead.