add 'blocking' entity property
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user