Ride: Fix hub caps
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user