mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
the final rename
This commit is contained in:
parent
f27a418dbe
commit
1627e21c1d
196 changed files with 836 additions and 815 deletions
23
src/maths/fastmaths.hpp
Normal file
23
src/maths/fastmaths.hpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef MATHS_FASTMATHS_HPP_
|
||||
#define MATHS_FASTMATHS_HPP_
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
|
||||
class FastRandom {
|
||||
uint seed;
|
||||
public:
|
||||
inline void setSeed(uint seed) {
|
||||
this->seed = seed;
|
||||
}
|
||||
|
||||
inline int rand() {
|
||||
seed = (214013 * seed + 2531011);
|
||||
return (seed>>16) & 0x7FFF;
|
||||
}
|
||||
|
||||
inline float randFloat() {
|
||||
return rand() / float(0x7FFF);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MATHS_FASTMATHS_HPP_
|
||||
Loading…
Add table
Add a link
Reference in a new issue