Antkeeper  0.0.1
Public Member Functions | List of all members
ccd_ik_solver Class Reference

Cyclic Coordinate Descent (CCD) IK solver. More...

#include <ccd-ik-solver.hpp>

Inheritance diagram for ccd_ik_solver:
ik_solver

Public Member Functions

 ccd_ik_solver (ik_rig &ik_rig, bone_index_type root_bone_index, bone_index_type effector_bone_index)
 Constructs a CCD IK solver. More...
 
Solving
void solve () override
 Sets the maximum number of solving iterations. More...
 
void set_max_iterations (std::size_t iterations) noexcept
 Sets the maximum number of solving iterations. More...
 
std::size_t get_max_iterations () const noexcept
 Returns the maximum number of solving iterations. More...
 
Effector
void set_effector_position (const math::fvec3 &position) noexcept
 Sets the position of the end effector. More...
 
const math::fvec3get_effector_position () const
 Returns the position of the end effector, relative to the tip bone. More...
 
Goal
void set_goal_center (const math::fvec3 &center) noexcept
 Sets the center of the IK goal. More...
 
void set_goal_radius (float radius) noexcept
 Sets the radius of the IK goal. More...
 
const math::fvec3get_goal_center () const
 Returns the center of the IK goal, in world-space. More...
 

Detailed Description

Cyclic Coordinate Descent (CCD) IK solver.

Definition at line 32 of file ccd-ik-solver.hpp.

Constructor & Destructor Documentation

◆ ccd_ik_solver()

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.

Parameters
ik_rigIK rig with which to associate this IK solver.
root_bone_indexIndex of the first bone in the bone chain.
effector_bone_indexIndex of the last bone in the bone chain.
chain_lengthNumber of bones in the IK chain.

Definition at line 25 of file ccd-ik-solver.cpp.

Member Function Documentation

◆ get_effector_position()

const math::fvec3& ccd_ik_solver::get_effector_position ( ) const
inline

Returns the position of the end effector, relative to the tip bone.

Definition at line 82 of file ccd-ik-solver.hpp.

◆ get_goal_center()

const math::fvec3& ccd_ik_solver::get_goal_center ( ) const
inline

Returns the center of the IK goal, in world-space.

Definition at line 113 of file ccd-ik-solver.hpp.

◆ get_max_iterations()

std::size_t ccd_ik_solver::get_max_iterations ( ) const
inlinenoexcept

Returns the maximum number of solving iterations.

Definition at line 61 of file ccd-ik-solver.hpp.

◆ set_effector_position()

void ccd_ik_solver::set_effector_position ( const math::fvec3 position)
inlinenoexcept

Sets the position of the end effector.

Parameters
positionPosition of the end effector, relative to the tip bone.

Definition at line 76 of file ccd-ik-solver.hpp.

◆ set_goal_center()

void ccd_ik_solver::set_goal_center ( const math::fvec3 center)
inlinenoexcept

Sets the center of the IK goal.

Parameters
centerIK goal center, in world-space.

Definition at line 97 of file ccd-ik-solver.hpp.

◆ set_goal_radius()

void ccd_ik_solver::set_goal_radius ( float  radius)
inlinenoexcept

Sets the radius of the IK goal.

Parameters
radiusIK goal radius.

Definition at line 107 of file ccd-ik-solver.hpp.

◆ set_max_iterations()

void ccd_ik_solver::set_max_iterations ( std::size_t  iterations)
inlinenoexcept

Sets the maximum number of solving iterations.

Parameters
iterationsMaximum number of solving iterations.

Definition at line 55 of file ccd-ik-solver.hpp.

◆ solve()

void ccd_ik_solver::solve ( )
overridevirtual

Sets the maximum number of solving iterations.

Parameters
iterationsMaximum number of solving iterations.

Implements ik_solver.

Definition at line 53 of file ccd-ik-solver.cpp.


The documentation for this class was generated from the following files: