From 2d1c676a8b943ff521a084e8e745b4f79a801711 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Thu, 18 Feb 2016 16:17:24 -0800 Subject: [PATCH] Add qHash for Vec2FloatPair --- libraries/render-utils/src/GeometryCache.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/render-utils/src/GeometryCache.h b/libraries/render-utils/src/GeometryCache.h index 1eddb62253..51ec86f3fa 100644 --- a/libraries/render-utils/src/GeometryCache.h +++ b/libraries/render-utils/src/GeometryCache.h @@ -31,7 +31,6 @@ class SimpleProgramKey; -typedef glm::vec3 Vec3Key; typedef QPair Vec2FloatPair; typedef QPair Vec2Pair; typedef QPair 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);