Luanti 5.19.0-dev
Loading...
Searching...
No Matches
numeric.h File Reference
#include "constants.h"
#include "irrlichttypes.h"
#include "irr_v2d.h"
#include "irr_v3d.h"
#include "irr_aabb3d.h"
#include "SColor.h"
#include <matrix4.h>
#include <cmath>
#include <algorithm>
Include dependency graph for numeric.h:

Go to the source code of this file.

Classes

struct  MeshGrid
 Describes a grid with given step, originating at (0,0,0). More...
struct  MyRandGenerator
class  IntervalLimiter

Macros

#define MYRAND_RANGE   0xffffffff

Functions

template<typename T, typename T2, typename T3>
constexpr T rangelim (const T &d, const T2 &min, const T3 &max)
s16 getContainerPos (s16 p, s16 d)
v2s16 getContainerPos (v2s16 p, s16 d)
v3s16 getContainerPos (v3s16 p, s16 d)
v2s16 getContainerPos (v2s16 p, v2s16 d)
v3s16 getContainerPos (v3s16 p, v3s16 d)
void getContainerPosWithOffset (s16 p, s16 d, s16 &container, s16 &offset)
void getContainerPosWithOffset (const v2s16 &p, s16 d, v2s16 &container, v2s16 &offset)
void getContainerPosWithOffset (const v3s16 &p, s16 d, v3s16 &container, v3s16 &offset)
bool isInArea (v3s16 p, s16 d)
bool isInArea (v2s16 p, s16 d)
bool isInArea (v3s16 p, v3s16 d)
template<typename T>
void sortBoxVerticies (core::vector3d< T > &p1, core::vector3d< T > &p2)
template<typename T>
constexpr core::vector2d< T > componentwise_min (const core::vector2d< T > &a, const core::vector2d< T > &b)
template<typename T>
constexpr core::vector2d< T > componentwise_max (const core::vector2d< T > &a, const core::vector2d< T > &b)
template<typename T>
constexpr core::vector3d< T > componentwise_min (const core::vector3d< T > &a, const core::vector3d< T > &b)
template<typename T>
constexpr core::vector3d< T > componentwise_max (const core::vector3d< T > &a, const core::vector3d< T > &b)
float modulo360f (float f)
 Returns f wrapped to the range [-360, 360].
float wrapDegrees_0_360 (float f)
 Returns f wrapped to the range [0, 360].
v3f wrapDegrees_0_360_v3f (v3f v)
 Returns v3f wrapped to the range [0, 360].
float wrapDegrees_180 (float f)
 Returns f wrapped to the range [-180, 180].
u32 myrand ()
void mysrand (u64 seed)
void myrand_bytes (void *out, size_t len)
int myrand_range (int min, int max)
float myrand_range (float min, float max)
float myrand_float ()
u32 get_bits (u32 x, u32 pos, u32 len)
void set_bits (u32 *x, u32 pos, u32 len, u32 val)
u32 calc_parity (u32 v)
u64 murmur_hash_64_ua (const void *key, size_t len, unsigned int seed)
 Calculate MurmurHash64A hash for an arbitrary block of data.
bool isBlockInSight (const v3s16 blockpos_b, v3f camera_pos, v3f camera_dir, const f32 camera_fov, const f32 range, f32 *distance_ptr=nullptr)
bool isBlockInSightEx (const v3s16 blockpos_b, v3f camera_pos, v3f camera_dir, const f32 target_cos_sq, const f32 adjdist, const f32 range, f32 *distance_ptr)
s16 adjustDist (s16 dist, float zoom_fov)
f32 getFovAdj (f32 camera_fov)
f32 getFovCosSq (f32 camera_fov)
s32 myround (f32 f)
template<typename T>
constexpr T sqr (T f)
v3s16 floatToInt (v3f p, f32 d)
v3s16 doubleToInt (v3d p, double d)
v3f intToFloat (v3s16 p, f32 d)
aabb3f getNodeBox (v3s16 p, float d)
f32 damp (f32 a, f32 b, f32 lambda)
constexpr bool is_power_of_two (u32 n)
constexpr u32 npot2 (u32 orig)
template<typename T>
unsigned wrappedDifference (T a, T b, const T maximum)
template<typename T>
void wrappedApproachShortest (T &current, const T target, const T stepsize, const T maximum)
void setPitchYawRollRad (core::matrix4 &m, v3f rot)
void setPitchYawRoll (core::matrix4 &m, v3f rot)
v3f getPitchYawRollRad (const core::matrix4 &m)
v3f getPitchYawRoll (const core::matrix4 &m)
video::SColor multiplyColorValue (const video::SColor &color, float mod)
template<typename T>
constexpr T numericAbsolute (T v)
template<typename T>
constexpr T numericSign (T v)
template<typename T>
constexpr core::vector3d< T > vecAbsolute (const core::vector3d< T > &v)
template<typename T>
constexpr core::vector3d< T > vecSign (const core::vector3d< T > &v)

Variables

static constexpr const f32 BLOCK_MAX_RADIUS = 0.866025403784f * MAP_BLOCKSIZE * BS

Macro Definition Documentation

◆ MYRAND_RANGE

#define MYRAND_RANGE   0xffffffff

Referenced by MyRandGenerator::max().

Function Documentation

◆ adjustDist()

s16 adjustDist ( s16 dist,
float zoom_fov )

References adjustDist().

Here is the call graph for this function:

◆ calc_parity()

u32 calc_parity ( u32 v)
inline

References calc_parity().

Referenced by calc_parity(), ObjDefManager::createHandle(), and ObjDefManager::decodeHandle().

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

◆ componentwise_max() [1/2]

template<typename T>
core::vector2d< T > componentwise_max ( const core::vector2d< T > & a,
const core::vector2d< T > & b )
inlineconstexpr

References componentwise_max().

Referenced by add_object_boxes(), blit_with_alpha2(), componentwise_max(), componentwise_max(), MinimapUpdateThread::getMap(), and imageCleanTransparentWithInlining().

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

◆ componentwise_max() [2/2]

template<typename T>
core::vector3d< T > componentwise_max ( const core::vector3d< T > & a,
const core::vector3d< T > & b )
inlineconstexpr

References componentwise_max().

Here is the call graph for this function:

◆ componentwise_min() [1/2]

template<typename T>
core::vector2d< T > componentwise_min ( const core::vector2d< T > & a,
const core::vector2d< T > & b )
inlineconstexpr

References componentwise_min().

Referenced by add_object_boxes(), blit_with_alpha2(), componentwise_min(), componentwise_min(), MinimapUpdateThread::getMap(), and imageCleanTransparentWithInlining().

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

◆ componentwise_min() [2/2]

template<typename T>
core::vector3d< T > componentwise_min ( const core::vector3d< T > & a,
const core::vector3d< T > & b )
inlineconstexpr

References componentwise_min().

Here is the call graph for this function:

◆ damp()

f32 damp ( f32 a,
f32 b,
f32 lambda )
inline

References damp().

Referenced by damp(), and Game::run().

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

◆ doubleToInt()

v3s16 doubleToInt ( v3d p,
double d )
inlinenodiscard

References doubleToInt().

Referenced by check_v3s16(), doubleToInt(), ModApiEnv::l_get_node_raw(), and read_v3s16().

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

◆ floatToInt()

v3s16 floatToInt ( v3f p,
f32 d )
inlinenodiscard

References floatToInt().

Referenced by SmokePuffCSO::SmokePuffCSO(), voxalgo::VoxelLineIterator::VoxelLineIterator(), ServerEnvironment::addActiveObjectRaw(), collision_check_intersection(), collisionMoveSimple(), Environment::continueRaycast(), Client::CSMClampPos(), Client::CSMClampRadius(), Client::CSMGetNode(), ServerEnvironment::deactivateFarObjects(), floatToInt(), ClientMap::getBackgroundBrightness(), ClientMap::getBlocksWithMeshes(), LuaEntitySAO::getDescription(), LocalPlayer::getFootstepNodePos(), GenericCAO::getLightPosition(), LocalPlayer::getLightPosition(), RemoteClient::GetNextBlocks(), getVisibleBrightness(), LocalPlayer::handleAutojump(), Map::isOccluded(), LocalPlayer::move(), Game::nodePlacement(), LocalPlayer::old_move(), ClientMap::renderPostFx(), Server::sendMetadataChanged(), PlayerSAO::setPos(), GenericCAO::step(), PlayerSAO::step(), TestSAO::testActivate(), TestSAO::testNotSaved(), TestSAO::testShutdown(), TestSAO::testStaticSave(), TestSAO::testStaticToFalse(), TestSAO::testStaticToTrue(), TestVoxelAlgorithms::testVoxelLineIterator(), ClientMap::touchMapBlocks(), ActiveBlockList::update(), Camera::update(), Minimap::updateActiveMarkers(), ClientMap::updateCamera(), ClientMap::updateDrawList(), Game::updateFrame(), Game::updatePointedThing(), and LocalPlayer::updateSneakNode().

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

◆ get_bits()

u32 get_bits ( u32 x,
u32 pos,
u32 len )
inline

References get_bits(), and x.

Referenced by ObjDefManager::decodeHandle(), and get_bits().

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

◆ getContainerPos() [1/5]

s16 getContainerPos ( s16 p,
s16 d )
inline

References getContainerPos().

Referenced by RollbackAction::applyRevert(), Hud::drawBlockBounds(), AreaStore::getAreasForPos(), getContainerPos(), getContainerPos(), getContainerPos(), getContainerPos(), getContainerPos(), EmergeManager::getContainingChunk(), getNodeBlockPos(), ModApiEnv::l_fix_light(), ClientMap::updateCamera(), and ClientMap::updateDrawList().

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

◆ getContainerPos() [2/5]

v2s16 getContainerPos ( v2s16 p,
s16 d )
inline

References getContainerPos().

Here is the call graph for this function:

◆ getContainerPos() [3/5]

v2s16 getContainerPos ( v2s16 p,
v2s16 d )
inline

References getContainerPos().

Here is the call graph for this function:

◆ getContainerPos() [4/5]

v3s16 getContainerPos ( v3s16 p,
s16 d )
inline

References getContainerPos().

Here is the call graph for this function:

◆ getContainerPos() [5/5]

v3s16 getContainerPos ( v3s16 p,
v3s16 d )
inline

References getContainerPos().

Here is the call graph for this function:

◆ getContainerPosWithOffset() [1/3]

void getContainerPosWithOffset ( const v2s16 & p,
s16 d,
v2s16 & container,
v2s16 & offset )
inline

References getContainerPosWithOffset().

Here is the call graph for this function:

◆ getContainerPosWithOffset() [2/3]

void getContainerPosWithOffset ( const v3s16 & p,
s16 d,
v3s16 & container,
v3s16 & offset )
inline

References getContainerPosWithOffset().

Here is the call graph for this function:

◆ getContainerPosWithOffset() [3/3]

void getContainerPosWithOffset ( s16 p,
s16 d,
s16 & container,
s16 & offset )
inline

References getContainerPosWithOffset().

Referenced by getContainerPosWithOffset(), getContainerPosWithOffset(), getContainerPosWithOffset(), and getNodeBlockPosWithOffset().

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

◆ getFovAdj()

f32 getFovAdj ( f32 camera_fov)
inline

References BLOCK_MAX_RADIUS, and getFovAdj().

Referenced by getFovAdj(), RemoteClient::GetNextBlocks(), and isBlockInSight().

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

◆ getFovCosSq()

f32 getFovCosSq ( f32 camera_fov)
inline

References getFovCosSq().

Referenced by getFovCosSq(), RemoteClient::GetNextBlocks(), and isBlockInSight().

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

◆ getNodeBox()

aabb3f getNodeBox ( v3s16 p,
float d )
inlinenodiscard

References getNodeBox().

Referenced by add_area_node_boxes(), and getNodeBox().

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

◆ getPitchYawRoll()

v3f getPitchYawRoll ( const core::matrix4 & m)
inline

References getPitchYawRoll(), and getPitchYawRollRad().

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

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

◆ getPitchYawRollRad()

v3f getPitchYawRollRad ( const core::matrix4 & m)
See also
setPitchYawRollRad

References getPitchYawRollRad().

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

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

◆ intToFloat()

v3f intToFloat ( v3s16 p,
f32 d )
inlinenodiscard

◆ is_power_of_two()

bool is_power_of_two ( u32 n)
inlineconstexpr

References is_power_of_two().

Referenced by ExtrusionMeshCache::create(), is_power_of_two(), and TestUtilities::testIsPowerOfTwo().

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

◆ isBlockInSight()

bool isBlockInSight ( const v3s16 blockpos_b,
v3f camera_pos,
v3f camera_dir,
const f32 camera_fov,
const f32 range,
f32 * distance_ptr = nullptr )
Parameters
blockpos_bposition of block in block coordinates
camera_posposition of camera in nodes
camera_diran unit vector pointing to camera direction
camera_fovin rad
rangeviewing range
distance_ptrreturn location for distance from the camera

References getFovAdj(), getFovCosSq(), isBlockInSight(), and isBlockInSightEx().

Referenced by fillViewConeBlock(), RemoteClient::GetNextBlocks(), isBlockInSight(), and TestUtilities::testIsBlockInSight().

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

◆ isBlockInSightEx()

bool isBlockInSightEx ( const v3s16 blockpos_b,
v3f camera_pos,
v3f camera_dir,
const f32 target_cos_sq,
const f32 adjdist,
const f32 range,
f32 * distance_ptr )
Parameters
blockpos_bposition of block in block coordinates
camera_posposition of camera in nodes
camera_diran unit vector pointing to camera direction
target_cos_sqpre-computed adjusted cos^2(camera fov) (use getFovCosSq(...))
adjdistpre-computed camera distance adjustment (use getFovAdj(...))
rangeviewing range
distance_ptrreturn location for distance from the camera

References BS, intToFloat(), isBlockInSightEx(), and MAP_BLOCKSIZE.

Referenced by RemoteClient::GetNextBlocks(), isBlockInSight(), and isBlockInSightEx().

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

◆ isInArea() [1/3]

bool isInArea ( v2s16 p,
s16 d )
inline

References isInArea().

Here is the call graph for this function:

◆ isInArea() [2/3]

bool isInArea ( v3s16 p,
s16 d )
inline

References isInArea().

Referenced by isInArea(), isInArea(), and isInArea().

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

◆ isInArea() [3/3]

bool isInArea ( v3s16 p,
v3s16 d )
inline

References isInArea().

Here is the call graph for this function:

◆ modulo360f()

float modulo360f ( float f)
inlinenodiscard

Returns f wrapped to the range [-360, 360].

See test.cpp for example cases.

Note
This is also used in cases where degrees wrapped to the range [0, 360] is inappropriate (e.g. pitch needs negative values)

References modulo360f().

Referenced by modulo360f(), Server::process_PlayerPos(), GenericCAO::step(), LuaEntitySAO::step(), TestUtilities::testAngleWrapAround(), wrapDegrees_0_360(), wrapDegrees_0_360_v3f(), and wrapDegrees_180().

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

◆ multiplyColorValue()

video::SColor multiplyColorValue ( const video::SColor & color,
float mod )
inline

References multiplyColorValue().

Referenced by multiplyColorValue(), and GUIButton::setFromStyle().

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

◆ murmur_hash_64_ua()

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

Calculate MurmurHash64A hash for an arbitrary block of data.

Parameters
keydata to hash (does not need to be aligned)
lenlength in bytes
seedinitial seed value
Returns
hash value

References murmur_hash_64_ua().

Referenced by check_field_or_nil(), getHashForString(), init_common(), ModApiBase::l_deprecated_function(), logOnce(), murmur_hash_64_ua(), read_seed(), and script_log_unique().

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

◆ myrand()

u32 myrand ( )

References g_pcgrand, myrand(), and PcgRandom::next().

Referenced by Sky::Sky(), ObjDefManager::addRaw(), ScriptApiServer::allocateDynamicMediaCallback(), ISoundManager::allocateId(), ABMHandler::apply(), Game::createClient(), ImageSource::generateImagePart(), sound::OpenALSoundManager::getLoadedSoundNameFromGroup(), TestBase::getTestTempFile(), myrand(), MyRandGenerator::operator()(), MapgenV6::placeTreesAndJungleGrass(), RandomInputHandler::Rand(), and UDPSocket::Send().

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(), g_pcgrand, and myrand_bytes().

Referenced by GUIDGenerator::GUIDGenerator(), httpfetch_caller_alloc_secure(), myrand_bytes(), and MapgenParams::readParams().

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

◆ myrand_float()

float myrand_float ( )

References g_pcgrand, myrand_float(), PcgRandom::next(), and U32_MAX.

