Releases: vanruesc/spatial-controls
Releases · vanruesc/spatial-controls
v4.2.1
v4.2.0
v4.1.0
Changelog
Core
- SpatialControls will now dispatch
update
events during interaction:const controls = new SpatialControls(...); controls.addEventListener("update", () => {});
Managers
- TranslationManager & MovementState
- Improved handling of simultaneous opposite direction input.
v4.0.2
v4.0.1
v4.0.0
Changelog
Bold text indicates a breaking change.
Package
- Changed
type
tomodule
and removed CJS exports. - Changed recommended engine to node ≥ 14.
Core
- Added
PointerBehaviour
enum. - Added
ControlMode
enum. - SpatialControls
- Removed
setOrbitEnabled
. Useconstrols.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
andvisibilitychange
events to stop interaction on focus loss. - The methods
setPosition
,setTarget
,moveTo
andlookAt
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.)
- Removed
Managers
- TranslationManager
- The method
moveTo
will now move both the target and the position in third person mode.
- The method
- RotationManager
- Added
restrictSpherical
method. - Added
updateSpherical
method. - Added
updatePosition
method.
- Added
Settings
- Individual data fields are now private and must be accessed via setter/getter methods.
- Removed
SensitivitySettings
and added sensitivity settings toRotationSettings
,TranslationSettings
andZoomSettings
. - 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.
- 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
lock
andhold
flags. UsesetBehaviour
instead. - Added a baseline pointer sensitivity. Default is
1e-3
.
- Removed
- RotationSettings
- Removed
invertX
andinvertY
flags. UsesetInvertedX
andsetInvertedY
instead.
- Removed