MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/CompactNSearch / cell_index

Method cell_index

src/CompactNSearch.cpp:46–56  ·  view source on GitHub ↗

Computes triple index to a world space position x.

Source from the content-addressed store, hash-verified

44
45// Computes triple index to a world space position x.
46HashKey
47NeighborhoodSearch::cell_index(Real const* x) const
48{
49 HashKey ret;
50 for (unsigned int i = 0; i < 3; ++i)
51 {
52 if (x[i] >= 0.0) ret.k[i] = static_cast<int>(m_inv_cell_size * x[i]);
53 else ret.k[i] = static_cast<int>(m_inv_cell_size * x[i]) - 1;
54 }
55 return ret;
56}
57
58// Determines permutation table for point array.
59void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected