]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
rename variables in map_ranges()
authorMartin Taibr <taibr.martin@gmail.com>
Fri, 11 Aug 2017 15:56:41 +0000 (17:56 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Fri, 11 Aug 2017 15:56:41 +0000 (17:56 +0200)
qcsrc/lib/math.qh

index 85ae496e3442010393f6a37e74ebc44eb7a31b2d..3e77b369fdf37110c332d948c71935c2539a28eb 100644 (file)
@@ -329,10 +329,10 @@ vector solve_quadratic(float a, float b, float c)
 /// Max can be lower than min if you want to invert the range, values can be negative.
 ERASEABLE
 float map_ranges(float value, float src_min, float src_max, float dest_min, float dest_max) {
-       float velocity_diff = src_max - src_min;
-       float force_diff = dest_max - dest_min;
-       float ratio = (value - src_min) / velocity_diff;
-       return dest_min + force_diff * ratio;
+       float src_diff = src_max - src_min;
+       float dest_diff = dest_max - dest_min;
+       float ratio = (value - src_min) / src_diff;
+       return dest_min + dest_diff * ratio;
 }
 
 /// Same as `map_ranges` except that values outside the source range are clamped to min or max.