Game Development Reference
In-Depth Information
((link2->length * sin2 *y) + ((link1->length +
(link2->length * cos2)) * x));
link1->rot.z = atan(tan1);
}else{
//Just use the single link solution
x = target.x - link1->pos.x;
y = -target.y - link1->pos.x;
link1->rot.z = atan(y/x);
if (x<0) link1->rot.z = PI + link1->rot.z;
link2->rot.z = 0.0;
}
link1->CreateMatrix();
link2->CreateMatrix();
CString str;
str.Format(”(%4.2f, %4.2f)”, x,y);
SetStatus(str);
}
Limitations for the analytical approach for multiple link
chains
In Figure 9.6, you can see that there are two valid ways of achieving the
orientations necessary to reach the target. This problem stems from using
Figure 9.6 IK problems often have more than one solution.
Search Nedrilad ::




Custom Search