Add qHash for Vec2FloatPair

This commit is contained in:
Zach Pomerantz 2016-02-18 16:17:24 -08:00
parent af791e8f72
commit 2d1c676a8b

View file

@ -31,7 +31,6 @@
class SimpleProgramKey;
typedef glm::vec3 Vec3Key;
typedef QPair<glm::vec2, float> Vec2FloatPair;
typedef QPair<glm::vec2, glm::vec2> Vec2Pair;
typedef QPair<Vec2Pair, Vec2Pair> Vec2PairPair;
@ -48,6 +47,11 @@ inline uint qHash(const glm::vec2& v, uint seed) {
return qHash(v.x + 5009 * v.y, seed);
}
inline uint qHash(const Vec2FloatPair& v, uint seed) {
// multiply by prime numbers greater than the possible size
return qHash(v.first.x + 5009 * v.first.y + 5011 * v.second);
}
inline uint qHash(const Vec2Pair& v, uint seed) {
// multiply by prime numbers greater than the possible size
return qHash(v.first.x + 5009 * v.first.y + 5011 * v.second.x + 5021 * v.second.y, seed);