mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add entity 'on_render' event
This commit is contained in:
parent
d099b294a2
commit
0d230f2449
5 changed files with 32 additions and 8 deletions
|
|
@ -311,12 +311,6 @@ void Entities::updatePhysics(float delta) {
|
|||
|
||||
void Entities::update() {
|
||||
scripting::on_entities_update();
|
||||
auto view = registry.view<Transform>();
|
||||
for (auto [entity, transform] : view.each()) {
|
||||
if (transform.dirty) {
|
||||
transform.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Entities::renderDebug(LineBatch& batch, const Frustum& frustum) {
|
||||
|
|
@ -343,8 +337,13 @@ void Entities::renderDebug(LineBatch& batch, const Frustum& frustum) {
|
|||
}
|
||||
|
||||
void Entities::render(Assets* assets, ModelBatch& batch, const Frustum& frustum) {
|
||||
scripting::on_entities_render();
|
||||
|
||||
auto view = registry.view<Transform, rigging::Rig>();
|
||||
for (auto [entity, transform, rig] : view.each()) {
|
||||
if (transform.dirty) {
|
||||
transform.refresh();
|
||||
}
|
||||
const auto& pos = transform.pos;
|
||||
const auto& size = transform.size;
|
||||
if (frustum.isBoxVisible(pos-size, pos+size)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue