17 INLINE PhysxMeshHash::
21 MeshHashRoot *r = _hashIndex;
23 for (
int i=0; i < _hashIndexSize; i++) {
30 _invSpacing = 1.0f / _spacing;
37 INLINE PhysxMeshHash::
45 INLINE
int PhysxMeshHash::
46 hash_function(
int xi,
int yi,
int zi)
const {
48 unsigned int h = (xi * 92837111)^(yi * 689287499)^(zi * 283923481);
49 return h % _hashIndexSize;
55 INLINE
void PhysxMeshHash::
56 cell_coord_of(
const NxVec3 &v,
int &xi,
int &yi,
int &zi)
const {
58 xi = (int)(v.x * _invSpacing);
if (v.x < 0.0f) xi--;
59 yi = (int)(v.y * _invSpacing);
if (v.y < 0.0f) yi--;
60 zi = (int)(v.z * _invSpacing);
if (v.z < 0.0f) zi--;
66 INLINE NxF32 PhysxMeshHash::
67 get_grid_spacing()
const {
69 return 1.0f / _invSpacing;