mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'blocking' entity property
This commit is contained in:
parent
60f4f33180
commit
e0358fe2db
6 changed files with 19 additions and 4 deletions
|
|
@ -404,6 +404,16 @@ void Entities::render(Assets* assets, ModelBatch& batch, const Frustum& frustum,
|
|||
}
|
||||
}
|
||||
|
||||
bool Entities::hasBlockingInside(AABB aabb) {
|
||||
auto view = registry.view<EntityId, Transform>();
|
||||
for (auto [entity, eid, transform] : view.each()) {
|
||||
if (eid.def.blocking && aabb.contains(transform.pos)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<Entity> Entities::getAllInside(AABB aabb) {
|
||||
std::vector<Entity> collected;
|
||||
auto view = registry.view<Transform>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue