19class PlayerSwayConstants
22 static const float SWAY_MULTIPLIER_STABLE = 0.05;
23 static const float SWAY_MULTIPLIER_EXHAUSTED = 0.6;
24 static const float SWAY_TIME_IN = 1.5;
25 static const float SWAY_TIME_STABLE = 3.0;
26 static const float SWAY_TIME_EXHAUSTED = 1.5;
27 static const float SWAY_TIME_OUT = 0.5;
28 static const float SWAY_ROLL = 3;
29 static const float HOLD_BREATH_STAMINA_THRESHOLD = 0.5;
101 m_SwayModifier = weapon.GetPropertyModifierObject().m_SwayModifiers;
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;
373 protected void ApplyBreathingPattern(out
float x_axis, out
float y_axis,
float pAmplitude,
float pTotalTime,
float weight)
385 x_axis = (
Math.Sin(pTotalTime) * pAmplitude / 4) * weight;
386 y_axis = (
Math.Sin((pTotalTime) * 0.8 + 0.6) * pAmplitude) * weight;
394 protected void ApplyHorizontalNoise(out
float x_axis, out
float y_axis,
float smooth_time,
float max_velocity_low,
float max_velocity_high,
float velocity_modifier,
float max_distance,
float weight,
float pDt)
412 protected void ApplyShakes(out
float x_axis, out
float y_axis,
int level)
414 float weight = level /
PlayerBase.SHAKE_LEVEL_MAX;
427 protected float CalculateWeight(
int stance_index,
float current_stamina,
float camera_sway_modifier,
bool holding_breath)
431 return PlayerSwayConstants.SWAY_ROLL;
433 float stance_modifier;
434 switch (stance_index)
437 stance_modifier = 0.5;
440 stance_modifier = 0.75;
443 stance_modifier = 0.925;
446 stance_modifier = 0.75;
464 Print(
"DayZPlayerImplementAiming | " + val);
Super root of all classes in Enforce script.
at which point does the stabilization start to get affected
int GetCurrentSwayState()
float m_StaminaPercentage
ref KuruShake m_KuruShake
static float m_AimXClampRanges[]
float m_HoldBreathSwayCoef
stamina percentage at hold breath start
float CalculateWeight(int stance_index, float current_stamina, float camera_sway_modifier, bool holding_breath)
float m_HorizontalNoiseXAxisOffset
void DayZPlayerImplementAiming(DayZPlayerImplement player)
void DbgPrintAimingImplement(string val)
float CalculateSpeedMultiplier(float stamina)
void SetProceduralRecoilEnabled(bool state)
bool UpdateSwayState(int state)
void SetCamShakeValues(float x_axis, float y_axis)
void ApplyShakes(out float x_axis, out float y_axis, int level)
void RequestKuruShake(float amount)
const float SWAY_WEIGHT_SCALER
void SetAimNoiseAllowed(bool state)
float m_SwayStateStartTime
proportionally shortens de/stabilization process and duration. Also affects stamina consumption (temp...
ref RecoilBase m_CurrentRecoil
void SetRecoil(Weapon_Base weapon)
bool IsProceduralRecoilEnabled()
float m_StateStartSwayMultiplier
float m_HorizontalNoiseVelocity[1]
void ApplyBreathingPattern(out float x_axis, out float y_axis, float pAmplitude, float pTotalTime, float weight)
float m_LastSwayMultiplier
bool ProcessStealthFilters(float pDt, SDayZPlayerAimingModel pModel)
void OnRaiseBegin(DayZPlayerImplement player)
float m_BreathingXAxisOffset
float m_HorizontalTargetValue
bool ProcessAimFilters(float pDt, SDayZPlayerAimingModel pModel, int stance_index)
void OnFinisherBegin(float currentAimY)
float m_BreathingYAxisOffset
float m_FilterVelocityStealthAimY[1]
DayZPlayerImplement m_PlayerDpi
bool m_ProceduralRecoilEnabled
float CalculateSwayMultiplier()
void ApplyHorizontalNoise(out float x_axis, out float y_axis, float smooth_time, float max_velocity_low, float max_velocity_high, float velocity_modifier, float max_distance, float weight, float pDt)
void OnSwayStateChange(int state)
void Update(SDayZPlayerAimingModel pModel, out float axis_mouse_x, out float axis_mouse_y, out float axis_hands_x, out float axis_hands_y, float pDt)
DayZPlayerConstants
defined in C++
enum eSwayStates SWAY_MULTIPLIER_DEFAULT
proto void Print(void var)
Prints content of variable to console/log.