130 {
132
134 {
136 pAngle = target;
137
139 }
140 else
141 {
143 {
144 pAngleAdd = pAngle + pAngleAdd - target;
145 pAngle = target;
146 }
147
149 {
151
153 }
154 else
155 {
157 if (player)
158 {
159 float pitch = pAngle + pAngleAdd;
160 float downLimit, upLimit, leftLimit, rightLimit;
161 player.GetLookLimits(downLimit, upLimit, leftLimit, rightLimit);
162
163 if (pitch < (upLimit + 1) && pitch > (downLimit - 1))
164 {
165 pMin = downLimit;
166 pMax = upLimit;
167 }
168 else
169 {
171 pMin =
Math.
SmoothCD(pitch, downLimit, vel, 0.2, 1000, pDt);
172 pMax =
Math.
SmoothCD(pitch, upLimit, vel, 0.2, 1000, pDt);
173 }
174 }
175
177 }
178
180 {
182 }
183 }
184
185 pAngle =
Limit(pAngle, pMin, pMax);
186 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
187 return pAngle + pAngleAdd;
188 }
HumanCommandWeapons m_CommandWeapons
HumanInputController m_pInput
human input
static const float RAD2DEG
static proto float AbsFloat(float f)
Returns absolute value.
static proto float SmoothCD(float val, float target, inout float velocity[], float smoothTime, float maxVelocity, float dt)
Does the CD smoothing function - easy in | easy out / S shaped smoothing.