33 baseShape_.assign(baseShape.begin(), baseShape.end());
42 return factorizationValid_;
53 [[nodiscard]] std::vector<Eigen::Vector3<T>>
computeShape(
83 float regularization = 1.0f,
96 std::string_view name =
"");
104 std::vector<Vector3f> baseShape_;
105 mutable Eigen::JacobiSVD<MatrixXf> factorization_;
106 mutable bool factorizationValid_;
gsl::span< T > span
Span type alias using gsl::span (C++17 fallback).
VectorX< float > VectorXf
Skinning class that combines blend shape vectors with a base shape.
std::vector< Eigen::Vector3< T > > computeShape(const BlendWeightsT< T > &coefficients) const
Applies blend weights to create a deformed shape.
void setBaseShape(momentum::span< const Vector3f > baseShape)
void setShapeVector(size_t index, momentum::span< const Vector3f > shapeVector, std::string_view name="")
Overrides base method to also invalidate the cached SVD factorization used by estimateCoefficients.
VectorXf estimateCoefficients(momentum::span< const Vector3f > vertices, float regularization=1.0f, const VectorXf &weights=VectorXf()) const
Solves for blend weights that best approximate a target shape.
bool isApprox(const BlendShape &blendShape) const
Compares all components of two blend shapes.
bool getFactorizationValid() const
Whether SVD factorization is up-to-date.
const std::vector< Vector3f > & getBaseShape() const