mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-21 10:13:14 +00:00
utilities:: lerp
This commit is contained in:
parent
cfbabcff80
commit
7ba8b2d680
8
util.cpp
8
util.cpp
@ -100,6 +100,14 @@ ld frac(ld x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
ld lerp(ld a0, ld a1, ld x) {
|
||||
return a0 + (a1-a0) * x;
|
||||
}
|
||||
|
||||
ld ilerp(ld a0, ld a1, ld x) {
|
||||
return (x-a0) / (a1-a0);
|
||||
}
|
||||
|
||||
// debug utilities
|
||||
|
||||
#if CAP_PROFILING
|
||||
|
Loading…
x
Reference in New Issue
Block a user