Those lines mean than whenever some of the properties of the Ortho class are modified, a render will be triggered during next tick, not the current one.
This creates some jittering in some cases where we modify both the Camera properties (rendered on the current tick) and the Ortho properties (rendered on the next tick) at the same time. As a side effect, in that case two renders are triggered.
Shouldn't those lines be...
this._needUpdate(0);
... instead of...
this._needUpdate();
... so that Ortho changes are processed during the current tick (and not enqueued for the next tick)?
Did some tests with that change and the effect is that the problems are solved:
only one render is triggered when modifying both the Camera and the Ortho instead of two
In
src/viewer/scene/camera/Ortho.js
file:https://github.com/xeokit/xeokit-sdk/blob/13dbc2956b0305d448499bc3f6e96b9c344be97d/src/viewer/scene/camera/Ortho.js#L102
https://github.com/xeokit/xeokit-sdk/blob/13dbc2956b0305d448499bc3f6e96b9c344be97d/src/viewer/scene/camera/Ortho.js#L136
https://github.com/xeokit/xeokit-sdk/blob/13dbc2956b0305d448499bc3f6e96b9c344be97d/src/viewer/scene/camera/Ortho.js#L168
Those lines mean than whenever some of the properties of the
Ortho
class are modified, a render will be triggered during nexttick
, not the current one.This creates some jittering in some cases where we modify both the
Camera
properties (rendered on the current tick) and theOrtho
properties (rendered on the next tick) at the same time. As a side effect, in that case two renders are triggered.Shouldn't those lines be...
this._needUpdate(0);
... instead of...
this._needUpdate();
... so that
Ortho
changes are processed during the currenttick
(and not enqueued for the nexttick
)?Did some tests with that change and the effect is that the problems are solved:
Camera
and theOrtho
instead of two