151 {
152 float target = 0.0;
153
155 {
157 pAngle = target;
158
160 }
161 else
162 {
164 {
166
168 }
169 else
170 {
172 pAngleAdd = pAngle + pAngleAdd - target;
173 pAngle = target;
174
176 if (player)
177 {
178 float pitch = pAngle + pAngleAdd;
179 float downLimit, upLimit, leftLimit, rightLimit;
180 player.GetLookLimits(downLimit, upLimit, leftLimit, rightLimit);
181
182 if (pitch < (upLimit + 1) && pitch > (downLimit - 1))
183 {
184 pMin = downLimit;
185 pMax = upLimit;
186 }
187 else
188 {
190 pMin =
Math.
SmoothCD(pitch, downLimit, velMin, 0.2, 1000, pDt);
191
193 pMax =
Math.
SmoothCD(pitch, upLimit, velMax, 0.2, 1000, pDt);
194 }
195 }
196
198 }
199
201 {
203 }
204 }
205
206 pAngle =
Limit(pAngle, pMin, pMax);
207 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
208
209 return pAngle + pAngleAdd;
210 }
HumanCommandWeapons m_CommandWeapons
HumanInputController m_pInput
human input
static const float RAD2DEG
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.