v4.0.0
Changelog
Bold text indicates a breaking change.
Package
- Changed
typetomoduleand removed CJS exports. - Changed recommended engine to node ≥ 14.
Core
- Added
PointerBehaviourenum. - Added
ControlModeenum. - SpatialControls
- Removed
setOrbitEnabled. Useconstrols.settings.general.setModeinstead. - The
updatemethod now expects a timestamp in milliseconds. - The method
getTargetnow 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
mouseleaveandvisibilitychangeevents to stop interaction on focus loss. - The methods
setPosition,setTarget,moveToandlookAtnow 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.)
- Removed
Managers
- TranslationManager
- The method
moveTowill now move both the target and the position in third person mode.
- The method
- RotationManager
- Added
restrictSphericalmethod. - Added
updateSphericalmethod. - Added
updatePositionmethod.
- Added
Settings
- Individual data fields are now private and must be accessed via setter/getter methods.
- Removed
SensitivitySettingsand added sensitivity settings toRotationSettings,TranslationSettingsandZoomSettings. - Added
fromJSONmethod 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
toDataURLmethod. - Added
toBlobmethod.
- Removed
- 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
lockandholdflags. UsesetBehaviourinstead. - Added a baseline pointer sensitivity. Default is
1e-3.
- Removed
- RotationSettings
- Removed
invertXandinvertYflags. UsesetInvertedXandsetInvertedYinstead.
- Removed