minor changes

This commit is contained in:
Yggdrasil75
2025-12-03 09:29:07 -05:00
parent ed3ab980ed
commit f6dfe995d9
2 changed files with 8 additions and 2 deletions

View File

@@ -121,9 +121,9 @@ std::vector<std::tuple<size_t, Vec3, Vec4>> pickSeeds(Grid3& grid, AnimationConf
int maxTries = 0; int maxTries = 0;
while (!foundValidPos && maxTries < 10) { while (!foundValidPos && maxTries < 10) {
maxTries++; maxTries++;
size_t id = grid.getPositionVec(point, 0.5); //size_t id = grid.getPositionVec(point, 0.5);
size_t id = grid.getOrCreatePositionVec(point, 0.0, true);
if (id > 0) foundValidPos = true; if (id > 0) foundValidPos = true;
//size_t id = grid.getOrCreatePositionVec(point, 0.0, true);
grid.setColor(id, color); grid.setColor(id, color);
seeds.push_back(std::make_tuple(id,point, color)); seeds.push_back(std::make_tuple(id,point, color));
} }

View File

@@ -375,6 +375,12 @@ public:
return "RGBA(" + std::to_string(r) + ", " + std::to_string(g) + ", " + return "RGBA(" + std::to_string(r) + ", " + std::to_string(g) + ", " +
std::to_string(b) + ", " + std::to_string(a) + ")"; std::to_string(b) + ", " + std::to_string(a) + ")";
} }
struct Hash {
std::size_t operator()(const Vec4& v) const {
return std::hash<float>()(v.x) ^ (std::hash<float>()(v.y) << 1) ^ (std::hash<float>()(v.z) << 2) ^ (std::hash<float>()(v.w) << 3);
}
};
}; };
inline std::ostream& operator<<(std::ostream& os, const Vec4& vec) { inline std::ostream& operator<<(std::ostream& os, const Vec4& vec) {