diff --git a/include/blt/math/matrix.h b/include/blt/math/matrix.h index 0aa3dfc..d354ce6 100644 --- a/include/blt/math/matrix.h +++ b/include/blt/math/matrix.h @@ -58,15 +58,19 @@ namespace blt { } inline mat4x4& translate(float x, float y, float z) { + mat4x4 translation_mat {}; /** * 9.005 Are OpenGL matrices column-major or row-major? * For programming purposes, OpenGL matrices are 16-value arrays with base vectors laid out contiguously in memory. * The translation components occupy the 13th, 14th, and 15th elements of the 16-element matrix, * where indices are numbered from 1 to 16 as described in section 2.11.2 of the OpenGL 2.1 Specification. */ - m03(x); - m13(y); - m23(z); + translation_mat.m03(x); + translation_mat.m13(y); + translation_mat.m23(z); + + *this = *this * translation_mat; + return *this; } @@ -74,9 +78,14 @@ namespace blt { inline mat4x4& translate(const vec3& vec) { return translate(vec[0], vec[1], vec[2]); } inline mat4x4& scale(float x, float y, float z) { + mat4x4 scale_mat {}; + m00(m00() * x); m11(m11() * y); m22(m11() * z); + + *this = *this * scale_mat; + return *this; } diff --git a/include/blt/std/hash_map.h b/include/blt/std/hash_map.h new file mode 100644 index 0000000..6800e1c --- /dev/null +++ b/include/blt/std/hash_map.h @@ -0,0 +1,11 @@ +/* + * Created by Brett on 31/03/23. + * Licensed under GNU General Public License V3.0 + * See LICENSE file for license detail + */ + +#ifndef BLT_HASH_MAP_H +#define BLT_HASH_MAP_H + + +#endif //BLT_HASH_MAP_H diff --git a/src/tests/hashmap_tests.h b/src/tests/hashmap_tests.h new file mode 100644 index 0000000..1a5157b --- /dev/null +++ b/src/tests/hashmap_tests.h @@ -0,0 +1,18 @@ +/* + * Created by Brett on 31/03/23. + * Licensed under GNU General Public License V3.0 + * See LICENSE file for license detail + */ + +#ifndef BLT_TESTS_HASHMAP_TEXTS_H +#define BLT_TESTS_HASHMAP_TEXTS_H + +#include + +inline static int test_hashmaps(){ + + + return 0; +} + +#endif //BLT_TESTS_HASHMAP_TEXTS_H diff --git a/src/tests/main.cpp b/src/tests/main.cpp index 603add2..ebaf4a0 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -8,6 +8,7 @@ #include "blt/math/vectors.h" #include "blt/math/matrix.h" #include +#include "hashmap_tests.h" int main() { binaryTreeTest(); @@ -41,5 +42,10 @@ int main() { std::cout << result.x() << " " << result.y() << " " << result.z() << " " << result.w() << std::endl; + if (test_hashmaps()){ + BLT_FATAL("Hashmap test failed!"); + return 1; + } + return 0; } \ No newline at end of file