#include "numeric.h"
#include "log.h"
#include "constants.h"
#include "noise.h"
#include "threading/mutex_auto_lock.h"
#include <cstring>
#include <cmath>
Functions | |
u32 | myrand () |
void | mysrand (unsigned int seed) |
void | myrand_bytes (void *out, size_t len) |
float | myrand_float () |
int | myrand_range (int min, int max) |
float | myrand_range (float min, float max) |
u64 | murmur_hash_64_ua (const void *key, int len, unsigned int seed) |
bool | isBlockInSight (v3s16 blockpos_b, v3f camera_pos, v3f camera_dir, f32 camera_fov, f32 range, f32 *distance_ptr) |
float | adjustDist (float dist, float zoom_fov) |
s16 | adjustDist (s16 dist, float zoom_fov) |
void | setPitchYawRollRad (core::matrix4 &m, v3f rot) |
v3f | getPitchYawRollRad (const core::matrix4 &m) |
Variables | |
static PcgRandom | g_pcgrand |
|
inline |
Referenced by adjustDist(), DirectionalLight::createSplitMatrices(), RemoteClient::GetNextBlocks(), and Camera::updateViewingRange().
s16 adjustDist | ( | s16 | dist, |
float | zoom_fov ) |
v3f getPitchYawRollRad | ( | const core::matrix4 & | m | ) |
Referenced by getPitchYawRoll(), and TestUtilities::testEulerConversion().
bool isBlockInSight | ( | v3s16 | blockpos_b, |
v3f | camera_pos, | ||
v3f | camera_dir, | ||
f32 | camera_fov, | ||
f32 | range, | ||
f32 * | distance_ptr ) |
References BLOCK_MAX_RADIUS, BS, MAP_BLOCKSIZE, and MYMAX.
Referenced by fillViewConeBlock(), RemoteClient::GetNextBlocks(), and TestUtilities::testIsBlockInSight().
u64 murmur_hash_64_ua | ( | const void * | key, |
int | len, | ||
unsigned int | seed ) |
Referenced by check_field_or_nil(), getHashForString(), ModApiBase::l_deprecated_function(), logOnce(), read_seed(), and script_log_unique().
u32 myrand | ( | ) |
References g_pcgrand, and PcgRandom::next().
Referenced by Sky::Sky(), ObjDefManager::addRaw(), ScriptApiServer::allocateDynamicMediaCallback(), ISoundManager::allocateId(), ABMHandler::apply(), ImageSource::generateImagePart(), sound::OpenALSoundManager::getLoadedSoundNameFromGroup(), TestBase::getTestTempFile(), MyRandGenerator::operator()(), MapgenV6::placeTreesAndJungleGrass(), RandomInputHandler::Rand(), and UDPSocket::Send().
void myrand_bytes | ( | void * | out, |
size_t | len ) |
References PcgRandom::bytes(), and g_pcgrand.
Referenced by MapgenParams::readParams().
float myrand_float | ( | ) |
References g_pcgrand, PcgRandom::next(), and U32_MAX.
Referenced by ParticleSpawner::ParticleSpawner(), myrand_range(), ParticleParamTypes::RangedParameter< T >::pickWithin(), and ParticleSpawner::step().
float myrand_range | ( | float | min, |
float | max ) |
int myrand_range | ( | int | min, |
int | max ) |
References g_pcgrand, and PcgRandom::range().
Referenced by ABMWithState::ABMWithState(), ParticleManager::addNodeParticle(), MapBlockMesh::animate(), benchGetObjectsInArea(), ParticleParamTypes::TweenedParameter< T >::blend(), Schematic::blitToVManip(), con::Connection::createPeer(), Server::findSpawnPos(), ClientMap::getBackgroundBrightness(), ParticleManager::getNodeParticleParams(), Map::isBlockOccluded(), ClientLauncher::launch_game(), Schematic::placeOnMap(), Schematic::placeOnVManip(), MapgenV6::placeTreesAndJungleGrass(), and ParticleSpawner::spawnParticle().
void mysrand | ( | unsigned int | seed | ) |
References g_pcgrand, and PcgRandom::seed().
Referenced by init_common().
void setPitchYawRollRad | ( | core::matrix4 & | m, |
v3f | rot ) |
Referenced by setPitchYawRoll(), and TestUtilities::testEulerConversion().
|
static |
Referenced by myrand(), myrand_bytes(), myrand_float(), myrand_range(), and mysrand().