68 {
69 float aDiff = pModel.m_fHeadingAngle - pModel.m_fOrientationAngle;
70
71 while (aDiff < -Math.PI)
72 {
73 aDiff += Math.PI2;
74 }
75 while (aDiff > Math.PI)
76 {
77 aDiff -= Math.PI2;
78 }
79
80
81
82 if (pLastHeadingDiff < -Math.PI_HALF && aDiff > 0)
83 {
84 aDiff -= Math.PI2;
85 }
86 else if (pLastHeadingDiff > Math.PI_HALF && aDiff < 0)
87 {
88 aDiff += Math.PI2;
89 }
90
91 pLastHeadingDiff = aDiff;
93 {
94
96 {
97 pLastHeadingDiff = 0;
98 return false;
99 }
100
102 return true;
103 }
105 {
106
108 {
109 pLastHeadingDiff = 0;
110 return false;
111 }
112
114 return true;
115 }
116
117
118 return false;
119
120 }
static float CONST_ROTLIMIT