Add bogenmas
This commit is contained in:
parent
9f318216e0
commit
b5748c2902
1 changed files with 11 additions and 6 deletions
|
@ -39,6 +39,11 @@ SkeletonViewer::SkeletonViewer(DataStore *data)
|
||||||
inc_frame = false;
|
inc_frame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double winkel_to_bogenmass(float v)
|
||||||
|
{
|
||||||
|
return (v * 2 * PI) / 360;
|
||||||
|
}
|
||||||
|
|
||||||
void draw_dof(Bone *node, Vec4 start_point)
|
void draw_dof(Bone *node, Vec4 start_point)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -53,14 +58,14 @@ void draw_dof(Bone *node, Vec4 start_point)
|
||||||
double upper_limit = node->get_dof(i)->get_upper_limit();
|
double upper_limit = node->get_dof(i)->get_upper_limit();
|
||||||
|
|
||||||
// lowerlimit
|
// lowerlimit
|
||||||
auto abs_lower_limit = std::abs(lower_limit);
|
auto bog_lower_limit = winkel_to_bogenmass(lower_limit);
|
||||||
auto tan_lower_limit = std::tan(abs_lower_limit);
|
auto tan_lower_limit = std::tan(bog_lower_limit);
|
||||||
auto cos_lower_limit = std::cos(lower_limit);
|
auto cos_lower_limit = std::cos(bog_lower_limit);
|
||||||
|
|
||||||
// upperlimit
|
// upperlimit
|
||||||
auto abs_upper_limit = std::abs(upper_limit);
|
auto bog_upper_limit = winkel_to_bogenmass(upper_limit);
|
||||||
auto tan_upper_limit = std::tan(abs_upper_limit);
|
auto tan_upper_limit = std::tan(bog_upper_limit);
|
||||||
auto cos_upper_limit = std::cos(upper_limit);
|
auto cos_upper_limit = std::cos(bog_upper_limit);
|
||||||
|
|
||||||
auto pt_min = bonelength * cos_lower_limit;
|
auto pt_min = bonelength * cos_lower_limit;
|
||||||
auto pt_max = bonelength * cos_upper_limit;
|
auto pt_max = bonelength * cos_upper_limit;
|
||||||
|
|
Loading…
Reference in a new issue