mirror of
https://github.com/RGBCube/Site
synced 2025-07-30 20:47:46 +00:00
cube: make impulseIdle a global
This commit is contained in:
parent
217f19841f
commit
2ccbbf3a17
1 changed files with 2 additions and 2 deletions
|
@ -141,6 +141,7 @@
|
|||
|
||||
let velocity = Vec.ZERO;
|
||||
let impulseThisFrame = Vec.ZERO;
|
||||
let impulseIdle = Vec(0.7, 0.7, -0.7);
|
||||
|
||||
const handleUp = () => {
|
||||
mouse.down = false;
|
||||
|
@ -254,8 +255,7 @@
|
|||
}
|
||||
|
||||
if (globalThis.performance.now() - mouse.lastMove > screensaverTimeoutMs) {
|
||||
const impulse = Vec(0.7, 0.7, -0.7);
|
||||
velocity = Vec.sum(impulse.scale(effectiveDelta * 3), velocity);
|
||||
velocity = Vec.sum(impulseIdle.scale(effectiveDelta * 3), velocity);
|
||||
}
|
||||
|
||||
const axis = Vec(velocity.x, velocity.y, velocity.z)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue