diff --git a/CMakeLists.txt b/CMakeLists.txt index 3958c1a..f288a84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.24) -project(BLT VERSION 0.5.0) +project(BLT VERSION 0.5.1) set(CMAKE_CXX_STANDARD 17) diff --git a/cmake-build-release/CMakeCache.txt b/cmake-build-release/CMakeCache.txt index 42cdd12..8125f20 100644 --- a/cmake-build-release/CMakeCache.txt +++ b/cmake-build-release/CMakeCache.txt @@ -181,7 +181,7 @@ CMAKE_PROJECT_HOMEPAGE_URL:STATIC= CMAKE_PROJECT_NAME:STATIC=BLT_TESTS //Value Computed by CMake -CMAKE_PROJECT_VERSION:STATIC=0.5.0 +CMAKE_PROJECT_VERSION:STATIC=0.5.1 //Value Computed by CMake CMAKE_PROJECT_VERSION_MAJOR:STATIC=0 @@ -190,7 +190,7 @@ CMAKE_PROJECT_VERSION_MAJOR:STATIC=0 CMAKE_PROJECT_VERSION_MINOR:STATIC=5 //Value Computed by CMake -CMAKE_PROJECT_VERSION_PATCH:STATIC=0 +CMAKE_PROJECT_VERSION_PATCH:STATIC=1 //Value Computed by CMake CMAKE_PROJECT_VERSION_TWEAK:STATIC= diff --git a/cmake-build-release/CMakeFiles/clion-Release-log.txt b/cmake-build-release/CMakeFiles/clion-Release-log.txt index b46c33f..6c751e9 100644 --- a/cmake-build-release/CMakeFiles/clion-Release-log.txt +++ b/cmake-build-release/CMakeFiles/clion-Release-log.txt @@ -3,7 +3,7 @@ Standard Files /home/brett/Documents/code/c++/BLT/src/blt/std/filesystem.cpp;/ho Profiler Files /home/brett/Documents/code/c++/BLT/src/blt/profiling/profiler.cpp Source: /home/brett/Documents/code/c++/BLT Current Source: /home/brett/Documents/code/c++/BLT -BLT 0.5.0 Successfully included! +BLT 0.5.1 Successfully included! BLT tests included! -- Configuring done -- Generating done diff --git a/include/blt/math/math.h b/include/blt/math/math.h index d27a989..08e5d80 100644 --- a/include/blt/math/math.h +++ b/include/blt/math/math.h @@ -11,6 +11,30 @@ #include namespace blt { + + /** + * fast number integer + */ + unsigned int f_randi(unsigned int seed) { + seed = (seed << 13) ^ seed; + return ((seed * (seed * seed * 15731 + 789221) + 1376312589) & 0x7fffffff); + } + + /** + * fast inverse sqrt + */ + float fsqrt(float n){ + int i; + float x, y; + x = n * 0.5f; + y = n; + i = * (int*) &y; + i = 0x5f3759df - (i >> 1); + y = * (float*) &i; + y = y * (1.5f - (x * y * y)); + y = y * (1.5f - (x * y * y)); + return y; + } // inline std::ostream& operator<<(std::ostream& out, const mat4x4& v) { // return out << "\rMatrix4x4{" << v.m00() << ", " << v.m01() << ", " << v.m02() << ", " << v.m03() << "} \n"\ diff --git a/include/blt/math/matrix.h b/include/blt/math/matrix.h index 0c935a1..96fc5ce 100644 --- a/include/blt/math/matrix.h +++ b/include/blt/math/matrix.h @@ -262,6 +262,7 @@ namespace blt { // https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/building-basic-perspective-projection-matrix.html // https://ogldev.org/www/tutorial12/tutorial12.html + // http://www.songho.ca/opengl/gl_projectionmatrix.html static inline mat4x4 perspective(float fov, float aspect_ratio, float near, float far){ mat4x4 perspectiveMat4x4 {emptyMatrix};