How do I find hash value of a 3D vector?

前端 未结 4 2171
一向
一向 2021-02-10 07:19

I am trying to perform broad-phase collision detection with a fixed-grid size approach. Thus, for each entity\'s position: (x,y,z) (each of type float), I need to find which cel

相关标签:
4条回答
  • 2021-02-10 07:28

    here are a few references you could look at. Warren's papers discuss the hash algorithm in detail:

    A parallel hashed Oct-Tree N-body algorithm

    A portable parallel particle program

    0 讨论(0)
  • 2021-02-10 07:40

    The grid approach is going to have problems near the boundaries of the grid boxes. Why not use BSP trees instead?

    0 讨论(0)
  • 2021-02-10 07:45

    If someone is still interested in this, I figured out a solution that works over here:

    http://www.gamedev.net/community/forums/topic.asp?topic_id=567378

    0 讨论(0)
  • 2021-02-10 07:45

    My preferred hashing function for this kind of vector is to rotate the bits of each component by a different constant and XOR them together.

    It's very fast, and the bit rotations are helpful to reduce collisions and ensure as much of the key space as possible is used.

    0 讨论(0)
提交回复
热议问题