Check weight is within bounds for quintic lerp
This commit is contained in:
parent
be0426ff24
commit
2783bcaa23
1
lerp.cpp
1
lerp.cpp
@ -61,6 +61,7 @@ lerp::cubic (double a, double b, double weight) {
|
|||||||
|
|
||||||
double
|
double
|
||||||
lerp::quintic (double a, double b, double weight) {
|
lerp::quintic (double a, double b, double weight) {
|
||||||
|
CHECK (weight >= 0.0 && weight <= 1.0);
|
||||||
double t = weight * weight * weight * (weight * (weight * 6.0 - 15.0) + 10.0);
|
double t = weight * weight * weight * (weight * (weight * 6.0 - 15.0) + 10.0);
|
||||||
return a * (1.0 - t) + b * t;
|
return a * (1.0 - t) + b * t;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user