Files
cocos4/native/cocos/core/geometry/Curve.cpp
T
minggo 34bf14269c unify stl (#10402)
* add ccstd::vector
* replace cc::vector with ccstd::vector 
* replace std::vector with ccstd::vector
* do not include <vector>
2022-03-21 15:55:02 +08:00

14 lines
366 B
C++

#include "cocos/core/geometry/Curve.h"
namespace cc {
namespace geometry {
float OptimizedKey::evaluate(float tt) {
const t = tt - time;
return evalOptCurve(t, coefficient);
}
float evalOptCurve(float t, const ccstd::vector<float> &coefs) {
return (t * (t * (t * coefs[0] + coefs[1]) + coefs[2])) + coefs[3];
}
} // namespace geometry
} // namespace cc