1
Fork 0
mirror of https://github.com/RGBCube/Site synced 2025-07-31 13:07:46 +00:00

cube: adjust wheel sensitivity

This commit is contained in:
RGBCube 2025-06-02 03:00:34 +03:00
parent ad30320a8e
commit 1a17723c54
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M

View file

@ -52,22 +52,14 @@
},
scale(factor) {
return Vec(
this.x * factor,
this.y * factor,
this.z * factor,
);
return Vec(this.x * factor, this.y * factor, this.z * factor);
},
normalize() {
let length = this.length();
length = length == 0 ? 1 : length;
return Vec(
this.x / length,
this.y / length,
this.z / length,
);
return Vec(this.x / length, this.y / length, this.z / length);
},
});
@ -119,7 +111,7 @@
const friction = 3;
const sensitivityMouse = 0.01;
const sensitivityWheel = 0.005;
const sensitivityWheel = 0.006;
// One minute.
const screensaverTimeoutMs = 1 * 60 * 1000;
@ -137,8 +129,9 @@
set(q) {
this.quat = q;
this.element.style.transform =
`rotate3d(${q.x}, ${q.y}, ${q.z}, ${Math.acos(q.w) * 2}rad)`;
this.element.style.transform = `rotate3d(${q.x}, ${q.y}, ${q.z}, ${
Math.acos(q.w) * 2
}rad)`;
},
get() {
@ -191,7 +184,6 @@
impulseThisFrame = Vec.sum(impulseThisFrame, axis);
const rotation = Quat.fromAxis(axis);
orient.set(Quat.mul(rotation, orient.get()));
};