add debug hitboxes render
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "../physics/Hitbox.hpp"
|
||||
#include "../physics/PhysicsSolver.hpp"
|
||||
#include "../graphics/render/ModelBatch.hpp"
|
||||
#include "../graphics/core/LineBatch.hpp"
|
||||
#include "../graphics/core/Model.hpp"
|
||||
#include "../maths/FrustumCulling.hpp"
|
||||
|
||||
@@ -54,6 +55,14 @@ void Entities::updatePhysics(float delta){
|
||||
}
|
||||
}
|
||||
|
||||
void Entities::renderDebug(LineBatch& batch) {
|
||||
batch.lineWidth(1.0f);
|
||||
auto view = registry.view<Transform, Hitbox>();
|
||||
for (auto [entity, transform, hitbox] : view.each()) {
|
||||
batch.box(hitbox.position, hitbox.halfsize * 2.0f, glm::vec4(1.0f));
|
||||
}
|
||||
}
|
||||
|
||||
void Entities::render(Assets* assets, ModelBatch& batch, Frustum& frustum) {
|
||||
auto view = registry.view<Transform>();
|
||||
auto model = assets->get<model::Model>("cube");
|
||||
|
||||
Reference in New Issue
Block a user