38 #ifndef COAL_BROADPHASE_SPATIALHASH_INL_H
39 #define COAL_BROADPHASE_SPATIALHASH_INL_H
49 : cell_size(cell_size_), scene_limit(scene_limit_) {
51 static_cast<unsigned int>(std::ceil(scene_limit.width() / cell_size));
53 static_cast<unsigned int>(std::ceil(scene_limit.height() / cell_size));
55 static_cast<unsigned int>(std::ceil(scene_limit.depth() / cell_size));
60 unsigned int min_x =
static_cast<unsigned int>(
62 unsigned int max_x =
static_cast<unsigned int>(
64 unsigned int min_y =
static_cast<unsigned int>(
66 unsigned int max_y =
static_cast<unsigned int>(
68 unsigned int min_z =
static_cast<unsigned int>(
70 unsigned int max_z =
static_cast<unsigned int>(
73 std::vector<unsigned int> keys(
74 static_cast<size_t>((max_x - min_x) * (max_y - min_y) * (max_z - min_z)));
76 for (
unsigned int x = min_x;
x < max_x; ++
x) {
77 for (
unsigned int y = min_y;
y < max_y; ++
y) {
78 for (
unsigned int z = min_z; z < max_z; ++z) {