Referenced by myrand_float(), myrand_range(), ParticleParamTypes::RangedParameter< T >::pickWithin(), and ParticleSpawner::step().

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

◆ myrand_range() [1/2]

float myrand_range ( float min,
float max )

References myrand_float(), and myrand_range().

Here is the call graph for this function:

◆ myrand_range() [2/2]

int myrand_range ( int min,
int max )

References g_pcgrand, myrand_range(), 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(), myrand_range(), myrand_range(), Schematic::placeOnMap(), Schematic::placeOnVManip(), MapgenV6::placeTreesAndJungleGrass(), readRandomBlocks(), and ParticleSpawner::spawnParticle().

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

◆ myround()

s32 myround ( f32 f)
inlinenodiscard

References myround().

Referenced by Hud::Hud(), Camera::drawNametags(), Server::ShutdownState::getShutdownTimerMessage(), myround(), GUIChatConsole::OnEvent(), Game::processKeyInput(), PcgRandom::randNormalDist(), GUIFormSpecMenu::regenerateGui(), Server::requestShutdown(), ParsedText::Element::setStyle(), GUITable::setTable(), TestUtilities::testMyround(), TestRandom::testPcgRandomNormalDist(), treegen::tree_fruit_placement(), treegen::tree_leaves_placement(), treegen::tree_single_leaves_placement(), and treegen::tree_trunk_placement().

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

◆ mysrand()

void mysrand ( u64 seed)

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

Referenced by init_common(), and mysrand().

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

◆ npot2()

u32 npot2 ( u32 orig)
inlineconstexpr

References npot2().

Referenced by createInventoryCubeImage(), guiScalingResizeCached(), and npot2().

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

◆ numericAbsolute()

template<typename T>
T numericAbsolute ( T v)
inlineconstexpr

References numericAbsolute().

Referenced by numericAbsolute(), ParticleParamTypes::RangedParameter< T >::pickWithin(), ParticleSpawner::spawnParticle(), and vecAbsolute().

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

◆ numericSign()

template<typename T>
T numericSign ( T v)
inlineconstexpr

References numericSign().

Referenced by numericSign(), ParticleSpawner::spawnParticle(), and vecSign().

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

◆ rangelim()

template<typename T, typename T2, typename T3>
T rangelim ( const T & d,
const T2 & min,
const T3 & max )
inlinenodiscardconstexpr

References rangelim().

Referenced by EmergeManager::EmergeManager(), GUIChatConsole::GUIChatConsole(), Hud::Hud(), KeyPressEvent::KeyPressEvent(), MeshUpdateManager::MeshUpdateManager(), MeshUpdateWorkerThread::MeshUpdateWorkerThread(), ServerEnvironment::ServerEnvironment(), ServerMap::ServerMap(), Sky::Sky(), Camera::addArmInertia(), ChatBackend::applySettings(), GUIFormSpecMenu::autoScroll(), MapgenV6::baseTerrainLevel(), MapgenV7::baseTerrainLevelAtPoint(), MapgenV7::baseTerrainLevelFromMap(), ServerMap::blockpos_over_mapgen_limit(), ClientLauncher::config_guienv(), RenderingEngine::draw_load_screen(), Hud::drawBlockBounds(), Camera::drawNametags(), Map::forEachNodeInArea(), ImageSource::generateImagePart(), get_mapgen_edges(), Settings::getFloat(), getHitParams(), getInteriorLight(), MapblockMeshGenerator::getLiquidNeighborhood(), RemoteClient::GetNextBlocks(), Server::getProtocolVersionMin(), getSmoothLightCorner(), Game::handleClientEvent_PlayerDamage(), Game::handleClientEvent_SetSky(), imageScaleNNAA(), GameUI::init(), FontEngine::initFont(), ObjectRef::l_set_eye_offset(), ObjectRef::l_set_lighting(), ObjectRef::l_set_sky(), CavesRandomWalk::makeCave(), CavesV6::makeCave(), LocalPlayer::move(), LocalPlayer::old_move(), GUITable::OnEvent(), ParsedText::parseTag(), rangelim(), read_item_definition(), read_minimap_mode(), read_object_properties(), MapgenParams::readParams(), Clouds::readSettings(), FontEngine::readSettings(), Game::readSettings(), TextureSettings::readSettings(), recompress_map_database(), Server::SendBlockNoLock(), ToolCapabilities::serialize(), Sky::setBodyOrbitTilt(), PlayerSAO::setBreath(), LuaEntitySAO::setHP(), PlayerSAO::setHP(), con::Channel::setWindowSize(), sound_volume_control(), takeScreenshot(), Camera::update(), Sky::update(), and Game::updateCameraOrientation().

Here is the call graph for this function:

◆ set_bits()

void set_bits ( u32 * x,
u32 pos,
u32 len,
u32 val )
inline

References set_bits(), and x.

Referenced by ObjDefManager::createHandle(), ObjDefManager::decodeHandle(), and set_bits().

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

◆ setPitchYawRoll()

void setPitchYawRoll ( core::matrix4 & m,
v3f rot )
inline

References setPitchYawRoll(), and setPitchYawRollRad().

Referenced by UnitSAO::getTotalRotation(), roundTripsDeg(), setPitchYawRoll(), TestUtilities::testEulerConversion(), and GenericCAO::updateNodePos().

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

◆ setPitchYawRollRad()

void setPitchYawRollRad ( core::matrix4 & m,
v3f rot )
Note
Uses (extrinsic) Z-X-Y rotation order, left-handed rotation
This is not consistent with matrix4::setRotationRadians

References setPitchYawRollRad().

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

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

◆ sortBoxVerticies()

template<typename T>
void sortBoxVerticies ( core::vector3d< T > & p1,
core::vector3d< T > & p2 )
inline

◆ sqr()

template<typename T>
T sqr ( T f)
inlinenodiscardconstexpr

References sqr().

Referenced by MapgenFractal::getFractalAtPoint(), and sqr().

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

◆ vecAbsolute()

template<typename T>
core::vector3d< T > vecAbsolute ( const core::vector3d< T > & v)
inlineconstexpr

References numericAbsolute(), and vecAbsolute().

Referenced by Particle::step(), and vecAbsolute().

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

◆ vecSign()

template<typename T>
core::vector3d< T > vecSign ( const core::vector3d< T > & v)
inlineconstexpr

References numericSign(), and vecSign().

Referenced by Particle::step(), and vecSign().

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

◆ wrapDegrees_0_360()

float wrapDegrees_0_360 ( float f)
inlinenodiscard

Returns f wrapped to the range [0, 360].

References modulo360f(), and wrapDegrees_0_360().

Referenced by Server::process_PlayerPos(), GenericCAO::step(), LuaEntitySAO::step(), TestUtilities::testAngleWrapAround(), GameUI::update(), Sky::update(), wrapDegrees_0_360(), and yawToDirectionString().

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

◆ wrapDegrees_0_360_v3f()

v3f wrapDegrees_0_360_v3f ( v3f v)
inlinenodiscard

Returns v3f wrapped to the range [0, 360].

References modulo360f(), and wrapDegrees_0_360_v3f().

Referenced by GenericCAO::processInitData(), GenericCAO::processMessage(), TestUtilities::testWrapDegrees_0_360_v3f(), and wrapDegrees_0_360_v3f().

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

◆ wrapDegrees_180()

float wrapDegrees_180 ( float f)
inlinenodiscard

Returns f wrapped to the range [-180, 180].

References modulo360f(), and wrapDegrees_180().

Referenced by TestUtilities::testAngleWrapAround(), GameUI::update(), GenericCAO::updateTextureAnim(), and wrapDegrees_180().

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

◆ wrappedApproachShortest()

template<typename T>
void wrappedApproachShortest ( T & current,
const T target,
const T stepsize,
const T maximum )
inline

References wrappedApproachShortest().

Referenced by GenericCAO::step(), LuaEntitySAO::step(), SmoothTranslatorWrapped::translate(), SmoothTranslatorWrappedv3f::translate(), and wrappedApproachShortest().

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

◆ wrappedDifference()

template<typename T>
unsigned wrappedDifference ( T a,
T b,
const T maximum )
inline

References wrappedDifference().

Referenced by wrappedDifference().

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

Variable Documentation

◆ BLOCK_MAX_RADIUS

const f32 BLOCK_MAX_RADIUS = 0.866025403784f * MAP_BLOCKSIZE * BS
staticconstexpr

Referenced by getFovAdj().