Minetest  5.4.0
numeric.cpp File Reference
#include "numeric.h"
#include "log.h"
#include "constants.h"
#include "noise.h"
#include "threading/mutex_auto_lock.h"
#include <cstring>
#include <cmath>
+ Include dependency graph for numeric.cpp:

Functions

u32 myrand ()
 
void mysrand (unsigned int seed)
 
void myrand_bytes (void *out, size_t len)
 
int myrand_range (int min, int 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)
 
s16 adjustDist (s16 dist, float zoom_fov)
 
void setPitchYawRollRad (core::matrix4 &m, const v3f &rot)
 
v3f getPitchYawRollRad (const core::matrix4 &m)
 

Variables

PcgRandom g_pcgrand
 

Function Documentation

◆ adjustDist()

s16 adjustDist ( s16  dist,
float  zoom_fov 
)

Referenced by RemoteClient::GetNextBlocks(), and Camera::updateViewingRange().

+ Here is the caller graph for this function:

◆ getPitchYawRollRad()

v3f getPitchYawRollRad ( const core::matrix4 &  m)

Referenced by getPitchYawRoll(), and TestUtilities::testEulerConversion().

+ Here is the caller graph for this function:

◆ isBlockInSight()

bool isBlockInSight ( v3s16  blockpos_b,
v3f  camera_pos,
v3f  camera_dir,
f32  camera_fov,
f32  range,
f32 *  distance_ptr 
)

References BS, MAP_BLOCKSIZE, and MYMAX.

Referenced by fillViewConeBlock(), RemoteClient::GetNextBlocks(), ClientMap::renderMap(), and ClientMap::updateDrawList().

+ Here is the caller graph for this function:

◆ murmur_hash_64_ua()

u64 murmur_hash_64_ua ( const void *  key,
int  len,
unsigned int  seed 
)

References seed.

Referenced by check_field_or_nil(), getHashForString(), ModApiBase::l_deprecated_function(), and read_seed().

+ Here is the caller graph for this function:

◆ myrand()

u32 myrand ( )

References g_pcgrand, and PcgRandom::next().

Referenced by ObjDefManager::addRaw(), ABMHandler::apply(), Server::findSpawnPos(), TextureSource::generateImagePart(), OpenALSoundManager::getBuffer(), TestBase::getTestTempDirectory(), TestBase::getTestTempFile(), MapgenV6::placeTreesAndJungleGrass(), RandomInputHandler::Rand(), UDPSocket::Send(), and Sky::setStarCount().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ myrand_bytes()

void myrand_bytes ( void *  out,
size_t  len 
)

References PcgRandom::bytes(), and g_pcgrand.

Referenced by MapgenParams::readParams().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ myrand_range()

int myrand_range ( int  min,
int  max 
)

References g_pcgrand, and PcgRandom::range().

Referenced by ABMWithState::ABMWithState(), MapBlockMesh::animate(), Schematic::blitToVManip(), ClientMap::getBackgroundBrightness(), ClientLauncher::launch_game(), Schematic::placeOnMap(), Schematic::placeOnVManip(), and MapgenV6::placeTreesAndJungleGrass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mysrand()

void mysrand ( unsigned int  seed)

References g_pcgrand, PcgRandom::seed(), and seed.

Referenced by init_common().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPitchYawRollRad()

void setPitchYawRollRad ( core::matrix4 &  m,
const v3f rot 
)

Referenced by setPitchYawRoll(), and TestUtilities::testEulerConversion().

+ Here is the caller graph for this function:

Variable Documentation

◆ g_pcgrand

PcgRandom g_pcgrand