Skip to content

File affine_body_external_force.h

File List > constitution > affine_body_external_force.h

Go to the documentation of this file

#pragma once
#include <uipc/common/type_define.h>
#include <uipc/constitution/constitution.h>
#include <uipc/geometry/simplicial_complex.h>

namespace uipc::constitution
{
class UIPC_CONSTITUTION_API AffineBodyExternalBodyForce final : public IConstitution
{
    using Base = IConstitution;

  public:
    AffineBodyExternalBodyForce(const Json& config = default_config());
    ~AffineBodyExternalBodyForce();

    void apply_to(geometry::SimplicialComplex& sc, const Vector12& force);

    void apply_to(geometry::SimplicialComplex& sc, const Vector3& force);

    static Json default_config();

  protected:
    virtual U64 get_uid() const noexcept override;

  private:
    Json m_config;
};
}  // namespace uipc::constitution