Skip to content

File affine_body_revolute_joint_external_force.h

File List > constitution > affine_body_revolute_joint_external_force.h

Go to the documentation of this file

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

namespace uipc::constitution
{
class UIPC_CONSTITUTION_API AffineBodyRevoluteJointExternalForce final : public Constraint
{
    using Base = Constraint;

  public:
    AffineBodyRevoluteJointExternalForce(const Json& config = default_config());

    ~AffineBodyRevoluteJointExternalForce() override;

    void apply_to(geometry::SimplicialComplex& sc, Float torque = Float{0});

    void apply_to(geometry::SimplicialComplex& sc, span<Float> torques);

    static Json default_config();

  private:
    virtual U64 get_uid() const noexcept override;
    Json        m_config;
};
}  // namespace uipc::constitution