36 for (
int i = 0; i < 3; ++i )
37 q[i] =
lerp(
p[i],
p[i+1], t );
40 for (
int i = 0; i < 2; ++i )
41 r[i] =
lerp( q[i], q[i+1], t );
43 return lerp( r[0], r[1], t );
56 w[3] = 1 - w[0] - w[1] - w[2];
Vector2< T > p[4]
Definition MRBezier.h:22
static std::array< T, 4 > getWeights(T t)
computes weights of every control point for given parameter value, the sum of all weights is equal to...
Definition MRBezier.h:47
typename VTraits::BaseType T
Definition MRBezier.h:18
V getPoint(T t) const
computes point on the curve from parameter value
Definition MRBezier.h:32
VectorTraits< V > VTraits
Definition MRBezier.h:17
constexpr auto lerp(V v0, V v1, T t) noexcept
Linear interpolation: returns v0 when t==0 and v1 when t==1.
Definition MRMeshFwd.h:779
static constexpr int elements
Definition MRBezier.h:19
static constexpr int size
Definition MRVectorTraits.h:42
V BaseType
Definition MRVectorTraits.h:21
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Cubic Bezier curve.
Definition MRBezier.h:16
Common traits for (mathematical) vectors.
Definition MRVectorTraits.h:18