Optimise data panels movement
When dragging a panel, the movement "lags", because the animate function called by Three.js is too often called. The idea is to decouple movements of panels from the movement of the camera (only thing that is moving). This can be achieved with two states:
- Panel movement (do it by saving the state of OrbitControls (see proto).
- Camera movement (would be better to not animate while it is not necessary).
A reference: https://github.com/mrdoob/three.js/issues/7670
Another approach is to use DragControls from Three.js as it is already done:
var dragControls = new DragControls(objects, threeCamera, renderer.domElement);
dragControls.addEventListener('dragstart', function (event) {
controls.enabled = false;
});
Edited by yannick legoc