且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

散列2D,3D和Nd矢量

更新时间:2022-11-10 07:40:41

有一个在优化空间散列用于描述一个空间散列函数碰撞检测变形的对象。他们使用的哈希函数

There's a spatial hash function described in Optimized Spatial Hashing for Collision Detection of Deformable Objects. They use the hash function

散(X,Y,Z)=(x p1的XORŸP2 XORž   P3)模N

hash(x,y,z) = ( x p1 xor y p2 xor z p3) mod n

其中,P1,P2,P3是大   素数,在我们的例子73856093,   19349663,83492791,分别。该   值n是哈希表的大小。

where p1, p2, p3 are large prime numbers, in our case 73856093, 19349663, 83492791, respectively. The value n is the hash table size.

在纸张中,x,y和z是离散坐标;你很可能还使用花车的二进制值。

In the paper, x, y, and z are the discretized coordinates; you could probably also use the binary values of your floats.