![]() |
Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
|
Data Structures | |
| class | Math |
Functions | |
| void | Math () |
| void | ~Math () |
| static proto float | AbsFloat (float f) |
| Returns absolute value. | |
| static proto int | AbsInt (int i) |
| Returns absolute value. | |
| static proto float | Acos (float c) |
| Returns angle in radians from cosinus. | |
| static proto float | AreaOfRightTriangle (float s, float a) |
| Returns area of a right triangle. | |
| static proto float | Asin (float s) |
| Returns angle in radians from sinus. | |
| static proto float | Atan (float x) |
| Returns angle in radians from tangent. | |
| static proto float | Atan2 (float y, float x) |
| Returns angle in radians from tangent. | |
| static proto float | Ceil (float f) |
| Returns ceil of value. | |
| static vector | CenterOfRectangle (vector min, vector max) |
| 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 | Cos (float angle) |
| Returns cosinus of angle in radians. | |
| static proto float | DiffAngle (float angle1, float angle2) |
| Return relative difference between angles. | |
| static int | Factorial (int val) |
| values above '12' will cause int overflow | |
| static proto float | Floor (float f) |
| Returns floor of value. | |
| static proto int | GetNthBitSet (int value, int n) |
| returns the the index of n-th bit set in a bit mask counting from the right, for instance, in a mask ..0110 1000 , the 0th set bit(right-most bit set to 1) is at 3th position(starting at 0), 1st bit is at 5th position, 2nd bit is at 6th position etc.. | |
| static proto int | GetNumberOfSetBits (int i) |
| returns the number of bits set in a bitmask i | |
| static proto float | HypotenuseOfRightTriangle (float s, float a) |
| Returns hypotenus of a right triangle. | |
| static proto float | InverseLerp (float a, float b, float value) |
| Calculates the linear value that produces the interpolant value within the range [a, b], it's an inverse of Lerp. | |
| static proto bool | IsInRange (float v, float min, float max) |
| Returns if value is between min and max (inclusive). | |
| static proto bool | IsInRangeInt (int v, int min, int max) |
| Returns if value is between min and max (inclusive). | |
| static proto bool | IsPointInCircle (vector c, float r, vector p) |
| Returns if point is inside circle. | |
| static proto bool | IsPointInRectangle (vector mi, vector ma, vector p) |
| Returns if point is inside rectangle. | |
| static proto float | Lerp (float a, float b, float time) |
| Linearly interpolates between 'a' and 'b' given 'time'. | |
| static proto float | Log2 (float x) |
| Returns the binary (base-2) logarithm of x. | |
| static proto float | Max (float x, float y) |
| Returns bigger of two given values. | |
| static proto float | Min (float x, float y) |
| Returns smaller of two given values. | |
| static proto float | ModFloat (float x, float y) |
| Returns the floating-point remainder of x/y rounded towards zero. | |
| static proto float | NormalizeAngle (float ang) |
| Normalizes the angle (0...360). | |
| static float | Poisson (float mean, int occurences) |
| occurences values above '12' will cause Factorial to overflow int. | |
| static proto float | Pow (float v, float power) |
| Return power of v ^ power. | |
| static bool | RandomBool () |
Returns a random bool . | |
| static proto float | RandomFloat (float min, float max) |
Returns a random float number between and min[inclusive] and max[exclusive]. | |
| static float | RandomFloat01 () |
Returns a random float number between and min [inclusive] and max [inclusive]. | |
| static float | RandomFloatInclusive (float min, float max) |
Returns a random float number between and min [inclusive] and max [inclusive]. | |
| static proto int | RandomInt (int min, int max) |
Returns a random int number between and min [inclusive] and max [exclusive]. | |
| static int | RandomIntInclusive (int min, int max) |
Returns a random int number between and min [inclusive] and max [inclusive]. | |
| static proto int | Randomize (int seed) |
| Sets the seed for the random number generator. | |
| static proto float | RemainderFloat (float x, float y) |
| Returns the floating-point remainder of x/y rounded to nearest. | |
| static float | Remap (float inputMin, float inputMax, float outputMin, float outputMax, float inputValue, bool clampedOutput=true) |
| Returns given value remaped from input range into output range. | |
| static proto float | Round (float f) |
| Returns mathematical round of value. | |
| static proto float | SignFloat (float f) |
| Returns sign of given value. | |
| static proto int | SignInt (int i) |
| Returns sign of given value. | |
| static proto float | Sin (float angle) |
| Returns sinus of angle in radians. | |
| 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 float | SmoothCDPI2PI (float val, float target, inout float velocity[], float smoothTime, float maxVelocity, float dt) |
| static proto float | SqrFloat (float f) |
| Returns squared value. | |
| static proto int | SqrInt (int i) |
| Returns squared value. | |
| static proto float | Sqrt (float val) |
| Returns square root. | |
| static proto float | Tan (float angle) |
| Returns tangent of angle in radians. | |
| static bool | VectorIsEqual (vector v1, vector v2, float tolerance) |
| Returns if given vectors are equal with given tolerance. | |
| static proto float | WrapFloat (float f, float min, float max) |
| Returns wrap number to specified interval [min, max[. | |
| static proto float | WrapFloat0X (float f, float max) |
| Returns wrap number to specified interval [0, max[. | |
| static proto float | WrapFloat0XInclusive (float f, float max) |
| Returns wrap number to specified interval, inclusive [0, max]. | |
| static proto float | WrapFloatInclusive (float f, float min, float max) |
| Returns wrap number to specified interval, inclusive [min, max]. | |
| static proto int | WrapInt (int i, int min, int max) |
| Returns wrap number to specified interval [min, max[. | |
| static proto int | WrapInt0X (int i, int max) |
| Returns wrap number to specified interval [0, max[. | |
Variables | |
| static const float | DEG2RAD = 0.01745329251994329577 |
| static const float | EULER = 2.7182818284590452353 |
| static const float | PI = 3.14159265358979 |
| static const float | PI2 = 6.28318530717958 |
| static const float | PI_HALF = 1.570796326794 |
| static const float | RAD2DEG = 57.2957795130823208768 |
|
inlineprivate |
Definition at line 8 of file enmath.c.
Referenced by RandomFloatInclusive(), RandomIntInclusive(), Remap(), SmoothCDPI2PI(), and VectorIsEqual().
Returns absolute value.
| f | float Value |
float - Absolute value Referenced by DayZIntroScenePC::DayZIntroScenePC(), ActionCondition(), ActionEnterLadder::ActionCondition(), ActionFillBrakes::ActionCondition(), SoftSkillsManager::AddSpecialty(), DayZPlayerImplementAiming::ApplyHorizontalNoise(), Math3D::BoxSize(), WorldData::CalcBaseEnvironmentTemperature(), CalculateEyeAcco(), CCTWaterSurface::Can(), DebugMonitorValues::CheckBlood(), Managed::CheckBlood(), DebugMonitorValues::CheckHealth(), Managed::CheckHealth(), BaseBuildingBase::CheckMemoryPointVerticalDistance(), DayZPlayerImplementHeading::ClampAngle(), StaminaHandler::DepleteStaminaEx(), Car::EOnPostSimulate(), EvaluateComponentEx(), EvaluateHit_Player(), EntityLightSource::FadeBrightnessTo(), EntityLightSource::FadeRadiusTo(), DayZInfected::FightLogic(), FilterObstructedObjectsByGrouping(), Weapon::GetApproximateMovementOffset(), Weapon_Base::GetApproximateMovementOffset(), DayZInfected::GetAttackPitch(), GetCollisionBoxSize(), GetEnvironmentTemperature(), GetMeleeTargetEx(), ActionTargetsCursor::GetOnScreenPosition(), SoftSkillsManager::GetPreciseRoughLevels(), GetRadius(), Transport::GetSpeedometerAbsolute(), DayZInfected::HandleMove(), DayZPlayer::HandleView(), DayZPlayer::HandleWeapons(), InitData(), AttachmentsOutOfReach::IsAttachmentReachable(), Hologram::IsBaseFlat(), Hologram::IsCollidingAngle(), BaseBuildingBase::IsFacingPlayer(), ManBase::IsFacingTarget(), IsPlayerOrientedTowardPos(), PointLightBase::OnFrameLightSource(), Car::OnInput(), InventoryActionHandler::OnUpdate(), OnUpdate(), DayZPlayerImplementAiming::ProcessAimFilters(), ProcessHeatComfort(), ManBase::SendLiftWeaponSync(), Set(), Weapon_Base::SetCylinderRotationAnimationPhase(), EntityLightSource::SetDancingShadowsAmplitude(), EntityLightSource::SetDancingShadowsMovementSpeed(), PPERequester_GameplayBase::SetEffectProgress(), EntityLightSource::SetFlickerAmplitude(), Hologram::SmoothProjectionMovement(), EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncTimeData(), AnimationTimer::Tick(), AnimatorTimer::Tick(), ScriptedWidgetEventHandler::Update(), UIScriptedMenu::Update(), WeaponManager::Update(), UpdateLRAngleUnlocked(), BoatHud::UpdateSpeedPointer(), UpdateUDAngle(), UpdateUDAngleUnlocked(), UniversalTemperatureSourceLambdaBaseImpl::UpdateVicinityTemperatureRecursive(), and UniversalTemperatureSourceLambdaBaseImpl::WarmAndCoolItemsInVicinity().
Returns absolute value.
| i | int Value |
int - Absolute value Referenced by PluginBase::ActivateModifier(), SoftSkillsManager::AddExponentialPrecise(), SoftSkillsManager::AddExponentialRough(), ManBase::CanChangeStance(), BoatScript::CheckContactCache(), Car::CheckContactCache(), PluginBase::DeactivateModifier(), Hud::DisplayNotifier(), ManBase::GetBrokenLegs(), GetTemperatureColor(), DayZInfected::HandleOrientation(), DayZPlayer::HandleView(), PluginBase::IsModifierLocked(), PluginBase::LockModifier(), HealthMdfr::OnTick(), OrderedPositionNumbersFromGridCoords(), CarHud::RefreshVehicleHud(), PlayerAgentPool::RemoteGrowRequestDebug(), PluginBase::RequestDetailedInfo(), AutoHeightSpacer::Update(), ManBase::UpdateCorpseState(), and ManBase::UpdateCorpseStateVisual().
Returns angle in radians from cosinus.
| c | float Cosinus |
float - Angle in radians Referenced by ActionCreateIndoorFireplace::ActionCondition(), ActionCreateIndoorOven::ActionCondition(), ActionPlaceFireplaceIndoor::ActionCondition(), ActionPlaceOvenIndoor::ActionCondition(), DayZInfected::ComputeHitDirectionAngle(), DayZCreatureAI::ComputeHitDirectionAngleDeg(), DayZInfected::ComputeHitDirectionAngleEx(), DropAllItemsInInventoryInBounds(), DayZPlayer::EvaluateDamageHitAnimation(), DayZPlayer::EvaluateDeathAnimation(), IsEntityBehindEntityInAngle(), BaseBuildingBase::IsFacingCamera(), BaseBuildingBase::IsFacingPlayer(), IsPlayerOrientedTowardPos(), Weapon::LiftWeaponCheckEx(), and OnAttachmentRuined().
Returns area of a right triangle.
| s | float Length of adjacent leg |
| a | float Angle of corner bordering adjacent which is not the right corner (in radians) |
float - Area Returns angle in radians from sinus.
| s | float Sinus |
float - Angle in radians Referenced by Easing::EaseInElastic(), Easing::EaseInOutElastic(), and Easing::EaseOutElastic().
Returns angle in radians from tangent.
| x | float Tangent |
float - Angle in radians References x.
Referenced by PoweredOptic_Base::DoMeasurement(), and PPERequester_GameplayBase::SetEffectProgress().
Returns angle in radians from tangent.
| y | float Tangent |
| x | float Tangent |
float - Angle in radians Referenced by DayZIntroScene::DayZIntroScene(), GetMousePointerAngle(), DayZInfected::HandleOrientation(), MeleeTargetSettings(), and PluginBase::OnUpdate().
Returns ceil of value.
| f | float Value |
float - Ceil of value Referenced by OutdoorThermometerManager::Add(), ActionTargetsCursor::BuildFloatingCursor(), BleedChanceData::CalculateBleedChance(), CAContinuousMineWood::CreateSecondaryItems(), RecipeBase::Do(), CatchingContextFishingRodAction::GetSignalMax(), CatchingContextPoissonBase::GetSignalMax(), Init(), Attachments::InitAttachmentGrid(), ServerBrowserTabConsolePages::LoadExtraEntries(), UIScriptedMenu::NextPrevPage(), ScriptedWidgetEventHandler::OnUpdate(), UIScriptedMenu::ProcessDistanceAndUnits(), OutdoorThermometerManager::Remove(), Container::UpdateRowVisibility(), and FlammableBase::Upgrade().
Definition at line 751 of file enmath.c.
Referenced by RefreshTracksCache().
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
| value | float Value |
| min | float Minimum value |
| max | float Maximum value |
float - Clamped value Referenced by ShockDealtEffect::ShockDealtEffect(), Chat::Add(), ShockHandler::AddEffectBobbing(), ComponentEnergyManager::AddEnergy(), SoftSkillsManager::AddExponentialPrecise(), SoftSkillsManager::AddExponentialRough(), IEntity::AddHealthLevel(), SoftSkillsManager::AddLinearPrecise(), SoftSkillsManager::AddLinearRough(), BaseBuildingBase::AddRefresherTime01(), AddWetnessToFireplace(), AddWetnessToItem(), AdjustCameraParameters(), ItemBase::AdjustDetectionRange(), ActionRepairVehiclePartBase::AdjustVehicleHealthServer(), Bottle_Base::AffectLiquidContainerOnFill(), FilteringBottle::AffectLiquidContainerOnFill(), Bottle_Base::AffectLiquidContainerOnTransfer(), FilteringBottle::AffectLiquidContainerOnTransfer(), Hologram::AlignProjectionOnTerrain(), BaseBuildingBase::AnimateFlagEx(), RecoilBase::ApplyCamOffset(), RecoilBase::ApplyHandsOffset(), RecoilBase::ApplyMouseOffset(), Weapon::ApproximateWeaponLiftTransform(), InfluenzaAgent::AutoinfectCheck(), ShockHandler::BaseEffectIntensityCalc(), HitDirectionEffectBase::CalculateArrowPosition(), CalculateBreadCrumbs(), GameplayEffectWidgets_base::CalculateBreathEffect(), PluginBase::CalculateHealth(), DayZPlayerImplementAiming::CalculateSwayMultiplier(), ChernarusPlusData::CalculateVolFog(), EnochData::CalculateVolFog(), RecipeBase::CanDo(), Managed::CheckBlood(), ManBase::CheckLiftWeapon(), DayZPlayerImplementHeading::ClampAngle(), Barrel_ColorBase::ColourClothes(), WorldData::ComputeSnowflakeScale(), Cooling(), Car::DamageCrew(), DecreaseCookedItemQuantity(), UIScriptedMenu::DeleteKeyframe(), StaminaHandler::DepleteStaminaEx(), WrittenNoteData::DepleteWritingImplement(), InjurySoundHandlerBase::DetermineInjuryZone(), Hud::DisplayNotifier(), Hud::DisplayTendencyNormal(), RecipeBase::Do(), WeaponDebug::DrawLineOfFireCameraHybrid(), UniversalTemperatureSourceLambdaBaseImpl::DryItemsInVicinity(), EOnPostSimulate(), ItemBase::Fertilize(), CAContinuousFertilizeGardenSlot::FertilizeSlot(), PPEffects::FlashbangEffect(), ManBase::FreezeCheck(), ConstructionActionData::GetActualAttachmentToDetach(), GetAirResistanceForSmokeParticles(), Weapon::GetApproximateMovementOffset(), Weapon_Base::GetApproximateMovementOffset(), CatchingContextFishingRodAction::GetBaitLossChanceModifierClamped(), HeatComfortAnimHandler::GetEventTime(), ItemBase::GetFuel(), ManBase::GetHealthRegenSpeed(), CatchingContextFishingRodAction::GetHookLossChanceModifierClamped(), ManBase::GetImmunity(), CAContinuousQuantityEdible::GetProgress(), Hologram::GetProjectionEntityPosition(), SoundHandlerBase::GetStaminaState(), GetTemperatureColor(), UIScriptedMenu::GetTotalTime(), UIScriptedMenu::GetTutorialLineScale(), GetZone(), PlayerAgentPool::GrowAgents(), HandleFallDamage(), Entity::HandleFreezingProgression(), Entity::HandleItemOverheating(), DayZPlayer::HandleWeapons(), GameplayEffectWidgets_base::HandleWidgetRoot(), Heating(), PPEffects::HitEffect(), HitDirectionEffectBase::Init(), CatchingContextFishingRodAction::InitCatchingItemData(), Entity::InitItemVariables(), Weapon::LiftWeaponCheckEx(), ScriptedWidgetEventHandler::LoadEntries(), DayZCreature::ModCommandHandlerBefore(), RightArea::MoveUpDownIcons(), NormalizedTemperature(), ItemBase::OnAction(), BaseBuildingBase::OnCEUpdate(), ActionRefuelTorch::OnExecuteServer(), Grenade_Base::OnExplosionEffects(), ActionRepairCarPart::OnFinishProgressServer(), Car::OnInput(), CarScript::OnSound(), BleedingSourcesManagerBase::OnTick(), CommonColdMdfr::OnTick(), HeatComfortMdfr::OnTick(), InfluenzaMdfr::OnTick(), ModifierBase::OnTick(), OnTick(), ShockDamageMdfr::OnTick(), DayZPlayerCamera3rdPersonErc::OnUpdate(), OnUpdate(), OnUpdate(), TimerBase::OnUpdate(), SymptomBase::OnUpdateClient(), BoatScript::OnVehicleJumpOutServer(), Car::OnVehicleJumpOutServer(), GameplayEffectWidgets_base::OnVoiceEvent(), FlashbangEffect::PlaySound(), DayZPlayerImplementAiming::ProcessAimFilters(), RainProcurementHandler::ProcessBatch(), ProcessHeatComfort(), BleedingSourcesManagerBase::ProcessHit(), ProcessNoiseComponents(), MissionBase::RandomArtillery(), ScriptedWidgetEventHandler::RandomizePageIndex(), PlayerAgentPool::ReduceAgent(), ReduceContents(), PPERequesterBase::RelativizeValue(), PPERequester_GameplayBase::ReSampleChannels(), SanitizeString(), PluginBase::SelectedObjectSetDamage(), Managed::SendInitValues(), HudDebugWinHorticulture::SendRPCSpeed(), ManBase::SetBloodyHandsPenaltyChancePerAgent(), CatchingResultBasic::SetCatchChance(), InventoryItem::SetCleanness(), UniversalTemperatureSourceLambdaFireplace::SetCurrentTemperature(), PPEffects::SetDeathDarkening(), PPERequester_GameplayBase::SetEffectProgress(), ItemBase::SetFertilizerQuantity(), PPERequester_GameplayBase::SetFlashbangIntensity(), PPERequester_GameplayBase::SetInitialLenseOffset(), Entity::SetItemOverheatProgress(), CAContinuousRepeatFishing::SetNewSignalData(), CatchingResultBasic::SetQuality(), InventoryItem::SetQuantity(), InventoryItem::SetQuantityNormalized(), DimmingConfig::SetRandomBrightenSpeedLimits(), DimmingConfig::SetRandomBrigthnessLimits(), DimmingConfig::SetRandomDimSpeedLimits(), DimmingConfig::SetRandomDurationLimits(), DimmingConfig::SetRandomPauseDurationLimits(), BaseBuildingBase::SetRefreshTimer01(), PluginBase::SetStamina(), StaminaHandler::SetStamina(), Entity::SetTemperatureDirect(), Entity::SetTemperatureEx(), PlayerAgentPool::SetTemporaryResistance(), ItemBase::SetWaterQuantity(), InventoryItem::SetWet(), Hud::ShowPlayerTag(), ManBase::SimplifyShock(), SnapOnObject(), Transfer(), TruncateVec(), DamageDealtEffect::Update(), FlashbangEffect::Update(), HitDirectionEffectBase::Update(), NotificationUI::Update(), PPEMatClassParameterCommandData::Update(), RecoilBase::Update(), ShockDealtEffect::Update(), CatchingContextTrapsBase::UpdateBaseProbability(), UpdateCookingState(), IngameHudHeatBuffer::UpdateEffect(), LeftArea::UpdateSelectionIcons(), UpdateSize(), BoatHud::UpdateSpeedPointer(), UpdateTemperature(), BleedingIndicatorDropData::UpdateTransform(), and ValueToBar().
Returns cosinus of angle in radians.
| angle | float Angle in radians |
float - Cosinus of angle Referenced by ItemBase::CalcDamageAreaRotation(), HitDirectionEffectBase::CalculateArrowPosition(), EntityAI::DetectFlippedUsingSurface(), Debug::DrawCone(), DropAllItemsInInventoryInBounds(), Easing::EaseInOutSine(), Easing::EaseInSine(), FilterObstructedObjectsByGrouping(), HitDirectionEffectBase::FinalizePositionCalculation(), FlareSimulation::FlareParticleUpdate(), GetHeadingVector(), GetRandomizedPosition(), DayZInfected::HandleOrientation(), OnAttachmentRuined(), PointLightBase::OnFrameLightSource(), EntityPlacementCallback::OnSetup(), PPERequester_GameplayBase::ProcessSimulation(), Refresh(), VicinityItemManager::RefreshVicinityItems(), vector::RotateAroundZeroDeg(), vector::RotateAroundZeroRad(), BleedingIndicatorDropData::ScatterPosition(), and PPERequester_GameplayBase::SetEffectProgress().
Returns floor of value.
| f | float Value |
float - Floor of value Referenced by WorldData::CalcBaseEnvironmentTemperature(), BleedChanceData::CalculateBleedChance(), DayZIntroScenePC::CharacterRotate(), CreateItemBasePiles(), CreateItemBasePilesDispersed(), CreateMagazinePiles(), CreateMagazinePilesDispersed(), CreateMagazinePilesFromBullet(), FishYieldItemBase::GetCycleTimeForYieldItem(), HasMaterials(), UIScriptedMenu::ProcessDistanceAndUnits(), ScriptedWidgetEventHandler::Rebuild(), IngameHudHeatBuffer::SetBaseAlpha(), VicinitySlotsContainer::ShowItemsInContainers(), MissionBase::SortedInsert(), ServerBrowserTab::SortedInsertAsc(), ServerBrowserTab::SortedInsertDesc(), ServerBrowserTab::SortedInsertEx(), StaticConstructionMethods::SpawnConstructionMaterialPiles(), SpawnItems(), InventoryItem::SplitItem(), InventoryItem::SplitItemToInventoryLocation(), TakeMaterialsServer(), Barrel_ColorBase::TanPelts(), and TruncateVec().
returns the the index of n-th bit set in a bit mask counting from the right, for instance, in a mask ..0110 1000 , the 0th set bit(right-most bit set to 1) is at 3th position(starting at 0), 1st bit is at 5th position, 2nd bit is at 6th position etc..
Referenced by AreaExposureMdfr::BleedingSourceCreateCheck(), PluginBase::InjectAgentsWithPlayer(), and PluginBase::InjectAgentsWithPlayerCount().
returns the number of bits set in a bitmask i
Referenced by AreaExposureMdfr::BleedingSourceCreateCheck(), GetNumberOfSetBits(), PluginBase::InjectAgentsWithPlayer(), PluginBase::InjectAgentsWithPlayerCount(), Land_WarheadStorage_PowerStation::OnLeverToggled(), and RecipeCacheData::SetMask().
Returns hypotenus of a right triangle.
| s | float Length of adjacent leg |
| a | float Angle of corner bordering adjacent which is not the right corner (in radians) |
float - hypotenus Calculates the linear value that produces the interpolant value within the range [a, b], it's an inverse of Lerp.
| a | float Start |
| b | float End |
| value | float value |
float - the time given the position between 'a' and 'b' given 'value', there is no clamp on 'value', to stay between [0..1] use 'value' between 'a' and 'b' Referenced by ItemBase::AdjustDetectionRange(), Bottle_Base::AffectLiquidContainerOnFill(), FilteringBottle::AffectLiquidContainerOnFill(), Bottle_Base::AffectLiquidContainerOnTransfer(), FilteringBottle::AffectLiquidContainerOnTransfer(), RecoilBase::ApplyCamOffset(), Weapon::ApproximateWeaponLiftTransform(), CalcTemperatureFromTemperatureSource(), PluginBase::CalcTemperatureFromTemperatureSource(), BleedChanceData::CalculateBleedChance(), GameplayEffectWidgets_base::CalculateBreathEffect(), DebugMonitor::CalculateMapTile(), Managed::CheckBlood(), WorldData::ComputeSnowflakeScale(), ConvertMins12hToAlarmHand01(), Car::DamageCrew(), BroomBase::DebugSetHealthAndEnergy(), WeaponDebug::DrawLineOfFireCameraHybrid(), CGame::ExplosionEffects(), ManBase::FreezeCheck(), HeatComfortAnimHandler::GetEventTime(), Mask_Base::GetFilterQuantity01(), ManBase::GetHealthRegenSpeed(), GetNormalized(), InventoryItem::GetQuantityNormalized(), ManBase::GetStatLevelBorders(), GetVolumeContainingAgent01(), GetZone(), BoatScript::HandleBoatSplashSound(), HandleFallDamage(), MaskMdfr::HandleSounds(), Weapon::LiftWeaponCheckEx(), CatchingContextFishingRodAction::ModifySignalProbability(), NormalizedTemperature(), Car::OnInput(), ManBase::OnReceivedHit(), CGame::OnRPC(), BoatScript::OnSound(), BleedingSourcesManagerBase::OnTick(), HeatComfortMdfr::OnTick(), ModifierBase::OnTick(), PoisoningMdfr::OnTick(), ShockDamageMdfr::OnTick(), OnUpdate(), OnVariablesSynchronized(), BoatScript::OnVehicleJumpOutServer(), Car::OnVehicleJumpOutServer(), DayZPlayerImplementAiming::ProcessAimFilters(), ProcessHeatBuffer(), ScriptConsoleGeneralTab::RefreshDateWidgets(), PPERequesterBase::RelativizeValue(), KitchenTimer::SecondsTo01(), Managed::SendInitValues(), DamageDealtEffect::Update(), EffectBoatWaterBack::Update(), FlashbangEffect::Update(), HitDirectionEffectBase::Update(), KuruShake::Update(), RecoilBase::Update(), ShockDealtEffect::Update(), Update(), Update(), UpdateSliderValues(), BoatHud::UpdateSpeedPointer(), BleedingIndicatorDropData::UpdateTransform(), and UniversalTemperatureSourceLambdaBaseImpl::WarmAndCoolItemsInVicinity().
Returns if value is between min and max (inclusive).
| v | float Value |
| min | float Minimum value |
| max | float Maximum value |
bool - if value is within range [min,max] Referenced by HeatComfortAnimHandler::Process(), ContaminatedArea_Local::SpawnParticles(), and TickState().
Returns if point is inside circle.
| c | vector Center of circle ([0] and [2] will be used, as a circle is 2D) |
| r | float Radius of circle |
| p | vector Point ([0] and [2] will be used, as a circle is 2D) |
bool - True when point is in circle Returns if point is inside rectangle.
| mi | vector Minimums of rectangle ([0] and [2] will be used, as a rectangle is 2D) |
| ma | vector Maximums of rectangle ([0] and [2] will be used, as a rectangle is 2D) |
| p | vector Point ([0] and [2] will be used, as a rectangle is 2D) |
bool - True when point is in rectangle Referenced by PlayerInsideOfLocationFilter(), and PlayerInsideOfLocationFilter().
Linearly interpolates between 'a' and 'b' given 'time'.
| a | float Start |
| b | float End |
| time | float Time [value needs to be between 0..1 for correct results, no auto clamp applied] |
float - The interpolated result between the two float values. Referenced by KuruShake::KuruShake(), ShockDamageMdfr::ActivateCondition(), BleedingIndicatorDropData::AdjustColorSaturation(), ItemBase::AdjustDetectionRange(), Bottle_Base::AffectLiquidContainerOnFill(), FilteringBottle::AffectLiquidContainerOnFill(), Bottle_Base::AffectLiquidContainerOnTransfer(), FilteringBottle::AffectLiquidContainerOnTransfer(), PlayerSpawnHandler::ApplyAttributes(), DayZPlayerImplementAiming::ApplyBreathingPattern(), RecoilBase::ApplyCamOffset(), DayZPlayerImplementAiming::ApplyHorizontalNoise(), WorldData::CalcBaseEnvironmentTemperature(), BleedChanceData::CalculateBleedChance(), GameplayEffectWidgets_base::CalculateBreathEffect(), CalculateLinePointFade(), DayZPlayerImplementAiming::CalculateSwayMultiplier(), ChernarusPlusData::CalculateVolFog(), EnochData::CalculateVolFog(), SakhalData::CalculateVolFog(), WorldData::ComputeSnowflakeScale(), ConvertAlarmHand01ToMins(), ConvertAlarmHand01ToMins12h(), Car::DamageCrew(), StaminaHandler::DepleteStaminaEx(), DetermineSpecificFinisherType(), WeaponDebug::DrawLineOfFireCameraHybrid(), EOnPostSimulate(), CGame::ExplosionEffects(), PPERequester_GameplayBase::FadeColourMult(), PPEffects::FlashbangEffect(), ManBase::FreezeCheck(), Weapon::GetApproximateMovementOffset(), Weapon_Base::GetApproximateMovementOffset(), FishYieldItemBase::GetCycleTimeForYieldItem(), HeatComfortAnimHandler::GetEventTime(), ManBase::GetHealthRegenSpeed(), GetMeleeTargetEx(), Weapon::GetObstructionPenetrationDistance(), InventoryItem::GetTemperatureFreezeTime(), InventoryItem::GetTemperatureThawTime(), HandleDimming(), Entity::HandleFreezingProgression(), Entity::HandleItemOverheating(), MaskMdfr::HandleSounds(), DayZPlayer::HandleWeapons(), PPEffects::HitEffect(), MissionBenchmark::LerpCamera(), ShockHandler::LerpVignette(), PPEMatClassParameterColor::ModifyResultValues(), PlayerSoundEventBase::OnPlay(), PPERequester_GameplayBase::OnStart(), HeatComfortMdfr::OnTick(), ModifierBase::OnTick(), PoisoningMdfr::OnTick(), ShockDamageMdfr::OnTick(), ManBase::OnUnconsciousUpdate(), PPERequester_GameplayBase::OnUpdate(), TimerBase::OnUpdate(), GameplayEffectWidgets_base::OnVoiceEvent(), DayZPlayerImplementAiming::ProcessAimFilters(), PPERequester_GameplayBase::ProcessFading(), ProcessHeatBuffer(), PPERequester_GameplayBase::ProcessSimulation(), PPERequester_GameplayBase::ReSampleChannels(), IngameHudHeatBuffer::SetBaseAlpha(), PPERequester_GameplayBase::SetEffectProgress(), ComponentEnergyManager::SetEnergy0To1(), InventoryItem::SetQuantityNormalized(), ManBase::SimplifyShock(), Hologram::SmoothProjectionMovement(), ManBase::SpawnDrowningBubbles(), KitchenTimer::Time01ToSeconds(), DamageDealtEffect::Update(), HitDirectionEffectBase::Update(), PPEMatClassParameterCommandData::Update(), ShockDealtEffect::Update(), BleedingIndicatorDropData::UpdateAlpha(), IngameHudHeatBuffer::UpdateEffect(), BoatHud::UpdateSpeedPointer(), ScriptConsoleGeneralTab::UpdateTime(), BleedingIndicatorDropData::UpdateTransform(), HudDebugWinBase::UpdateValues(), and ValueToBar().
Returns the binary (base-2) logarithm of x.
| x | float Value whose logarithm is calculated. |
float The binary logarithm of x: log2x. References x.
Referenced by DigestAgents(), and PluginRecipesManagerBase::SortIngredientsInRecipe().
Returns bigger of two given values.
| x | float Value |
| y | float Value |
float - max value Referenced by BleedingIndicatorDropData::BleedingIndicatorDropData(), Weapon::ApproximateBaseObstructionLength(), CalcTemperatureFromTemperatureSource(), PluginBase::CalcTemperatureFromTemperatureSource(), BleedChanceData::CalculateBleedChance(), CheckBaitCompatibility(), Cooling(), ReplaceItemWithNewLambda::CopyOldPropertiesToNew(), StaminaHandler::DepleteStaminaEx(), UniversalTemperatureSourceLambdaBaseImpl::DryItemsInVicinity(), Weapon::GetApproximateMovementOffset(), Weapon_Base::GetApproximateMovementOffset(), WorldData::GetBaseEnvTemperatureAtPosition(), Weapon::GetEffectiveAttachmentLength(), CfgGameplayHandler::GetMovementRotationSpeedJog(), CfgGameplayHandler::GetMovementRotationSpeedSprint(), CfgGameplayHandler::GetMovementTimeToSprint(), CfgGameplayHandler::GetMovementTimeToStrafeJog(), CfgGameplayHandler::GetMovementTimeToStrafeSprint(), InventoryItem::GetTemperatureFreezeTime(), GetTemperatureHeightCorrection(), InventoryItem::GetTemperatureThawTime(), UIScriptedMenu::GetTutorialLineScale(), GetWetDelta(), Entity::HandleFreezingProgression(), ItemBase::HandleItemFalling(), Entity::HandleItemOverheating(), HasMaterials(), ManBase::Init(), ItemOptics::InitCameraOverrideProperties(), InventoryItem::ItemBase(), MissionBenchmark::LerpCamera(), PPEMatClassParameterColor::ModifyResultValues(), ScriptConsoleGeneralTab::OnDoubleClick(), CholeraMdfr::OnTick(), HeavyMetalPhase2Mdfr::OnTick(), OnTick(), PoisoningMdfr::OnTick(), ProcessItemsDryness(), ProcessNutrients(), StaminaHandler::ProcessStaminaChanges(), StaminaHandler::RecalculateStaminaCap(), Ammunition_Base::SetFromProjectile(), Hologram::SetOnGround(), StaticConstructionMethods::SpawnConstructionMaterialPiles(), TakeMaterialsServer(), PluginBase::TransmitAgentsEx(), PPEMatClassParameterCommandData::Update(), Update(), BroomBase::UpdateParticle(), Container::UpdateRowVisibility(), FlammableBase::Upgrade(), PlayerRestrictedAreaInstance::ValidatePlayerRestrictedAreaPositions(), and UniversalTemperatureSourceLambdaBaseImpl::WarmAndCoolItemsInVicinity().
Returns smaller of two given values.
| x | float Value |
| y | float Value |
float - min value Referenced by Container::AddedToCargoEx(), BleedingIndicatorDropData::AdjustColorSaturation(), StaminaHandler::ApplyExhaustion(), StaminaHandler::CalcStaminaGainBonus(), BleedChanceData::CalculateBleedChance(), BroomBase::CalculateQuantity(), StaminaHandler::DepleteStaminaEx(), InjuredLegNotfr::DisplayBadge(), CGame::GetFOVByZoomType(), GetParentMinSize(), ItemBase::HandleItemFalling(), OnGUI_AnimEvents(), StaminaHandler::ProcessStaminaChanges(), Container::RemovedFromCargo(), ComponentEnergyManager::SetEnergy(), CAContinuousRepeatFishing::SetNewSignalData(), CAContinuousDisinfectPlant::Setup(), CAContinuousFill::Setup(), CAContinuousFillCoolant::Setup(), CAContinuousFillFuel::Setup(), CAContinuousFillPowerGenerator::Setup(), CAContinuousQuantityLiquidTransfer::Setup(), CAContinuousTransferQuantity::Setup(), CAContinuousWaterPlant::Setup(), CAContinuousWaterSlot::Setup(), ServerBrowserTab::SortedInsertEx(), MissionBase::TickScheduler(), Transfer(), HudDebugWinBase::Update(), PPEMatClassParameterCommandData::Update(), Update(), updateSlotsCount(), FlammableBase::Upgrade(), and PlayerRestrictedAreaInstance::ValidatePlayerRestrictedAreaPositions().
Returns the floating-point remainder of x/y rounded towards zero.
| x | float Value of the quotient numerator |
| y | float Value of the quotient denominator |
float - The remainder of dividing the arguments Referenced by HitDirectionEffectBase::CalculateArrowPosition(), and FModulus().
Normalizes the angle (0...360).
| ang | float Angle for normalizing |
float - Normalized angle Referenced by HitDirectionEffectBase::CalculateArrowPosition(), and DayZInfected::HandleOrientation().
occurences values above '12' will cause Factorial to overflow int.
Definition at line 708 of file enmath.c.
References EULER, Factorial(), and Pow().
Referenced by GameplayEffectsData::BuildProbabilityData(), and CatchingContextPoissonBase::ModifySignalProbability().
Return power of v ^ power.
| v | float Value |
| power | float Power |
float - The result of raising v to the given power Referenced by DayZIntroScenePC::DayZIntroScenePC(), AreaExposureMdfr::BleedingSourceCreateCheck(), AgentBase::CalculateAutoinfectProbability(), CombinationLock(), StaminaHandler::DepleteStaminaEx(), BleedingSourcesManagerBase::DisplayDebug(), Easing::EaseInElastic(), Easing::EaseInExpo(), Easing::EaseInOutElastic(), Easing::EaseInOutExpo(), Easing::EaseOutElastic(), Easing::EaseOutExpo(), Weapon::GetApproximateMovementOffset(), Weapon_Base::GetApproximateMovementOffset(), BleedingSourcesManagerBase::GetBleedingSourceCountRemote(), MessageReceiverBase::GetCompareMask(), GetIngredientMaskForItem(), HitDirectionEffectBase::Init(), ScriptConsoleConfigTab::Init(), PluginBase::InjectAgentsWithPlayer(), PluginBase::InjectAgentsWithPlayerCount(), CatchingContextTrapsBase::ModifySignalProbability(), ScriptConsoleItemsTab::OnChange(), ScriptConsoleConfigTab::OnClick(), OnStoreLoad(), Poisson(), PluginRecipesManagerBase::ResolveIngredients(), ItemBase::SetMaxWaterStateVal(), TruncateVec(), and PluginRecipesManagerBase::WalkRecipes().
|
inlinestaticprivate |
Returns a random bool .
bool - Random bool either 0 or 1 Definition at line 73 of file enmath.c.
References RandomIntInclusive().
Referenced by TickState().
Returns a random float number between and min[inclusive] and max[exclusive].
| min | float Range starts [inclusive] |
| max | float Range ends [exclusive] |
float - Random number in range Referenced by KuruShake::KuruShake(), Grenade_Base::ActivateRandomTime(), AdvanceState(), ActionPushCarCB::ApplyForce(), Hit_MeatBones::BloodSplatGround(), EffBulletImpactBase::CalculateStoppingForce(), CGame::CloseCombatEffects(), CreateOrgan(), StaminaHandler::DepleteStaminaEx(), RecipeBase::Do(), ItemBase::DoMeasurement(), ManBase::DropItem(), InventoryItemSuper::EEKilled(), Apple::EEOnCECreate(), BoatScript::EEOnCECreate(), Bottle_Base::EEOnCECreate(), Car::EEOnCECreate(), GreenBellPepper::EEOnCECreate(), Pear::EEOnCECreate(), Plum::EEOnCECreate(), Potato::EEOnCECreate(), Tomato::EEOnCECreate(), Zucchini::EEOnCECreate(), Car::EOnPostSimulate(), InventoryItem::ExplodeAmmo(), EntityLightSource::HandleDancingShadows(), EntityLightSource::HandleFlickering(), ChernarusPlusData::Init(), EnochData::Init(), SakhalData::Init(), ActionWringClothes::OnFinishProgressServer(), BrainDiseaseMdfr::OnTick(), SymptomBase::OnUpdateClient(), MiscEffects::PlayVegetationCollideParticles(), GeyserTrigger::RandomizeMouthPos(), Particle::RandomizeOrientation(), ParticleSource::RandomizeOrientation(), GameInventory::SetGroundPosByOwnerBounds(), DeveloperTeleport::SetPlayerPosition(), Particle::SetWiggle(), SpawnDecal(), FlammableBase::StandUp(), ThrowAllItemsInInventory(), CameraShake::Update(), and SakhalData::WeatherOnBeforeChange().
|
inlinestaticprivate |
Returns a random float number between and min [inclusive] and max [inclusive].
float - Random number in range 0.0 .. 1.0 Definition at line 126 of file enmath.c.
References RandomFloatInclusive().
Referenced by AgentBase::AutoinfectCheck(), AreaExposureMdfr::BleedingSourceCreateCheck(), ItemBase::CheckRainTick(), ChooseAttack(), CreateParticle(), PluginBase::DetermineChanceToTransmit(), ManBase::GetBloodyHandsPenaltyAgents(), GetRandomizedPosition(), GetRandomPos(), PluginBase::GiveWormsToPlayer(), GrowthTimerTick(), Edible_Base::HandleFoodStageChangeAgents(), AreaExposureMdfr::OnTick(), BrainDiseaseMdfr::OnTick(), CommonColdMdfr::OnTick(), HeavyMetalPhase2Mdfr::OnTick(), InfluenzaMdfr::OnTick(), PneumoniaMdfr::OnTick(), PoisoningMdfr::OnTick(), Edible_Base::ProcessDecay(), ManBase::ProcessFeetDamageServer(), ManBase::ProcessHandDamage(), BleedingSourcesManagerBase::ProcessHit(), ScriptedWidgetEventHandler::RandomizePageIndex(), BleedingSourcesManagerBase::RemoveBleedingSource(), CatchingResultBasic::RollChance(), ManBase::SpreadAgentsEx(), and Managed::Update().
Returns a random float number between and min [inclusive] and max [inclusive].
| min | float Range starts [inclusive] |
| max | float Range ends [inclusive] |
float - Random number in range Definition at line 106 of file enmath.c.
References Math().
Referenced by ActionRepairVehiclePartBase::AdjustVehicleHealthServer(), PlayerSpawnHandler::ApplyAttributes(), AttachBleedingToZonesByHeight(), InfluenzaAgent::AutoinfectCheck(), ChernarusPlusData::CalculateWind(), EnochData::CalculateWind(), SakhalData::CalculateWind(), DigestAgents(), PrepareAnimal::Do(), RecipeBase::Do(), GameplayEffectsData::GenerateSequenceRandomPosition(), FireworksLauncher::GetEventDelay(), HeatComfortAnimHandler::GetEventTime(), FireworksLauncherClientEvent::GetExplosionDelay(), FireworksLauncherClientEvent::GetExplosionDistance(), GetExplosionDistance(), GetQualityModifier(), Math3D::GetRandomDir(), FireworksLauncherClientEvent::GetShotDispersionAngle(), SpookyEventBase::GetSoundPos(), ItemBase::GetTemperatureValue(), GetWaitTimeForCategory(), HitDirectionEffectBase::Init(), Init(), BleedingIndicatorDropData::InitImageScale(), AreaExposureMdfr::OnActivate(), ContaminationStage2Mdfr::OnActivate(), OnActivate(), WoundInfectStage2Mdfr::OnActivate(), ActionEatCereal::OnFinishProgressServer(), ActionRepairCarPart::OnFinishProgressServer(), FireworksLauncherClientEvent::OnFired(), AreaExposureMdfr::OnTick(), ContaminationStage2Mdfr::OnTick(), FeverMdfr::OnTick(), HeavyMetalPhase2Mdfr::OnTick(), OnTick(), SalmonellaMdfr::OnTick(), WoundInfectStage2Mdfr::OnTick(), SymptomBase::OnUpdateClient(), PlateCarrierVest::OnWasAttached(), InjurySoundHandlerBase::ProcessSound(), ProcessSound(), vector::RandomDir(), vector::RandomDir2D(), RandomFloat01(), Randomize(), Particle::RandWiggleFloat(), BleedingIndicatorDropData::ScatterPosition(), ItemBase::SetActive(), InventoryItem::SetCEBasedQuantity(), SpawnItems(), BleedingIndicatorDropData::StartDrop(), ChernarusPlusData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange(), and SakhalData::WeatherOnBeforeChange().
Returns a random int number between and min [inclusive] and max [exclusive].
| min | int Range starts [inclusive] |
| max | int Range ends [exclusive] |
int - Random number in range Referenced by DayZIntroScene::DayZIntroScene(), FireworksLauncher::FireworksLauncher(), AttachBleedingToZonesByHeight(), ChernarusPlusData::CalculateVolFog(), EnochData::CalculateVolFog(), Catching(), Managed::CreateNewCharacterRandom(), DayZIntroSceneXbox::CreateRandomCharacter(), CreditsLoader::CreateTestJson(), SymptomManager::CreateUniqueID(), InventoryItem::DamageItemAttachments(), InventoryItem::DamageItemInCargo(), InventoryItem::DoAmmoExplosion(), InventoryItem::EEHitBy(), Apple::EEOnCECreate(), CraterellusMushroom::EEOnCECreate(), GreenBellPepper::EEOnCECreate(), MushroomBase::EEOnCECreate(), Pear::EEOnCECreate(), Plum::EEOnCECreate(), Potato::EEOnCECreate(), Tomato::EEOnCECreate(), Zucchini::EEOnCECreate(), DayZInfected::EOnInit(), FishPull(), BloodTypes::GenerateBloodType(), RemotelyActivatedItemBehaviour::GeneratePersistentID(), GameplayEffectsData::GenerateSequenceRandomPosition(), AreaDamageBase::GetRandomHitZone(), array< Class T >::GetRandomIndex(), GetRandomLoadingBackground(), SoundLookupTable::GetSoundBuilder(), HandleSoundEffectsPipeCreaking(), Init(), Init(), WeaponParticlesBase::OnActivate(), MapHandler::OnDoubleClick(), ActionUnrestrainSelf::OnFinishProgressServer(), OnSteppedOn(), CholeraMdfr::OnTick(), CommonColdMdfr::OnTick(), HeavyMetalPhase2Mdfr::OnTick(), InfluenzaMdfr::OnTick(), PneumoniaMdfr::OnTick(), SalmonellaMdfr::OnTick(), Car::OnVehicleJumpOutServer(), PlantBase(), ActionBase::PlayActionSound(), PlayPipeCreakingSoundOnLocation(), BleedingSourcesManagerBase::ProcessHit(), UIScriptedMenu::RandomizeCharacter(), HFSMBase< WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase >::RandomizeFSMStateEx(), RandomizeIntervals(), ScriptedWidgetEventHandler::RandomizePageIndex(), BetaSound::SaySound(), DayZAIHitComponentHelpers::SelectMostProbableHitComponent(), SelectRandomTrackIndexFromCategory(), SendEmoteRequestSync(), SendEmoteRequestSyncEx(), OptionSelector::SetRandomValue(), ShuffleLock(), BarbedWireTrigger::SoundCollision(), ItemBase::SoundCollision(), ItemBase::SoundCut(), BarbedWireTrigger::SoundElectricShock(), ItemBase::SoundElectricShock(), ItemBase::SoundSpark(), ChernarusPlusData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange(), and SakhalData::WeatherOnBeforeChange().
Returns a random int number between and min [inclusive] and max [inclusive].
| min | int Range starts [inclusive] |
| max | int Range ends [inclusive] |
int - Random number in range Definition at line 54 of file enmath.c.
References Math().
Referenced by FireworksLauncher::FireworksLauncher(), AreaExposureMdfr::BleedingSourceCreateCheck(), ChernarusPlusData::CalculateVolFog(), EnochData::CalculateVolFog(), ChernarusPlusData::CalculateWind(), EnochData::CalculateWind(), SakhalData::CalculateWind(), DamageHands(), CAContinuousMineWood::DamagePlayersHands(), PrepareAnimal::Do(), RecipeBase::Do(), Weapon::FillChamber(), Weapon::FillInnerMagazine(), AreaDamageComponentRaycasted::GetFallbackHitZone(), GetRandomizedPosition(), AreaDamageBase::GetRaycastedHitZone(), FireworksLauncherClientEvent::GetSecondaryExplosionDelay(), DayZInfected::HandleDamageHit(), HitDirectionEffectBase::Init(), CholeraMdfr::OnActivate(), ActionPackGift::OnFinishProgressServer(), OnFinishProgressServer(), TrapBase::OnServerSteppedOn(), OnSteppedOn(), CholeraMdfr::OnTick(), ToxicityMdfr::OnTick(), Car::OnVehicleJumpOutServer(), OpenItem::OpenAndSwitch(), Edible_Base::ProcessDecay(), MissionBase::RandomArtillery(), RandomBool(), Randomize(), RandomizedDeviation(), HitDirectionImagesBase::RandomizeImageIdx(), ScriptedWidgetEventHandler::RandomizePageIndex(), CrashBase::RandomizePosition(), SelectEvent(), HitDirectionEffectBase::SetIndicatorRotation(), Weapon::SpawnAttachedMagazine(), CrashBase::SpawnRandomDeers(), HotSpringTrigger::SpawnVaporEffect(), VolcanicTrigger::SpawnVaporEffect(), ChernarusPlusData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange(), and SakhalData::WeatherOnBeforeChange().
Sets the seed for the random number generator.
| seed | int New seed for the random number generator, -1 will use time |
int - Returns new seed Referenced by CGame::CGame(), KuruShake::KuruShake(), AttachBleedingToZonesByHeight(), ChooseAttack(), AreaDamageBase::GetRandomHitZone(), GetRandomLoadingBackground(), CGame::OnAfterCreate(), FireworksLauncher::OnVariablesSynchronized(), Randomize(), RandomizedDeviation(), and ScriptedWidgetEventHandler::RandomizePageIndex().
Returns the floating-point remainder of x/y rounded to nearest.
| x | float Value of the quotient numerator |
| y | float Value of the quotient denominator |
float - The remainder of dividing the arguments
|
inlinestaticprivate |
Returns given value remaped from input range into output range.
| inputMin | float Minimal value of given input range |
| inputMax | float Maximal value of given input range |
| outputMin | float Minimal value of given output range |
| outputMax | float Maximal value of given output range |
| inputValue | float Value we want to remap |
| clampedOutput |
p bool If value should stay in that range, otherwise it will be extrapolated
float - Remapped value Definition at line 740 of file enmath.c.
References Math().
Referenced by CalculateBreadCrumbs(), and ProcessHeatComfort().
Returns mathematical round of value.
| f | float Value |
float - closest whole number to 'f' Referenced by AddAgent(), ScriptedWidgetEventHandler::AddItem(), BaseBuildingBase::AddRefresherTime01(), BaseBuildingBase::AnimateFlagEx(), PlayerSpawnHandler::ApplyAttributes(), DayZPlayerImplementAiming::ApplyShakes(), InventoryItem::CombineItems(), CreateOrgan(), Entity::DeSerializeNumericalVars(), InventoryItem::DeSerializeNumericalVars(), DetermineSpecificFinisherType(), BleedingSourcesManagerBase::DisplayDebug(), RecipeBase::Do(), PoweredOptic_Base::DoMeasurement(), Inventory_Base::EmptySeedPack(), GetApplicableHeatbuffer(), ScriptedWidgetEventHandler::GetDistanceString(), ComponentEnergyManager::GetEnergy0To100(), VicinitySlotsContainer::GetItemQuantityText(), FlammableBase::GetRagQuantity(), ItemBase::GetTemperatureValue(), EntityLightSource::HandleBlinking(), DayZInfected::HandleOrientation(), UIScriptedMenu::NextPrevPage(), BaseBuildingBase::OnCEUpdate(), Battery9V::OnEnergyAdded(), VehicleBattery::OnEnergyAdded(), Battery9V::OnEnergyConsumed(), Chemlight_ColorBase::OnEnergyConsumed(), VehicleBattery::OnEnergyConsumed(), ModifierBase::OnTick(), OnUpdate(), OrderedAltitudeNumbersPosition(), UIScriptedMenu::ProcessDistanceAndUnits(), ProcessHeatComfort(), ProcessNoiseComponents(), ScriptedWidgetEventHandler::RefreshItemVariables(), ScriptedWidgetEventHandler::RefreshQuickbarItemVariables(), ScriptedWidgetEventHandler::RemoveItem(), ScriptedWidgetEventHandler::ResetItem(), PoweredOptic_Base::SetDistanceText(), DebugMonitor::SetFramerateText(), ScriptedWidgetEventHandler::SetItem(), ScriptedWidgetEventHandler::SetItemColor(), ActionTargetsCursor::SetItemQuantity(), ScriptedWidgetEventHandler::SetItemQuantity(), Icon::SetQuantity(), SlotsIcon::SetQuantity(), InventoryItem::SetQuantityNormalized(), BaseBuildingBase::SetRefreshTimer01(), OptionSelectorBase::SetValue(), OptionSelectorSliderSetup::SetValueText(), UIScriptedMenu::Update(), UIScriptedMenu::UpdateExitButtonState(), UIScriptedMenu::UpdateItemInfoQuantity(), UIScriptedMenu::UpdateItemInfoWeight(), ServerBrowserTab::UpdatePageButtons(), ScriptedWidgetEventHandler::UpdateQuantityItems(), UIScriptedMenu::UpdateQuickbarItemCard(), ScriptedWidgetEventHandler::UpdateTemperatureItems(), HudDebugWinBase::UpdateValues(), UpdateZones(), and ValueToBar().
Returns sinus of angle in radians.
| angle | float Angle in radians |
float - Sinus of angle Referenced by DayZPlayerImplementAiming::ApplyBreathingPattern(), Bobbing(), ItemBase::CalcDamageAreaRotation(), HitDirectionEffectBase::CalculateArrowPosition(), Debug::DrawCone(), DropAllItemsInInventoryInBounds(), Easing::EaseInElastic(), Easing::EaseInOutElastic(), Easing::EaseOutElastic(), Easing::EaseOutSine(), FilterObstructedObjectsByGrouping(), HitDirectionEffectBase::FinalizePositionCalculation(), FlareSimulation::FlareParticleUpdate(), GetHeadingVector(), GetRandomizedPosition(), EntityLightSource::HandleBlinking(), DayZInfected::HandleOrientation(), OnAttachmentRuined(), PointLightBase::OnFrameLightSource(), EntityPlacementCallback::OnSetup(), ManBase::OnUnconsciousUpdate(), DayZPlayerCameraBase::OnUpdate(), PPERequester_GameplayBase::OnUpdate(), SymptomBase::OnUpdateClient(), PPERequester_GameplayBase::ProcessSimulation(), Refresh(), VicinityItemManager::RefreshVicinityItems(), PPERequester_GameplayBase::ReSampleChannels(), vector::RotateAroundZeroDeg(), vector::RotateAroundZeroRad(), PPERequester_GameplayBase::SampleChannels(), BleedingIndicatorDropData::ScatterPosition(), PPERequester_GameplayBase::SetEffectProgress(), and AnimatorTimer::Tick().
|
staticprivate |
Does the CD smoothing function - easy in | easy out / S shaped smoothing.
| val | actual value |
| target | value we are reaching for -> Target |
| velocity | float[1] - array of ONE member - some kind of memory and actual accel/decel rate, need to be zeroed when filter is about to be reset |
| smoothTime | smoothing parameter, 0.1 .. 0.4 are resonable values, 0.1 is sharp, 0.4 is very smooth |
| maxVelocity | maximal value change when multiplied by dt |
| dt | delta time |
float smoothed/filtered valueReferenced by DayZPlayerImplementAiming::ApplyHorizontalNoise(), HitDirectionEffectBase::CalculateArrowPosition(), DayZPlayer::HandleWeapons(), DayZPlayerCameraBase::HoldBreathFOVEffect(), HoldBreathFOVEffect(), DayZPlayerCameraBase::OnUpdate(), OnUpdate(), DayZPlayerImplementAiming::ProcessStealthFilters(), SmoothCDPI2PI(), StdFovUpdate(), NotificationUI::Update(), UpdateLRAngle(), UpdateLRAngleLookAt(), UpdateLRAngleUnlocked(), UpdateUDAngle(), and UpdateUDAngleUnlocked().
|
inlinestaticprivate |
Definition at line 680 of file enmath.c.
References Math(), and SmoothCD().
Referenced by OnUpdate().
Returns squared value.
| f | float Value |
float - Squared value Referenced by ActionTriggerRemotely::ActionCondition(), EvaluateComponentEx(), GatherTemperatureSources(), GetAttackTypeByDistanceToTarget(), HitZoneSelectionRaycast(), IsPlaceable(), MeleeTargetSettings(), RemoteDetonatorTrigger::OnActivatedByItem(), OnCEUpdate(), RemoteDetonatorTrigger::OnCEUpdate(), Grenade_Base::OnExplosionEffects(), PluginBase::ProcessUniversalTemperatureSources(), and TargetSelection().
Returns square root.
| val | float Value |
float - Square of value Referenced by DayZIntroScenePC::DayZIntroScenePC(), SoftSkillsManager::AddExponentialPrecise(), SoftSkillsManager::AddExponentialRough(), Easing::EaseInCirc(), Easing::EaseInOutCirc(), Easing::EaseOutCirc(), CGame::OnRPC(), and UIScriptedMenu::Update().
Returns tangent of angle in radians.
| angle | float Angle in radians |
float - Tangens of angle Referenced by GetMeleeTarget(), GetMeleeTargetEx(), and PointLightBase::OnFrameLightSource().
Returns if given vectors are equal with given tolerance.
| v1 | float First vector for comparison |
| v2 | float Second vector for comparison |
| tolerance | float Range in which given vectors can differ |
bool - True if Vectors are equal; otherwise false Definition at line 766 of file enmath.c.
References Math().
Returns wrap number to specified interval [min, max[.
| i | int Value |
| min | float Minimum |
| max | int Maximum |
int - number in specified interval [min, max[ Referenced by WeaponStateBase::FindNextFreeMuzzle().
|
staticprivate |
Definition at line 17 of file enmath.c.
Referenced by ItemBase::CalcDamageAreaRotation(), HitDirectionEffectBase::CalculateArrowPosition(), DayZPlayerImplementHeading::ClampAngle(), EntityAI::DetectFlippedUsingSurface(), FlareSimulation::FlareParticleUpdate(), GetMeleeTarget(), DayZInfected::HandleOrientation(), InitData(), Weapon::LiftWeaponCheckEx(), MeleeTargetSettings(), DayZCreature::ModCommandHandlerBefore(), OnActivate(), OnUpdate(), VicinityItemManager::RefreshVicinityItems(), vector::RotateAroundZeroDeg(), and UIScriptedMenu::SetCameraData().
|
staticprivate |
|
staticprivate |
Definition at line 12 of file enmath.c.
Referenced by HitDirectionEffectBase::CalculateArrowPosition(), DayZPlayerImplementHeading::ClampHeading(), Easing::EaseInElastic(), Easing::EaseInOutElastic(), Easing::EaseInOutSine(), Easing::EaseInSine(), Easing::EaseOutElastic(), Easing::EaseOutSine(), fixAngle_PI_PI(), InitData(), SymptomBase::OnUpdateClient(), Refresh(), PPERequester_GameplayBase::ReSampleChannels(), DayZPlayerImplementHeading::RotateOrient(), DeveloperTeleport::SetPlayerPosition(), and SpawnDecal().
|
staticprivate |
Definition at line 13 of file enmath.c.
Referenced by HitDirectionEffectBase::CalculateArrowPosition(), ManBase::CheckAnimationOverrides(), DayZPlayerImplementHeading::ClampHeading(), fixAngle_PI_PI(), InitData(), DayZCreature::ModCommandHandlerBefore(), PointLightBase::OnFrameLightSource(), DayZPlayerCameraBase::OnUpdate(), DayZPlayerImplementHeading::RotateOrient(), BleedingIndicatorDropData::ScatterPosition(), and AnimatorTimer::Tick().
|
staticprivate |
Definition at line 14 of file enmath.c.
Referenced by DayZPlayerImplementHeading::ClampHeading(), GetHeadingVector(), EntityPlacementCallback::OnSetup(), DayZPlayerImplementHeading::RotateOrient(), PPERequester_GameplayBase::SampleChannels(), and PPERequester_GameplayBase::SetEffectProgress().
|
staticprivate |
Definition at line 16 of file enmath.c.
Referenced by DayZIntroScene::DayZIntroScene(), ActionCreateIndoorFireplace::ActionCondition(), ActionCreateIndoorOven::ActionCondition(), ActionPlaceFireplaceIndoor::ActionCondition(), ActionPlaceOvenIndoor::ActionCondition(), AddArrow(), DayZInfected::AddArrow(), ManBase::AddArrow(), DayZInfected::ComputeHitDirectionAngle(), DayZCreatureAI::ComputeHitDirectionAngleDeg(), DayZInfected::ComputeHitDirectionAngleEx(), PoweredOptic_Base::DoMeasurement(), DayZSpectator::EOnFrame(), EvaluateComponentEx(), DayZPlayer::EvaluateDamageHitAnimation(), DayZPlayer::EvaluateDeathAnimation(), EvaluateHit_Player(), DayZInfected::FightLogic(), FloatingCrossHair(), GetAngleInDegrees(), GetMeleeTargetEx(), DayZInfected::HandleOrientation(), IsEntityBehindEntityInAngle(), IsPlayerOrientedTowardPos(), DayZPlayerCameraBase::OnUpdate(), OnUpdate(), PluginBase::OnUpdate(), HitDirectionEffectBase::SetIndicatorRotation(), DeveloperTeleport::SetPlayerPosition(), SpawnDecal(), UpdataControllerInput(), Rotator::Update(), ScriptedWidgetEventHandler::Update(), RadialProgressBar::UpdateChild(), UpdateLRAngle(), UpdateLRAngleLookAt(), UpdateLRAngleUnlocked(), ScriptConsoleSoundsTab::UpdateMousePos(), UpdateUDAngle(), and UpdateUDAngleUnlocked().