131 {
133
135 {
137 pAngle = target;
138
140 }
141 else
142 {
144 {
145 pAngleAdd = pAngle + pAngleAdd - target;
146 pAngle = target;
147 }
148
150 {
152
154 }
155 else
156 {
158 if (player)
159 {
160 float pitch = pAngle + pAngleAdd;
161 float downLimit, upLimit, leftLimit, rightLimit;
162 player.GetLookLimits(downLimit, upLimit, leftLimit, rightLimit);
163
164 if (pitch < (upLimit + 1) && pitch > (downLimit - 1))
165 {
166 pMin = downLimit;
167 pMax = upLimit;
168 }
169 else
170 {
172 pMin =
Math.
SmoothCD(pitch, downLimit, vel, 0.2, 1000, pDt);
173 pMax =
Math.
SmoothCD(pitch, upLimit, vel, 0.2, 1000, pDt);
174 }
175 }
176
178 }
179
181 {
183 }
184 }
185
186 pAngle =
Limit(pAngle, pMin, pMax);
187 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
188 return pAngle + pAngleAdd;
189 }
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.