Hash key for vector of 3 ints

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • onelesscar

    Hash key for vector of 3 ints


    Hi all,


    I'm currently creating my hash key by stuffing the bits into an
    unsigned long long.

    key = static_cast<uin t64>(x) | (static_cast<ui nt64>(y) << 20) |
    (static_cast<ui nt64>(z) << 40);

    But this limits the range in x,y,z.

    I've made a few attempts in Visual Studio including making an XOR of
    the vector ints.
    I don't think the XOR gives keys that are unique enough.

    error C2440: 'type cast' : cannot convert from 'const vector3i' to
    'size_t' c:\program files\microsoft visual studio 8\vc\include
    \xhash


    Anyone have an example or hints?
    thanks

Working...