20 #ifndef ANTKEEPER_ANIMATION_CCD_IK_SOLVER_HPP
21 #define ANTKEEPER_ANIMATION_CCD_IK_SOLVER_HPP
48 void solve()
override;
57 m_max_iterations = iterations;
63 return m_max_iterations;
84 return m_effector_position;
99 m_goal_center = center;
109 m_sqr_goal_radius = radius * radius;
115 return m_goal_center;
121 ik_rig* m_ik_rig{
nullptr};
122 std::size_t m_max_iterations{10};
123 std::vector<bone_index_type> m_bone_indices;
126 float m_sqr_goal_radius{1e-5f};
std::uint16_t bone_index_type
Bone index type.
Cyclic Coordinate Descent (CCD) IK solver.
ccd_ik_solver(ik_rig &ik_rig, bone_index_type root_bone_index, bone_index_type effector_bone_index)
Constructs a CCD IK solver.
void solve() override
Sets the maximum number of solving iterations.
const math::fvec3 & get_effector_position() const
Returns the position of the end effector, relative to the tip bone.
void set_goal_center(const math::fvec3 ¢er) noexcept
Sets the center of the IK goal.
const math::fvec3 & get_goal_center() const
Returns the center of the IK goal, in world-space.
std::size_t get_max_iterations() const noexcept
Returns the maximum number of solving iterations.
void set_max_iterations(std::size_t iterations) noexcept
Sets the maximum number of solving iterations.
void set_goal_radius(float radius) noexcept
Sets the radius of the IK goal.
void set_effector_position(const math::fvec3 &position) noexcept
Sets the position of the end effector.
Abstract base class for IK solvers.
@ position
Vertex position (vec3)