mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
34bf14269c
* add ccstd::vector * replace cc::vector with ccstd::vector * replace std::vector with ccstd::vector * do not include <vector>
14 lines
366 B
C++
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
|