19class PlayerSwayConstants
99 m_SwayModifier = weapon.GetPropertyModifierObject().m_SwayModifiers;
162 float breathing_offset_x;
163 float breathing_offset_y;
165 float noise_offset_x;
166 float noise_offset_y;
168 float shake_offset_x;
169 float shake_offset_y;
171 float recoil_offset_mouse_x;
172 float recoil_offset_mouse_y;
174 float recoil_offset_hands_x;
175 float recoil_offset_hands_y;
180 float player_stamina =
m_PlayerPb.GetStaminaHandler().GetSyncedStaminaNormalized();
214 if (shake_level != 0)
216 ApplyShakes(shake_offset_x, shake_offset_y, shake_level);
222 m_CurrentRecoil.Update(pModel, recoil_offset_mouse_x, recoil_offset_mouse_y, recoil_offset_hands_x, recoil_offset_hands_y, pDt);
227 m_KuruShake.Update(pDt, kuru_offset_x, kuru_offset_y);
231 pModel.
m_fAimXHandsOffset = breathing_offset_x + noise_offset_x + recoil_offset_hands_x + shake_offset_x + kuru_offset_x;
232 pModel.
m_fAimYHandsOffset = breathing_offset_y + noise_offset_y + recoil_offset_hands_y + shake_offset_y + kuru_offset_y;
324 ret = PlayerSwayConstants.SWAY_MULTIPLIER_STABLE;
331 ret =
Math.
Lerp(PlayerSwayConstants.SWAY_MULTIPLIER_STABLE,PlayerSwayConstants.SWAY_MULTIPLIER_EXHAUSTED,(time_clamped/max));
337 max = PlayerSwayConstants.SWAY_TIME_OUT;
368 protected void ApplyBreathingPattern(out
float x_axis, out
float y_axis,
float pAmplitude,
float pTotalTime,
float weight)
380 x_axis = (
Math.
Sin(pTotalTime) * pAmplitude / 4) * weight;
381 y_axis = (
Math.
Sin((pTotalTime) * 0.8 + 0.6) * pAmplitude) * weight;
389 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)
407 protected void ApplyShakes(out
float x_axis, out
float y_axis,
int level)
409 float weight = level /
PlayerBase.SHAKE_LEVEL_MAX;
422 protected float CalculateWeight(
int stance_index,
float current_stamina,
float camera_sway_modifier,
bool holding_breath)
426 return PlayerSwayConstants.SWAY_ROLL;
428 float stance_modifier;
429 switch (stance_index)
432 stance_modifier = 0.5;
435 stance_modifier = 0.75;
438 stance_modifier = 0.9;
441 stance_modifier = 0.75;
459 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
void DayZPlayerUtils()
cannot be instantiated
Super root of all classes in Enforce script.
int GetCurrentSwayState()
float m_StaminaPercentage
ref KuruShake m_KuruShake
static float m_AimXClampRanges[]
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
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)
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 Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
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 Sin(float angle)
Returns sinus of angle in radians.
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.