add interpolation to cursor reticles
cursor reticles are now interpolated to the update interval, so they should be smooth at > 60 fps
This commit is contained in:
parent
bebc2daa95
commit
a40480a464
3 changed files with 81 additions and 19 deletions
|
@ -26,6 +26,7 @@ let connectionStatus = main.querySelector("rkgk-connection-status");
|
|||
|
||||
document.getElementById("js-loading").remove();
|
||||
reticleRenderer.connectViewport(canvasRenderer.viewport);
|
||||
reticleRenderer.updateInterval = updateInterval;
|
||||
|
||||
function updateUrl(session, viewport) {
|
||||
let url = new URL(window.location);
|
||||
|
@ -231,7 +232,7 @@ function readUrl(urlString) {
|
|||
}
|
||||
});
|
||||
|
||||
let reportCursor = debounce(updateInterval, (x, y) => session.sendCursor(x, y));
|
||||
let reportCursor = debounce(updateInterval, (x, y) => session.sendCursor(x, y), console.log);
|
||||
canvasRenderer.addEventListener(".cursor", async (event) => {
|
||||
reportCursor(event.x, event.y);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue