... the code takes into account that multiple mousemove events might be processed for each scene tick event (the actual camera movement is done during the processing of scene ticks, and the code simply accumulates deltas).
Instead, during the processing of the touchmove event, the following is done...
Previous two code snippets DO NOT take into account that multiple touchmove events could be processed between scene ticks, and this has the effect of the CameraControl class missing some touchmove events when using a mobile device.
Shouldn't previous two snippets be refactored to (1st snippet):
Tested the navigation with the proposed fix and camera movement with fingers is waay finer 😃, (and independent of frame rate, i.e. scene tick rate) on touch screens.
On following lines of code related to
mousemove
events...https://github.com/xeokit/xeokit-sdk/blob/6d449ebe58500f0b60b4e30a5c46e3db047d74ba/src/viewer/scene/camera/CameraControl.js#L1006-L1007
... the code takes into account that multiple
mousemove
events might be processed for eachscene tick
event (the actual camera movement is done during the processing ofscene ticks
, and the code simply accumulates deltas).Instead, during the processing of the
touchmove
event, the following is done...https://github.com/xeokit/xeokit-sdk/blob/6d449ebe58500f0b60b4e30a5c46e3db047d74ba/src/viewer/scene/camera/CameraControl.js#L1218-L1219
... and the following:
https://github.com/xeokit/xeokit-sdk/blob/6d449ebe58500f0b60b4e30a5c46e3db047d74ba/src/viewer/scene/camera/CameraControl.js#L1234-L1235
Previous two code snippets DO NOT take into account that multiple
touchmove
events could be processed betweenscene ticks
, and this has the effect of theCameraControl
class missing sometouchmove
events when using a mobile device.Shouldn't previous two snippets be refactored to (1st snippet):
and (2nd snippet):
(Notice the
+=
instead of=
)Tested the navigation with the proposed fix and camera movement with fingers is waay finer 😃, (and independent of frame rate, i.e.
scene tick
rate) on touch screens.