@@ -139,12 +139,13 @@ void chunk::ensure_passability() noexcept
139
139
// Debug{} << ".. reset passability" << _coord;
140
140
141
141
bool has_holes = false ;
142
+ auto & rtree = *_rtree;
142
143
{
143
- has_holes |= add_holes_from_chunk<false >(*_rtree , *this , {});
144
+ has_holes |= add_holes_from_chunk<false >(rtree , *this , {});
144
145
const auto nbs = _world->neighbors (_coord);
145
146
for (auto i = 0u ; i < 8 ; i++)
146
147
if (nbs[i])
147
- has_holes |= add_holes_from_chunk<true >(*_rtree , *nbs[i], world::neighbor_offsets[i]);
148
+ has_holes |= add_holes_from_chunk<true >(rtree , *nbs[i], world::neighbor_offsets[i]);
148
149
}
149
150
150
151
for (auto i = 0u ; i < TILE_COUNT; i++)
@@ -156,7 +157,7 @@ void chunk::ensure_passability() noexcept
156
157
if (pass == pass_mode::pass) [[likely]]
157
158
continue ;
158
159
auto id = make_id (collision_type::geometry, pass, i+1 );
159
- filter_through_holes (*_rtree , id, min, max, has_holes);
160
+ filter_through_holes (rtree , id, min, max, has_holes);
160
161
}
161
162
}
162
163
for (auto i = 0u ; i < TILE_COUNT; i++)
@@ -166,19 +167,19 @@ void chunk::ensure_passability() noexcept
166
167
{
167
168
auto [min, max] = wall_north (i, (float )atlas->info ().depth );
168
169
auto id = make_id (collision_type::geometry, atlas->info ().passability , TILE_COUNT+i+1 );
169
- filter_through_holes (*_rtree , id, min, max, has_holes);
170
+ filter_through_holes (rtree , id, min, max, has_holes);
170
171
171
172
if (tile.wall_west_atlas ())
172
173
{
173
174
auto [min, max] = wall_pillar (i, (float )atlas->info ().depth );
174
- filter_through_holes (*_rtree , id, min, max, has_holes);
175
+ filter_through_holes (rtree , id, min, max, has_holes);
175
176
}
176
177
}
177
178
if (const auto * atlas = tile.wall_west_atlas ().get ())
178
179
{
179
180
auto [min, max] = wall_west (i, (float )atlas->info ().depth );
180
181
auto id = make_id (collision_type::geometry, atlas->info ().passability , TILE_COUNT*2 +i+1 );
181
- filter_through_holes (*_rtree , id, min, max, has_holes);
182
+ filter_through_holes (rtree , id, min, max, has_holes);
182
183
}
183
184
}
184
185
for (const bptr<object>& eʹ : objects ())
@@ -189,7 +190,7 @@ void chunk::ensure_passability() noexcept
189
190
if (_bbox_for_scenery (*eʹ, bb))
190
191
{
191
192
if (!eʹ->is_dynamic ())
192
- filter_through_holes (*_rtree , std::bit_cast<object_id>(bb.data ), Vector2 (bb.start ), Vector2 (bb.end ), has_holes);
193
+ filter_through_holes (rtree , std::bit_cast<object_id>(bb.data ), Vector2 (bb.start ), Vector2 (bb.end ), has_holes);
193
194
else
194
195
_add_bbox_dynamic (bb);
195
196
}
0 commit comments