Setting limits

Setting the limits in IKinema can be done using two methods

 IKSegment::setEulerLimits(EulerLimits& limits, bool relative_rest=true);


 IKSegment::setLimits(unsigned int axis, Real lmin, Real lmax);

It is more intuitive to use the first method, setEulerLimits. In this method,

EulerLimits as a structure has two fields


 float rot[3][2]; //{{min_x,max_x},{min_y,max_y},{min_z,max_z}}

max/min Euler rotations (rotations around local bone axes in rest (or current) orientation in degrees; values exceeding -359/359 indicate full range for bone rotation; normally min should be negative max should be positive; for one axis the limits could be same sign, indicating that the rest (or current) orientation is off-limits


 unsigned int bone_axis; // 0 || 1 || 2

this defines the bone axis; This parameter should define:

local axis along bone or local axis nearest to axis along bone or axis with least expected rotation ("roll")

More information and a visual demonstration on setting up limits is available here Setting up Limits Demos