mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
General code refactoring/improvements in server, treegen and connection
This commit is contained in:
@@ -250,6 +250,16 @@ int myrand_range(int min, int max);
|
||||
float myrand_range(float min, float max);
|
||||
float myrand_float();
|
||||
|
||||
// Implements a C++11 UniformRandomBitGenerator using the above functions
|
||||
struct MyRandGenerator {
|
||||
typedef u32 result_type;
|
||||
static constexpr result_type min() { return 0; }
|
||||
static constexpr result_type max() { return MYRAND_RANGE; }
|
||||
inline result_type operator()() {
|
||||
return myrand();
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Miscellaneous functions
|
||||
*/
|
||||
@@ -448,18 +458,18 @@ inline void wrappedApproachShortest(T ¤t, const T target, const T stepsize
|
||||
}
|
||||
}
|
||||
|
||||
void setPitchYawRollRad(core::matrix4 &m, const v3f &rot);
|
||||
void setPitchYawRollRad(core::matrix4 &m, v3f rot);
|
||||
|
||||
inline void setPitchYawRoll(core::matrix4 &m, const v3f &rot)
|
||||
inline void setPitchYawRoll(core::matrix4 &m, v3f rot)
|
||||
{
|
||||
setPitchYawRollRad(m, rot * core::DEGTORAD64);
|
||||
setPitchYawRollRad(m, rot * core::DEGTORAD);
|
||||
}
|
||||
|
||||
v3f getPitchYawRollRad(const core::matrix4 &m);
|
||||
|
||||
inline v3f getPitchYawRoll(const core::matrix4 &m)
|
||||
{
|
||||
return getPitchYawRollRad(m) * core::RADTODEG64;
|
||||
return getPitchYawRollRad(m) * core::RADTODEG;
|
||||
}
|
||||
|
||||
// Muliply the RGB value of a color linearly, and clamp to black/white
|
||||
|
Reference in New Issue
Block a user