164 float breathing_offset_x;
165 float breathing_offset_y;
167 float noise_offset_x;
168 float noise_offset_y;
170 float shake_offset_x;
171 float shake_offset_y;
173 float recoil_offset_mouse_x;
174 float recoil_offset_mouse_y;
176 float recoil_offset_hands_x;
177 float recoil_offset_hands_y;
182 float player_stamina =
m_PlayerPb.GetStaminaHandler().GetSyncedStaminaNormalized();
219 if (shake_level != 0)
221 ApplyShakes(shake_offset_x, shake_offset_y, shake_level);
227 m_CurrentRecoil.Update(pModel, recoil_offset_mouse_x, recoil_offset_mouse_y, recoil_offset_hands_x, recoil_offset_hands_y, pDt);
232 m_KuruShake.Update(pDt, kuru_offset_x, kuru_offset_y);
236 pModel.m_fAimXHandsOffset = breathing_offset_x + noise_offset_x + recoil_offset_hands_x + shake_offset_x + kuru_offset_x;
237 pModel.m_fAimYHandsOffset = breathing_offset_y + noise_offset_y + recoil_offset_hands_y + shake_offset_y + kuru_offset_y;
248 pModel.m_fAimXCamOffset = -shake_offset_x - recoil_offset_hands_x - kuru_offset_x +
m_CamShakeX;
249 pModel.m_fAimYCamOffset = -shake_offset_y - recoil_offset_hands_y - kuru_offset_y +
m_CamShakeY;
260 float newVal = DayZPlayerUtils.LinearRangeClamp(pModel.m_fCurrentAimX, pModel.m_fCurrentAimY,
m_AimXClampRanges);
261 pModel.m_fAimYHandsOffset += newVal - pModel.m_fCurrentAimY;
263 float absAimY =
Math.AbsFloat(pModel.m_fCurrentAimY);
264 pModel.m_fAimYHandsOffset =
Math.Clamp(pModel.m_fAimYHandsOffset,absAimY - 89.9,89.9 - absAimY);
271 pModel.m_fAimXMouseShift = recoil_offset_mouse_x -kuru_offset_x / 10;
272 pModel.m_fAimYMouseShift = recoil_offset_mouse_y + kuru_offset_y / 10;
329 ret = PlayerSwayConstants.SWAY_MULTIPLIER_STABLE;
336 ret =
Math.Lerp(PlayerSwayConstants.SWAY_MULTIPLIER_STABLE,PlayerSwayConstants.SWAY_MULTIPLIER_EXHAUSTED,(time_clamped/max));
342 max = PlayerSwayConstants.SWAY_TIME_OUT;
412 protected void ApplyShakes(out
float x_axis, out
float y_axis,
int level)
414 float weight = level /
PlayerBase.SHAKE_LEVEL_MAX;