19class PlayerSwayConstants
98 m_SwayModifier = weapon.GetPropertyModifierObject().m_SwayModifiers;
161 float breathing_offset_x;
162 float breathing_offset_y;
164 float noise_offset_x;
165 float noise_offset_y;
167 float shake_offset_x;
168 float shake_offset_y;
170 float recoil_offset_mouse_x;
171 float recoil_offset_mouse_y;
173 float recoil_offset_hands_x;
174 float recoil_offset_hands_y;
180 float player_stamina =
m_PlayerPb.GetStaminaHandler().GetSyncedStaminaNormalized();
191 float speed = (((1.0 - player_stamina) * 3.0) + 1.0) *
m_SwayModifier[2];
213 if (shake_level != 0)
215 ApplyShakes(shake_offset_x, shake_offset_y, shake_level);
221 m_CurrentRecoil.
Update(pModel, recoil_offset_mouse_x, recoil_offset_mouse_y, recoil_offset_hands_x, recoil_offset_hands_y, pDt);
230 pModel.
m_fAimXHandsOffset = breathing_offset_x + noise_offset_x + recoil_offset_hands_x + shake_offset_x + kuru_offset_x;
231 pModel.
m_fAimYHandsOffset = breathing_offset_y + noise_offset_y + recoil_offset_hands_y + shake_offset_y + kuru_offset_y;
306 if (time < PlayerSwayConstants.SWAY_TIME_IN)
309 max = PlayerSwayConstants.SWAY_TIME_IN;
313 else if (time >= PlayerSwayConstants.SWAY_TIME_IN && time < (PlayerSwayConstants.SWAY_TIME_IN + PlayerSwayConstants.SWAY_TIME_STABLE))
316 ret = PlayerSwayConstants.SWAY_MULTIPLIER_STABLE;
321 max = PlayerSwayConstants.SWAY_TIME_EXHAUSTED;
323 ret =
Math.
Lerp(PlayerSwayConstants.SWAY_MULTIPLIER_STABLE,PlayerSwayConstants.SWAY_MULTIPLIER_EXHAUSTED,(time_clamped/max));
329 max = PlayerSwayConstants.SWAY_TIME_OUT;
355 protected void ApplyBreathingPattern(out
float x_axis, out
float y_axis,
float pAmplitude,
float pTotalTime,
float weight)
367 x_axis = (
Math.
Sin(pTotalTime) * pAmplitude / 4) * weight;
368 y_axis = (
Math.
Sin((pTotalTime) * 0.8 + 0.6 ) * pAmplitude) * weight;
376 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)
394 protected void ApplyShakes(out
float x_axis, out
float y_axis,
int level)
396 float weight = level /
PlayerBase.SHAKE_LEVEL_MAX;
409 protected float CalculateWeight(
int stance_index,
float current_stamina,
float camera_sway_modifier,
bool holding_breath)
413 return PlayerSwayConstants.SWAY_ROLL;
415 float stance_modifier;
417 switch ( stance_index )
420 stance_modifier = 0.5;
423 stance_modifier = 0.75;
426 stance_modifier = 0.9;
429 stance_modifier = 0.75;
447 Print(
"DayZPlayerImplementAiming | " + val);
static const float SWAY_TIME_OUT
enum eSwayStates SWAY_MULTIPLIER_DEFAULT
static const float SWAY_TIME_EXHAUSTED
static const float SWAY_MULTIPLIER_STABLE
static const float SWAY_ROLL
static const float SWAY_TIME_IN
static const float SWAY_MULTIPLIER_EXHAUSTED
static const float SWAY_TIME_STABLE
private void DayZPlayerUtils()
cannot be instantiated
Super root of all classes in Enforce script.
protected void ApplyShakes(out float x_axis, out float y_axis, int level)
protected float m_HorizontalNoise
void SetRecoil(Weapon_Base weapon)
protected float m_CamShakeX
protected bool UpdateSwayState(int state)
protected float m_CamShakeY
protected vector m_SwayModifier
void OnSwayStateChange(int state)
void OnRaiseBegin(DayZPlayerImplement player)
protected float m_FilterVelocityStealthAimY[1]
protected float m_SwayWeight
protected float m_HorizontalTargetValue
void DayZPlayerImplementAiming(DayZPlayerImplement player)
protected float CalculateSwayMultiplier()
protected float m_LastSwayMultiplier
protected bool m_ProceduralRecoilEnabled
protected int m_ShakeCount
protected bool m_AimNoiseAllowed
bool IsProceduralRecoilEnabled()
void RequestKuruShake(float amount)
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)
protected PlayerBase m_PlayerPb
bool ProcessAimFilters(float pDt, SDayZPlayerAimingModel pModel, int stance_index)
void SetAimNoiseAllowed(bool state)
protected float m_StateStartSwayMultiplier
bool ProcessStealthFilters(float pDt, SDayZPlayerAimingModel pModel)
protected float m_HorizontalNoiseXAxisOffset
protected int m_SwayState
protected DayZPlayerImplement m_PlayerDpi
protected ref KuruShake m_KuruShake
protected float m_BreathingXAxisOffset
protected bool m_HoldingBreathSet
void OnFinisherBegin(float currentAimY)
protected ref RecoilBase m_CurrentRecoil
protected float m_BreathingYAxisOffset
protected float m_TotalTime
protected float CalculateWeight(int stance_index, float current_stamina, float camera_sway_modifier, bool holding_breath)
protected float m_HorizontalNoiseVelocity[1]
void DbgPrintAimingImplement(string val)
void SetProceduralRecoilEnabled(bool state)
protected float m_StealthAimY_Last
protected float m_ReferenceTime
protected float m_MaxVelocity
protected float m_SwayStateStartTime
int GetCurrentSwayState()
void SetCamShakeValues(float x_axis, float y_axis)
protected void ApplyBreathingPattern(out float x_axis, out float y_axis, float pAmplitude, float pTotalTime, float weight)
static protected float m_AimXClampRanges[]
protected const float SWAY_WEIGHT_SCALER
void Update(float delta_time, out float pos_x, out float pos_y)
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)
override RecoilBase SpawnRecoilObject()
DayZPlayerConstants
defined in C++
proto void Print(void var)
Prints content of variable to console/log.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
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.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto float Sin(float angle)
Returns sinus of angle in radians.