Uphill runs share one cleat phase; no cleats downhill; pick slope bands
A piece added to a running sloped belt kept its own cleat phase, so at the seam a rib could start just behind another and push its pocket into it, stalling the whole run with only a few grains. Every block of a run now takes the phase of the run's lower-left block. Downhill sloped belts no longer have cleats: they carry like a flat belt (90 grains/s, was 38) and draw only the sidewall. Middle click on a sloped belt's band, where it is drawn into the empty block beside it, now picks the belt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,16 +53,18 @@ const SM_SLOPE_DRAW = `
|
||||
float wave = 0.5 + 0.5 * sin((foot + w.x - local.x - phase) * 3.14159265);
|
||||
vec3 rubber = mix(vec3(0.20,0.22,0.25), vec3(0.25,0.27,0.31), wave);
|
||||
C = mix(C, rubber, 1.0 - smoothstep(-px, px, sd));
|
||||
// the ribs, where the simulation has them: rubber bars standing straight out of the belt,
|
||||
// the ribs, where the simulation has them: rubber bars standing straight out of an uphill belt,
|
||||
// one every ${CLEAT_SPACING} face cells, moved along by the belt's phase
|
||||
float dirS = (wallFlags & 32) != 0 ? 1.0 : -1.0;
|
||||
float rc = (w.x - local.x) + foot - (grade < 0.0 ? 1.0 : 0.0) - dirS * phase;
|
||||
float off = (mod(rc + ${(CLEAT_SPACING / 2).toFixed(1)}, ${CLEAT_SPACING.toFixed(1)}) - ${(CLEAT_SPACING / 2).toFixed(1)}) * 1.41421356;
|
||||
float ribTop = ${((2 * CLEAT_REACH + 1) * Math.SQRT1_2).toFixed(3)};
|
||||
float rd = length(vec2(off, depth - clamp(depth, 0.0, ribTop))) - 0.5;
|
||||
vec3 rib = mix(vec3(0.50,0.52,0.56), vec3(0.70,0.72,0.76), smoothstep(ribTop - 1.2, ribTop, depth));
|
||||
rib *= mix(0.78, 1.0, smoothstep(-0.5, 0.2, off * -dirS * grade));
|
||||
C = mix(C, rib, 1.0 - smoothstep(-px, px, rd));
|
||||
if (grade * dirS < 0.0) {
|
||||
float rc = (w.x - local.x) + foot - (grade < 0.0 ? 1.0 : 0.0) - dirS * phase;
|
||||
float off = (mod(rc + ${(CLEAT_SPACING / 2).toFixed(1)}, ${CLEAT_SPACING.toFixed(1)}) - ${(CLEAT_SPACING / 2).toFixed(1)}) * 1.41421356;
|
||||
float ribTop = ${((2 * CLEAT_REACH + 1) * Math.SQRT1_2).toFixed(3)};
|
||||
float rd = length(vec2(off, depth - clamp(depth, 0.0, ribTop))) - 0.5;
|
||||
vec3 rib = mix(vec3(0.50,0.52,0.56), vec3(0.70,0.72,0.76), smoothstep(ribTop - 1.2, ribTop, depth));
|
||||
rib *= mix(0.78, 1.0, smoothstep(-0.5, 0.2, off * -dirS * grade));
|
||||
C = mix(C, rib, 1.0 - smoothstep(-px, px, rd));
|
||||
}
|
||||
}
|
||||
|
||||
// Slopes use the flat belt's band, rollers and mesh in coordinates along the run.
|
||||
|
||||
Reference in New Issue
Block a user