Skip to content

Commit

Permalink
Fixed Grade Crossing Math
Browse files Browse the repository at this point in the history
Manipulated terms in Grade crossing math to reduce chained operations. Symmetrized behavior for positive and negative values of q to make grade crossing heights symmetrical on both sides of track.
  • Loading branch information
km00700 committed Apr 14, 2024
1 parent bef835d commit c5f023b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public BuilderIterator(RailInfo info, World world, Vec3i pos, boolean endOfTrack
int posZ = (int)Math.floor(gagPos.z+nextUp.z+placeOff.z);
double height = 0;
if (info.settings.isGradeCrossing) {
height = (1 - Math.abs((int)q)/horiz)/3 - 0.05;
height = 0.306 - Math.abs(Math.round(q))/(3 * horiz);
height *= info.settings.gauge.scale();
height = Math.min(height, clamp);
}
Expand Down

0 comments on commit c5f023b

Please sign in to comment.