Ride: Fix hub caps

This commit is contained in:
Dejvino
2026-09-18 19:19:57 +02:00
parent 9c768f13d1
commit 4b0f27da9a
+3 -3
View File
@@ -463,8 +463,8 @@ export const ride = {
// Wheels: four dark torus + hub, spin with speed (see below). // Wheels: four dark torus + hub, spin with speed (see below).
const wheelGeo = new T.TorusGeometry(0.34, 0.13, 8, 18); const wheelGeo = new T.TorusGeometry(0.34, 0.13, 8, 18);
const hubGeo = new T.CylinderGeometry(0.14, 0.14, 0.1, 10); const hubGeo = new T.CylinderGeometry(0.2, 0.2, 0.1, 10);
hubGeo.rotateZ(Math.PI / 2); hubGeo.rotateX(Math.PI / 2);
instance.wheels = []; instance.wheels = [];
for (const [wx, wz] of [[-0.95, 1.05], [0.95, 1.05], [-0.95, -1.35], [0.95, -1.35]]) { for (const [wx, wz] of [[-0.95, 1.05], [0.95, 1.05], [-0.95, -1.35], [0.95, -1.35]]) {
const wcol = cc(1); const wcol = cc(1);
@@ -688,7 +688,7 @@ export const ride = {
// axis (local x after the geometry pre-rotation). // axis (local x after the geometry pre-rotation).
for (const w of instance.wheels) { for (const w of instance.wheels) {
if (w.userData.tire) w.userData.tire.rotation.z = t * speed * 6 * rate; if (w.userData.tire) w.userData.tire.rotation.z = t * speed * 6 * rate;
if (w.userData.hub) w.userData.hub.rotation.x = t * speed * 6 * rate; if (w.userData.hub) w.userData.hub.rotation.z = t * speed * 6 * rate;
} }
} }
// Passengers bob gently, out of phase — analytic f(t), seek-stable. // Passengers bob gently, out of phase — analytic f(t), seek-stable.