我在一条腿移动的XNA C#中制作一个简单的动画。这是大腿的逻辑代码。它意味着摆动从25'到335'。然而,它会碰到一个点,然后继续向另一个方向旋转。请帮忙,这是代码:
private void Thigh_method()
{
if (Legdata.Left == true)
signvalue = -0.05f;
else
signvalue = 0.05f;
if (Legdata.ToMid == true)
Thighturn_ang += signvalue;
if (Legdata.ToMid == false)
Thighturn_ang -= signvalue;
if (Thighturn_ang <= 25 || Thighturn_ang <= 335 && Thighturn_ang <= 180)
Legdata.Left = true;
if (Thighturn_ang >= 25 || Thighturn_ang >= 335 && Thighturn_ang >= 180)
Legdata.Left = false;
if (Thighturn_ang == 0)
Legdata.ToMid = false;
if (Math.Abs(Thighturn_ang) >= 25f)
Legdata.ToMid = true;
}
提前致谢,你的:
莫纳