DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ RandomFloatInclusive()

static float Math::RandomFloatInclusive ( float min,
float max )
inlinestaticprivate

Returns a random float number between and min [inclusive] and max [inclusive].

Аргументы
minfloat Range starts [inclusive]
maxfloat Range ends [inclusive]
Возвращает
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.0
proto void Print(void var)
Prints content of variable to console/log.
void Math()
Определения EnMath.c:8

См. определение в файле EnMath.c строка 106

107 {
108 int max_range = Math.Pow(2, 30); //max range
109 int random_int = Math.RandomInt(0, max_range);
110 float rand_float = (float)random_int / (float)max_range;
111 float range = max - min;
112
113 return min + (rand_float * range); //rand float
114 }

Перекрестные ссылки Math().

Используется в ActionRepairVehiclePartBase::AdjustVehicleHealthServer(), PlayerSpawnHandler::ApplyAttributes(), AttachBleedingToZonesByHeight(), InfluenzaAgent::AutoinfectCheck(), EnochData::CalculateWind(), SakhalData::CalculateWind(), WorldData::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(), DynamicMusicPlayer::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(), ContaminatedArea_Dynamic::SpawnItems(), BleedingIndicatorDropData::StartDrop(), EnochData::WeatherOnBeforeChange(), SakhalData::WeatherOnBeforeChange() и WorldData::WeatherOnBeforeChange().