diff --git a/fggl/gfx/ogl4/models.cpp b/fggl/gfx/ogl4/models.cpp index e13e92736c9707fe3800ca951bc092585c6d72e6..603441380848be6441d0b2dafa851cebd50b3007 100644 --- a/fggl/gfx/ogl4/models.cpp +++ b/fggl/gfx/ogl4/models.cpp @@ -90,7 +90,7 @@ namespace fggl::gfx::ogl4 { // terrain auto terrain = world.findMatching<data::HeightMap>(); for (auto& renderable : terrain){ - auto currModel = world.get<StaticModel>( renderable ); + auto currModel = world.tryGet<StaticModel>( renderable ); if ( currModel != nullptr ){ continue; } diff --git a/fggl/phys/bullet/simulation.cpp b/fggl/phys/bullet/simulation.cpp index 85cacddf965fc591dbe0d08d4d9180878bd6b631..e2256ccdd9a27203cc52cb7cc89980ad0f6f831c 100644 --- a/fggl/phys/bullet/simulation.cpp +++ b/fggl/phys/bullet/simulation.cpp @@ -73,7 +73,9 @@ namespace fggl::phys::bullet { //syncToECS(); pollCollisions(); - m_world->debugDrawWorld(); + if ( debugDraw ) { + m_world->debugDrawWorld(); + } } inline btCollisionShape* shape_to_bullet(const phys::RigidBody* fgglBody) { diff --git a/include/fggl/phys/bullet/types.hpp b/include/fggl/phys/bullet/types.hpp index 8197759c2dd2eb278985974f432b691c7e580de3..90219c3596c0a7fa803868b3f478a87e7df4b253 100644 --- a/include/fggl/phys/bullet/types.hpp +++ b/include/fggl/phys/bullet/types.hpp @@ -71,12 +71,12 @@ namespace fggl::phys::bullet { void step() override; void onEntityDeath(ecs::entity_t entity); - std::vector<ContactPoint> scanCollisions(ecs3::entity_t entity) override; ecs3::entity_t raycast(math::vec3 from, math::vec3 to) override; std::vector<ecs3::entity_t> raycastAll(math::vec3 from, math::vec3 to) override; std::vector<ecs3::entity_t> sweep(PhyShape& shape, math::Transform& from, math::Transform& to) override; + bool debugDraw = false; private: ecs3::World* m_ecs; BulletConfiguration m_config;