refactoring btw

This commit is contained in:
A-lex-Ra
2023-12-20 22:23:55 +06:00
parent bcfdc55277
commit 76475dd1b1
6 changed files with 21 additions and 26 deletions
+3 -8
View File
@@ -4,6 +4,8 @@
// #include "../typedefs.h"
#include "aabb.h"
#include "glm/glm.hpp"
#define GLM_ENABLE_EXPERIMENTAL
#include "glm/gtx/hash.hpp"
#include <array>
#include <unordered_map>
@@ -35,16 +37,9 @@ public:
};
template<>
struct std::hash<rayvec3>{
std::size_t operator()(const rayvec3& r) const noexcept{
return std::hash<scalar_t>{}(r.x) ^ (std::hash<scalar_t>{}(r.y) << 1) ^ (std::hash<scalar_t>{}(r.z) << 2);
}
};
class Ray{
protected:
static const bool IS_RAYS_BOX_CACHE_ON = false;
static const bool IS_RAYS_BOX_CACHE_ON = false; // Now not working properly because not observe updates
static std::unordered_map<rayvec3, AABBFaces> raysBoxCache_; //[boxPos]: faces array
public: