class MathSource
Part of Math library
Constructors 2
private void Math()private void ~Math()Constants 6
static const float PI = 3.14159265358979Show 14 more
, DeveloperTeleport.SetPlayerPosition(), Easing.EaseInElastic(), Easing.EaseInOutElastic(), Easing.EaseInOutSine(), Easing.EaseInSine(), Easing.EaseOutElastic(), Easing.EaseOutSine(), FeverBlurSymptom.OnUpdateClient(), HeadingRestrictData.InitData(), HitDirectionEffectBase.CalculateArrowPosition(), SmoothCDPI2PI(), PPERequester_HMPGhosts.ReSampleChannels(), RadialMenu.Refresh(), and UnderObjectDecalSpawnComponent.SpawnDecal()static const float PI2 = 6.28318530717958Show 11 more
, DayZCreatureAI.ModCommandHandlerBefore(), DayZPlayerCameraIronsights.OnUpdate(), DayZPlayerImplementHeading.ClampHeading(), DayZPlayerImplementHeading.RotateOrient(), EffectArea.FillWithParticles(), EffectArea.PlaceParticles(), HeadingRestrictData.InitData(), HitDirectionEffectBase.CalculateArrowPosition(), SmoothCDPI2PI(), PartyLight.OnFrameLightSource(), and PlayerBase.CheckAnimationOverrides()static const float PI_HALF = 1.570796326794Show 7 more
, DayZPlayerImplementMeleeCombat.DrawDebugBlockCone(), DayZPlayerImplementMeleeCombat.DrawDebugMeleeCone(), EntityPlacementCallback.OnSetup(), MiscGameplayFunctions.GetHeadingVector(), PPERequester_HeavyMetalPoisoning_3.SetEffectProgress(), PPERequester_HMPGhosts.SampleChannels(), and VicinityItemManager.DebugConeDraw()static const float RAD2DEG = 57.2957795130823208768Show 40 more
, ActionPlaceOvenIndoor.ActionCondition(), CameraToolsMenuClient.OnRPC(), ContinuousActionProgress.Update(), CrossHairSelector.FloatingCrossHair(), DayZAnimal.ComputeHitDirectionAngleDeg(), DayZCreature.AddArrow(), DayZIntroScene.DayZIntroScene(), DayZPlayerCamera3rdPersonProneBase.OnUpdate(), DayZPlayerCamera3rdPersonProneBase.UpdateLRAngleLookAt(), DayZPlayerCamera3rdPersonVehicle.OnUpdate(), DayZPlayerCameraBase.UpdateLRAngle(), DayZPlayerCameraBase.UpdateLRAngleUnlocked(), DayZPlayerCameraBase.UpdateUDAngle(), DayZPlayerCameraBase.UpdateUDAngleUnlocked(), DayZPlayerCameraIronsights.OnUpdate(), DayZPlayerImplement.EvaluateDamageHitAnimation(), DayZPlayerImplement.EvaluateDeathAnimation(), DayZPlayerImplementMeleeCombat.IsEntityBehindEntityInAngle(), DayZPlayerMeleeFightLogic_LightHeavy.EvaluateHit_Player(), DayZSpectator.EOnFrame(), DeveloperTeleport.SetPlayerPosition(), HitDirectionEffectArrow.SetIndicatorRotation(), HitDirectionEffectSpike.SetIndicatorRotation(), MeleeTargeting.EvaluateComponentEx(), MeleeTargeting.GetMeleeTargetEx(), MiscGameplayFunctions.IsPlayerOrientedTowardPos(), PlayerBase.AddArrow(), PluginCharPlacement.OnUpdate(), RadialMenu.GetAngleInDegrees(), RadialMenu.UpdataControllerInput(), RadialProgressBar.UpdateChild(), Rangefinder.DoMeasurement(), Rotator.Update(), ScriptConsoleSoundsTab.UpdateMousePos(), UnderObjectDecalSpawnComponent.SpawnDecal(), ZombieBase.AddArrow(), ZombieBase.ComputeHitDirectionAngle(), ZombieBase.ComputeHitDirectionAngleEx(), ZombieBase.FightLogic(), and ZombieBase.HandleOrientation()static const float DEG2RAD = 0.01745329251994329577Show 19 more
, DayZCreatureAI.ModCommandHandlerBefore(), DayZPlayerCamera3rdPersonVehicle.OnActivate(), DayZPlayerCamera3rdPersonVehicle.OnUpdate(), DayZPlayerImplementHeading.ClampAngle(), DayZPlayerImplementMeleeCombat.DrawDebugBlockCone(), DayZPlayerImplementMeleeCombat.DrawDebugMeleeCone(), DayzPlayerItemBehaviorCfg.DayzPlayerItemBehaviorCfg(), DayZPlayerTypeUtils.DayZPlayerTypeInitMovement(), DayZPlayerUtils.GetMeleeTarget(), FlareSimulation.FlareParticleUpdate(), HeadingRestrictData.InitData(), HitDirectionEffectBase.CalculateArrowPosition(), MeleeTargetSettings.MeleeTargetSettings(), Transport.DetectFlippedUsingSurface(), vector.RotateAroundZeroDeg(), VicinityItemManager.DebugConeDraw(), VicinityItemManager.RefreshVicinityItems(), Weapon_Base.LiftWeaponCheckEx(), and ZombieBase.HandleOrientation()Methods 56
returns the number of bits set in a bitmask i
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..
Returns a random int number between and min [inclusive] and max [exclusive].
minintRange starts [inclusive]maxintRange ends [exclusive]
Returns: int - Random number in range
Print( Math.RandomInt(0, 1) ); // only 0
Print( Math.RandomInt(0, 2) ); // 0 or 1
>> 0
>> 1Returns a random int number between and min [inclusive] and max [inclusive].
minintRange starts [inclusive]maxintRange ends [inclusive]
Returns: int - Random number in range
Print( Math.RandomIntInclusive(0, 1) ); // 0 or 1
Print( Math.RandomIntInclusive(0, 2) ); // 0, 1, 2
>> 1
>> 2Show 47 more
, AreaDamageBase.GetRaycastedHitZone(), AreaDamageComponentRaycasted.GetFallbackHitZone(), AreaExposureMdfr.BleedingSourceCreateCheck(), BearTrap.OnServerSteppedOn(), CAContinuousMineWood.DamagePlayersHands(), CarScript.OnVehicleJumpOutServer(), ChernarusPlusData.CalculateVolFog(), ChernarusPlusData.CalculateWind(), ChernarusPlusData.WeatherOnBeforeChange(), CholeraMdfr.OnActivate(), CholeraMdfr.OnTick(), CraftBaseBallBatBarbed.Do(), DayZPlayerImplementFallDamage.Randomize(), DayZPlayerMeleeFightLogic_LightHeavy.DamageHands(), DeCraftWoodenCrate.Do(), Edible_Base.ProcessDecay(), EmoteVomit.EmoteStartOverride(), EnochData.CalculateVolFog(), EnochData.CalculateWind(), EnochData.WeatherOnBeforeChange(), FireworksLauncher.FireworksLauncher(), FireworksLauncherClientEvent.GetSecondaryExplosionDelay(), HitDirectionEffectBase.Init(), HitDirectionEffectSplash.SetIndicatorRotation(), HitDirectionImagesBase.RandomizeImageIdx(), HotSpringTrigger.SpawnVaporEffect(), LandMineTrap.OnSteppedOn(), MapNavigationBehaviour.RandomizedDeviation(), RandomBool(), MiscGameplayFunctions.GetRandomizedPosition(), MissionServer.RandomArtillery(), OpenItem.OpenAndSwitch(), PrepareChicken.Do(), PrepareFox.Do(), PrepareRabbit.Do(), SakhalData.CalculateWind(), SakhalData.WeatherOnBeforeChange(), SpookyTriggerEventsHandler.SelectEvent(), ToxicityMdfr.OnTick(), UiHintPanel.RandomizePageIndex(), VolcanicTrigger.SpawnVaporEffect(), Weapon_Base.FillChamber(), Weapon_Base.FillInnerMagazine(), Weapon_Base.SpawnAttachedMagazine(), Wreck_SantasSleigh.RandomizePosition(), Wreck_SantasSleigh.SpawnRandomDeers(), and ZombieBase.HandleDamageHit()static bool RandomBool()Returns a random bool .
Returns: bool - Random bool either 0 or 1
Print( Math.RandomBool() );
Print( Math.RandomBool() );
Print( Math.RandomBool() );
>> true
>> true
>> falseReturns a random float number between and min[inclusive] and max[exclusive].
minfloatRange starts [inclusive]maxfloatRange ends [exclusive]
Returns: float - Random number in range
Print( Math.RandomFloat(0,1) );
Print( Math.RandomFloat(0,2) );
>> 0.597561
>> 1.936456Show 47 more
, Apple.EEOnCECreate(), BBMaterials_Preset.OnPresetSpawn(), BoatScript.EEOnCECreate(), BrainDiseaseMdfr.OnTick(), CameraShake.Update(), Canteen.EEOnCECreate(), CarRadiator.EEKilled(), CarScript.EEOnCECreate(), CarScript.EOnPostSimulate(), ChernarusPlusData.Init(), CutOutSeeds.Do(), DayZGame.CloseCombatEffects(), DeCraftWoodenCrate.Do(), DeveloperTeleport.SetPlayerPosition(), EffBulletImpactBase.CalculateStoppingForce(), EnochData.Init(), FeverBlurSymptom.OnUpdateClient(), FlammableBase.StandUp(), GameInventory.SetGroundPosByOwnerBounds(), GeyserTrigger.RandomizeMouthPos(), GreenBellPepper.EEOnCECreate(), Grenade_Base.ActivateRandomTime(), Hit_MeatBones.BloodSplatGround(), ItemBase.ExplodeAmmo(), KuruShake.KuruShake(), LightDimming.AdvanceState(), MiscEffects.PlayVegetationCollideParticles(), MiscGameplayFunctions.ThrowAllItemsInInventory(), Particle.RandomizeOrientation(), Particle.SetWiggle(), ParticleSource.RandomizeOrientation(), Pear.EEOnCECreate(), PlayerBase.DropItem(), Plum.EEOnCECreate(), Potato.EEOnCECreate(), Raycaster.DoMeasurement(), SakhalData.Init(), SakhalData.WeatherOnBeforeChange(), ScriptedLightBase.HandleDancingShadows(), ScriptedLightBase.HandleFlickering(), StaminaHandler.DepleteStaminaEx(), Tomato.EEOnCECreate(), UnderObjectDecalSpawnComponent.SpawnDecal(), Update117_Preset.OnPresetSpawn(), Update118_Preset.OnPresetSpawn(), WaterBottle.EEOnCECreate(), and Zucchini.EEOnCECreate()Returns a random float number between and min [inclusive] and max [inclusive].
minfloatRange starts [inclusive]maxfloatRange ends [inclusive]
Returns: float - Random number in range
Print( Math.RandomFloatInclusive(0, 1) ); // 0.0 .. 1.0
Print( Math.RandomFloatInclusive(1, 2) ); // 1.0 .. 2.0
>> 0.3
>> 2.0static float RandomFloat01()Returns a random float number between and min [inclusive] and max [inclusive].
Returns: float - Random number in range 0.0 .. 1.0
Print( Math.RandomFloat01() ); // 0.0 .. 1.0
>> 0.3
>> 1.0Show 26 more
, AreaExposureMdfr.OnTick(), BearSteakMeat.HandleFoodStageChangeAgents(), BleedingIndicator.Update(), BleedingSource.CreateParticle(), BleedingSourcesManagerServer.ProcessHit(), BleedingSourcesManagerServer.RemoveBleedingSource(), BrainDiseaseMdfr.OnTick(), CatchingResultBasic.RollChance(), CommonColdMdfr.OnTick(), DayZInfectedType.ChooseAttack(), Edible_Base.ProcessDecay(), GardenBase.CheckRainTick(), HeavyMetalPhase2Mdfr.OnTick(), InfluenzaMdfr.OnTick(), MiscGameplayFunctions.GetRandomizedPosition(), PlantBase.GrowthTimerTick(), PlayerBase.GetBloodyHandsPenaltyAgents(), PlayerBase.ProcessFeetDamageServer(), PlayerBase.ProcessHandDamage(), PlayerBase.SpreadAgentsEx(), PluginHorticulture.GiveWormsToPlayer(), PluginTransmissionAgents.DetermineChanceToTransmit(), PneumoniaMdfr.OnTick(), PoisoningMdfr.OnTick(), UiHintPanel.RandomizePageIndex(), and WolfSteakMeat.HandleFoodStageChangeAgents()Sets the seed for the random number generator.
seedintNew seed for the random number generator, -1 will use time
Returns: int - Returns new seed
Print( Math.Randomize(5) );
>> 5Show 8 more
, DayZGame.OnAfterCreate(), DayZInfectedType.ChooseAttack(), DayZPlayerImplementFallDamage.AttachBleedingToZonesByHeight(), DayZPlayerImplementFallDamage.Randomize(), FireworksLauncher.OnVariablesSynchronized(), KuruShake.KuruShake(), MapNavigationBehaviour.RandomizedDeviation(), and UiHintPanel.RandomizePageIndex()Normalizes the angle (0...360)
angfloatAngle for normalizing
Returns: float - Normalized angle
Print( Math.NormalizeAngle(390) );
Print( Math.NormalizeAngle(-90) );
>> 30
>> 270Return relative difference between angles
angle1floatangle2float
Returns: float Difference between angles (angle1 - angle2)
Print( Math.DiffAngle(-45, 45) );
Print( Math.DiffAngle(90, 80) );
>> -90
>> 10Return power of v ^ power
vfloatValuepowerfloatPower
Returns: float - The result of raising v to the given power
Print( Math.Pow(2, 4) ); // (2*2*2*2)=16
>> 16Show 30 more
, BleedingSourcesManagerRemote.GetBleedingSourceCountRemote(), CatchingContextTrapsBase.ModifySignalProbability(), CombinationLock.CombinationLock(), DayZIntroScenePC.DayZIntroScenePC(), DisplayElementBase.GetCompareMask(), Easing.EaseInElastic(), Easing.EaseInExpo(), Easing.EaseInOutElastic(), Easing.EaseInOutExpo(), Easing.EaseOutElastic(), Easing.EaseOutExpo(), GardenBase.SetMaxWaterStateVal(), HitDirectionEffectBase.Init(), Poisson(), RandomFloatInclusive(), MiscGameplayFunctions.Truncate(), MiscGameplayFunctions.TruncateVec(), Pistol_Base.GetApproximateMovementOffset(), PlayerStomach.OnStoreLoad(), PluginRecipesManager.ResolveIngredients(), PluginRecipesManager.WalkRecipes(), PluginTransmissionAgents.InjectAgentsWithPlayer(), PluginTransmissionAgents.InjectAgentsWithPlayerCount(), RecipeBase.GetIngredientMaskForItem(), ScriptConsoleConfigTab.Init(), ScriptConsoleConfigTab.OnClick(), ScriptConsoleItemsTab.OnChange(), StaminaHandler.DepleteStaminaEx(), Weapon_Base.GetApproximateMovementOffset(), and WeaponLiftDiag.DrawDiag()Returns the floating-point remainder of x/y rounded towards zero
xfloatValue of the quotient numeratoryfloatValue of the quotient denominator
Returns: float - The remainder of dividing the arguments
Print( Math.ModFloat(5.3, 2) );
Print( Math.ModFloat(18.5, 4.2) );
>> 1.3
>> 1.7Returns the floating-point remainder of x/y rounded to nearest
xfloatValue of the quotient numeratoryfloatValue of the quotient denominator
Returns: float - The remainder of dividing the arguments
Print( Math.RemainderFloat(5.3, 2) );
Print( Math.RemainderFloat(18.5, 4.2) );
>> -0.7
>> 1.7Returns absolute value
ffloatValue
Returns: float - Absolute value
Print( Math.AbsFloat(-12.5) );
>> 12.5Returns absolute value
iintValue
Returns: int - Absolute value
Print( Math.AbsInt(-12) );
>> 12Show 19 more
, CarHud.RefreshVehicleHud(), CarScript.CheckContactCache(), DayZPlayerImplement.HandleView(), HealthMdfr.OnTick(), IngameHud.DisplayNotifier(), MapNavigationBehaviour.OrderedPositionNumbersFromGridCoords(), PlayerAgentPool.RemoteGrowRequestDebug(), PlayerBase.CanChangeStance(), PlayerBase.GetBrokenLegs(), PlayerBase.UpdateCorpseState(), PlayerBase.UpdateCorpseStateVisual(), PluginDeveloperSync.ActivateModifier(), PluginDeveloperSync.DeactivateModifier(), PluginDeveloperSync.IsModifierLocked(), PluginDeveloperSync.LockModifier(), PluginDeveloperSync.RequestDetailedInfo(), SoftSkillsManager.AddExponentialPrecise(), SoftSkillsManager.AddExponentialRough(), and ZombieBase.HandleOrientation()Returns sign of given value
ffloatValue
Returns: float - Sign of given value
Print( Math.SignFloat(-12.0) );
Print( Math.SignFloat(0.0) );
Print( Math.SignFloat(12.0) );
>> -1.0
>> 0
>> 1.0Returns sign of given value
iintValue
Returns: int - Sign of given value
Print( Math.SignInt(-12) );
Print( Math.SignInt(0) );
Print( Math.SignInt(12) );
>> -1
>> 0
>> 1Returns squared value
ffloatValue
Returns: float - Squared value
Print( Math.SqrFloat(12.5) );
>> 156.25Show 10 more
, DayZPlayerMeleeFightLogic_LightHeavy.GetAttackTypeByDistanceToTarget(), Environment.GatherTemperatureSources(), ExplosivesBase.OnCEUpdate(), FlashGrenade.OnExplosionEffects(), MeleeTargeting.EvaluateComponentEx(), MeleeTargetSettings.MeleeTargetSettings(), PluginUniversalTemperatureSourceClient.ProcessUniversalTemperatureSources(), RemoteDetonatorTrigger.OnActivatedByItem(), RemoteDetonatorTrigger.OnCEUpdate(), and TrapBase.IsPlaceable()Returns squared value
iintValue
Returns: int - Squared value
Print( Math.SqrInt(12) );
>> 144Returns square root
valfloatValue
Returns: float - Square of value
Print( Math.Sqrt(25));
>> 5Returns the binary (base-2) logarithm of x.
xfloatValue whose logarithm is calculated.
Returns: float The binary logarithm of x: log2x.
If x is negative, it causes a domain error:
If x is zero, it may cause a pole error (depending on the library implementation).
Print( Math.Log2(1.0) );
>> 0.0Returns sinus of angle in radians
anglefloatAngle in radians
Returns: float - Sinus of angle
Print( Math.Sin(0.785398) ); // (45)
>> 0.707107Show 36 more
, BleedingIndicatorDropData.ScatterPosition(), DayZPlayerCameraIronsights.OnUpdate(), DayZPlayerImplementAiming.ApplyBreathingPattern(), Debug.DrawCone(), Easing.EaseInElastic(), Easing.EaseInOutElastic(), Easing.EaseOutElastic(), Easing.EaseOutSine(), EffectArea.FillWithParticles(), EffectArea.PlaceParticles(), EntityPlacementCallback.OnSetup(), FeverBlurSymptom.OnUpdateClient(), FireplaceBase.OnAttachmentRuined(), FlareSimulation.FlareParticleUpdate(), HitDirectionEffectArrow.FinalizePositionCalculation(), HitDirectionEffectBase.CalculateArrowPosition(), HitDirectionEffectSpike.FinalizePositionCalculation(), MiscGameplayFunctions.Bobbing(), MiscGameplayFunctions.DropAllItemsInInventoryInBounds(), MiscGameplayFunctions.FilterObstructedObjectsByGrouping(), MiscGameplayFunctions.GetHeadingVector(), MiscGameplayFunctions.GetRandomizedPosition(), PartyLight.OnFrameLightSource(), PlayerBase.OnUnconsciousUpdate(), PPERequester_Drowning.OnUpdate(), PPERequester_HeavyMetalPoisoning_3.SetEffectProgress(), PPERequester_HMPGhosts.ProcessSimulation(), PPERequester_HMPGhosts.ReSampleChannels(), PPERequester_HMPGhosts.SampleChannels(), RadialMenu.Refresh(), ScriptedLightBase.HandleBlinking(), vector.RotateAroundZeroDeg(), vector.RotateAroundZeroRad(), VicinityItemManager.DebugConeDraw(), VicinityItemManager.RefreshVicinityItems(), and ZombieBase.HandleOrientation()Returns cosinus of angle in radians
anglefloatAngle in radians
Returns: float - Cosinus of angle
Print( Math.Cos(0.785398) ); // (45)
>> 0.707107Show 26 more
, BrightnessTestLight.OnFrameLightSource(), Debug.DrawCone(), Easing.EaseInOutSine(), Easing.EaseInSine(), EffectArea.FillWithParticles(), EffectArea.PlaceParticles(), EntityPlacementCallback.OnSetup(), FireplaceBase.OnAttachmentRuined(), FlareSimulation.FlareParticleUpdate(), HitDirectionEffectArrow.FinalizePositionCalculation(), HitDirectionEffectBase.CalculateArrowPosition(), HitDirectionEffectSpike.FinalizePositionCalculation(), MiscGameplayFunctions.DropAllItemsInInventoryInBounds(), MiscGameplayFunctions.FilterObstructedObjectsByGrouping(), MiscGameplayFunctions.GetHeadingVector(), MiscGameplayFunctions.GetRandomizedPosition(), PartyLight.OnFrameLightSource(), PPERequester_HeavyMetalPoisoning_3.SetEffectProgress(), PPERequester_HMPGhosts.ProcessSimulation(), RadialMenu.Refresh(), Transport.DetectFlippedUsingSurface(), vector.RotateAroundZeroDeg(), vector.RotateAroundZeroRad(), VicinityItemManager.DebugConeDraw(), VicinityItemManager.RefreshVicinityItems(), and ZombieBase.HandleOrientation()Returns tangent of angle in radians
anglefloatAngle in radians
Returns: float - Tangens of angle
Print( Math.Tan(0.785398) ); // (45)
>> 1Returns angle in radians from sinus
sfloatSinus
Returns: float - Angle in radians
Print( Math.Asin(0.707107) ); // (sinus 45)
>> 0.785398Returns angle in radians from cosinus
cfloatCosinus
Returns: float - Angle in radians
Print( Math.Acos(0.707107) ); // (cosinus 45)
>> 0.785398Show 17 more
, ActionPlaceOvenIndoor.ActionCondition(), DayZAnimal.ComputeHitDirectionAngleDeg(), DayZPlayerImplement.EvaluateDamageHitAnimation(), DayZPlayerImplement.EvaluateDeathAnimation(), DayZPlayerImplementMeleeCombat.IsEntityBehindEntityInAngle(), EffectArea.PlaceParticles(), Fence.IsFacingCamera(), Fence.IsFacingPlayer(), FireplaceBase.OnAttachmentRuined(), MiscGameplayFunctions.DropAllItemsInInventoryInBounds(), MiscGameplayFunctions.IsPlayerOrientedTowardPos(), ShelterSite.IsFacingCamera(), TerritoryFlag.IsFacingCamera(), TerritoryFlag.IsFacingPlayer(), Weapon_Base.LiftWeaponCheckEx(), ZombieBase.ComputeHitDirectionAngle(), and ZombieBase.ComputeHitDirectionAngleEx()Returns angle in radians from tangent
xfloatTangent
Returns: float - Angle in radians
Returns angle in radians from tangent
yfloatTangentxfloatTangent
Returns: float - Angle in radians
Print ( Math.Atan2(1, 1) );
>> 0.785398Returns mathematical round of value
ffloatValue
Returns: float - closest whole number to 'f'
Print( Math.Round(5.3) );
Print( Math.Round(5.8) );
>> 5
>> 6Returns floor of value
ffloatValue
Returns: float - Floor of value
Print( Math.Floor(5.3) );
Print( Math.Floor(5.8) );
>> 5
>> 5Show 26 more
, Construction.HasMaterials(), Construction.TakeMaterialsServer(), DayZIntroScenePC.CharacterRotate(), EffectArea.FillWithParticles(), FishYieldItemBase.GetCycleTimeForYieldItem(), IngameHudHeatBuffer.SetBaseAlpha(), ItemBase.SplitItem(), ItemBase.SplitItemToInventoryLocation(), Magazine.SplitItem(), Magazine.SplitItemToInventoryLocation(), MapMenu.ProcessDistanceAndUnits(), MiscGameplayFunctions.CreateItemBasePiles(), MiscGameplayFunctions.CreateItemBasePilesDispersed(), MiscGameplayFunctions.CreateMagazinePiles(), MiscGameplayFunctions.CreateMagazinePilesDispersed(), MiscGameplayFunctions.CreateMagazinePilesFromBullet(), MiscGameplayFunctions.Truncate(), MiscGameplayFunctions.TruncateVec(), MissionMainMenu.SortedInsert(), ServerBrowserTabPc.SortedInsertAsc(), ServerBrowserTabPc.SortedInsertDesc(), ServerBrowserTabPc.SortedInsertEx(), StaticConstructionMethods.SpawnConstructionMaterialPiles(), TutorialKeybinds.Rebuild(), VicinitySlotsContainer.ShowItemsInContainers(), and WorldData.CalcBaseEnvironmentTemperature()Returns ceil of value
ffloatValue
Returns: float - Ceil of value
Print( Math.Ceil(5.3) );
Print( Math.Ceil(5.8) );
>> 6
>> 6Show 15 more
, BleedChanceData.CalculateBleedChance(), BookMenu.NextPrevPage(), CAContinuousMineWood.CreateSecondaryItems(), CargoContainer.UpdateRowVisibility(), CatchingContextFishingRodAction.GetSignalMax(), CatchingContextPoissonBase.GetSignalMax(), CutOutSeeds.Do(), EffectArea.FillWithParticles(), FlammableBase.Upgrade(), MapMenu.ProcessDistanceAndUnits(), OutdoorThermometerManager.Add(), OutdoorThermometerManager.Remove(), PlantBase.Init(), ServerBrowserFavoritesTabConsolePages.LoadExtraEntries(), and Slot.SetFertilizerQuantity()Returns wrap number to specified interval [min, max[
ffloatValueminfloatMinimummaxfloatMaximum
Returns: float - number in specified interval [min, max[
Print( Math.WrapFloat(9.0, 1.0, 9.0) );
>> 1.0Returns wrap number to specified interval, inclusive [min, max]
ffloatValueminfloatMinimummaxfloatMaximum
Returns: float - number in specified interval [min, max]
Print( Math.WrapFloatInclusive(9.0, 1.0, 9.0) );
>> 9.0Returns wrap number to specified interval [0, max[
ffloatValuemaxfloatMaximum
Returns: float - number in specified interval [0, max[
Print( Math.WrapFloat0X(9.0, 9.0) );
>> 0.0Returns wrap number to specified interval, inclusive [0, max]
ffloatValuemaxfloatMaximum
Returns: float - number in specified interval [0, max]
Print( Math.WrapFloat0XInclusive(9.0, 9.0) );
>> 9.0Returns wrap number to specified interval [min, max[
iintValueminfloatMinimummaxintMaximum
Returns: int - number in specified interval [min, max[
Print( Math.WrapInt(9, 1, 9) );
>> 1Returns wrap number to specified interval [0, max[
iintValuemaxintMaximum
Returns: int - number in specified interval [0, max[
Print( Math.WrapInt0X(9, 9) );
>> 0Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'
valuefloatValueminfloatMinimum valuemaxfloatMaximum value
Returns: float - Clamped value
Print( Math.Clamp(-0.1, 0, 1) );
Print( Math.Clamp(2, 0, 1) );
Print( Math.Clamp(0.5, 0, 1) );
>> 0
>> 1
>> 0.5Returns smaller of two given values
xfloatValueyfloatValue
Returns: float - min value
Print( Math.Min(5.3, 2.8) );
>> 2.8Show 35 more
, BroomBase.CalculateQuantity(), CAContinuousDisinfectPlant.Setup(), CAContinuousFill.Setup(), CAContinuousFillCoolant.Setup(), CAContinuousFillFuel.Setup(), CAContinuousFillPowerGenerator.Setup(), CAContinuousQuantityLiquidTransfer.Setup(), CAContinuousRepeatFishing.SetNewSignalData(), CAContinuousTransferQuantity.Setup(), CAContinuousWaterPlant.Setup(), CAContinuousWaterSlot.Setup(), CargoContainer.AddedToCargoEx(), CargoContainer.RemovedFromCargo(), ComponentEnergyManager.SetEnergy(), DayZGame.GetFOVByZoomType(), FlammableBase.Upgrade(), HudDebugWinCharDebug.Update(), InjuredLegNotfr.DisplayBadge(), Liquid.Transfer(), MissionServer.TickScheduler(), PlayerRestrictedAreaInstance.ValidatePlayerRestrictedAreaPositions(), PluginDayZCreatureAIDebug.OnGUI_AnimEvents(), PPEMatClassParameterBool.Update(), PPEMatClassParameterColor.Update(), PPEMatClassParameterFloat.Update(), PPEMatClassParameterInt.Update(), QuickBarBase.updateSlotsCount(), RadialMenu.GetParentMinSize(), ServerBrowserTabConsolePages.RefreshDummyList(), ServerBrowserTabPc.SortedInsertEx(), StaminaHandler.ApplyExhaustion(), StaminaHandler.CalcStaminaGainBonus(), StaminaHandler.DepleteStaminaEx(), StaminaHandler.ProcessStaminaChanges(), and TemperatureDataInterpolated.InterpolateTemperatureDelta()Returns bigger of two given values
xfloatValueyfloatValue
Returns: float - max value
Print( Math.Max(5.3, 2.8) );
>> 5.3Returns if value is between min and max (inclusive)
vfloatValueminfloatMinimum valuemaxfloatMaximum value
Returns: bool - if value is within range [min,max]
Print( Math.IsInRange(6.9, 3.6, 9.3) );
>> trueShow 1 more
, HeatComfortAnimHandler.Process()Returns if value is between min and max (inclusive)
vintValueminintMinimum valuemaxintMaximum value
Returns: bool - if value is within range [min,max]
Print( Math.IsInRangeInt(6, 3, 9) );
>> trueLinearly interpolates between 'a' and 'b' given 'time'.
afloatStartbfloatEndtimefloatTime [value needs to be between 0..1 for correct results, no auto clamp applied]
Returns: float - The interpolated result between the two float values.
Print( Math.Lerp(3, 7, 0.5) );
>> 5Calculates the linear value that produces the interpolant value within the range [a, b], it's an inverse of Lerp.
afloatStartbfloatEndvaluefloatvalue
Returns: 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'
Print( Math.InverseLerp(3, 7, 5) );
>> 0.5Returns area of a right triangle
sfloatLength of adjacent legafloatAngle of corner bordering adjacent which is not the right corner (in radians)
Returns: float - Area
Returns hypotenus of a right triangle
sfloatLength of adjacent legafloatAngle of corner bordering adjacent which is not the right corner (in radians)
Returns: float - hypotenus
Returns if point is inside circle
cvectorCenter of circle ([0] and [2] will be used, as a circle is 2D)rfloatRadius of circlepvectorPoint ([0] and [2] will be used, as a circle is 2D)
Returns: bool - True when point is in circle
Returns if point is inside rectangle
mivectorMinimums of rectangle ([0] and [2] will be used, as a rectangle is 2D)mavectorMaximums of rectangle ([0] and [2] will be used, as a rectangle is 2D)pvectorPoint ([0] and [2] will be used, as a rectangle is 2D)
Returns: bool - True when point is in rectangle
proto static 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
valactualvaluetargetvaluewe are reaching for -> Targetvelocityfloat[1]- array of ONE member - some kind of memory and actual accel/decel rate, need to be zeroed when filter is about to be resetsmoothTimesmoothingparameter, 0.1 .. 0.4 are resonable values, 0.1 is sharp, 0.4 is very smoothmaxVelocitymaximalvalue change when multiplied by dtdtdeltatime
Returns: float smoothed/filtered value
val = EnfMath.SmoothCD(val, varTarget, valVelocity, 0.3, 1000, dt);Show 17 more
, DayZPlayerCamera3rdPersonProneBase.OnUpdate(), DayZPlayerCamera3rdPersonProneBase.UpdateLRAngleLookAt(), DayZPlayerCamera3rdPersonVehicle.OnUpdate(), DayZPlayerCameraBase.StdFovUpdate(), DayZPlayerCameraBase.UpdateLRAngle(), DayZPlayerCameraBase.UpdateLRAngleUnlocked(), DayZPlayerCameraBase.UpdateUDAngle(), DayZPlayerCameraBase.UpdateUDAngleUnlocked(), DayZPlayerCameraIronsights.HoldBreathFOVEffect(), DayZPlayerCameraIronsights.OnUpdate(), DayZPlayerCameraOptics.HoldBreathFOVEffect(), DayZPlayerImplement.HandleWeapons(), DayZPlayerImplementAiming.ApplyHorizontalNoise(), DayZPlayerImplementAiming.ProcessStealthFilters(), HitDirectionEffectBase.CalculateArrowPosition(), SmoothCDPI2PI(), and NotificationUI.Update()static float SmoothCDPI2PI(float val, float target, inout float velocity[], float smoothTime, float maxVelocity, float dt)occurences values above '12' will cause Factorial to overflow int.
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
inputMinfloatMinimal value of given input rangeinputMaxfloatMaximal value of given input rangeoutputMinfloatMinimal value of given output rangeoutputMaxfloatMaximal value of given output rangeinputValuefloatValue we want to remapclampedOutputboolIf value should stay in that range, otherwise it will be extrapolated
Returns: float - Remapped value
Returns if given vectors are equal with given tolerance
v1floatFirst vector for comparisonv2floatSecond vector for comparisontolerancefloatRange in which given vectors can differ
Returns: bool - True if Vectors are equal; otherwise false