diff --git a/demo/demo/main.cpp b/demo/demo/main.cpp index a5d78bd6640079fa662b8e0a4411a293098073c2..38942cf91710fa58ddc4d688f3a5e7930acdc211 100644 --- a/demo/demo/main.cpp +++ b/demo/demo/main.cpp @@ -21,6 +21,10 @@ #include <filesystem> #include <iostream> +#if __has_include("fggl/phys/bullet/bullet.hpp") + #include "fggl/phys/bullet/bullet.hpp" +#endif + #include "fggl/app.hpp" #include "fggl/audio/openal/audio.hpp" @@ -34,7 +38,6 @@ #include "fggl/platform/paths.hpp" #include "fggl/ecs3/types.hpp" -#include "../../integrations/bullet/include/fggl/phys/bullet/bullet.hpp" #include "fggl/scenes/menu.hpp" @@ -103,7 +106,9 @@ int main(int argc, const char* argv[]) { // load a bunch of modules to provide game functionality //app.use<fggl::ecs3::ecsTypes>(); app.use<fggl::gfx::SceneUtils>(); - app.use<fggl::phys::Bullet3>(); + #ifdef FGGL_MODULE_BULLET + app.use<FGGL_MODULE_BULLET>(); + #endif test_atlas_api(); diff --git a/fggl/scenes/game.cpp b/fggl/scenes/game.cpp index dfd22b779f1e9184e804ea67ac26736663766341..6059ad5f319932a39ec05b76331a9f0c3c4e35cc 100644 --- a/fggl/scenes/game.cpp +++ b/fggl/scenes/game.cpp @@ -18,7 +18,10 @@ #include "fggl/scenes/game.hpp" #include "fggl/util/service.hpp" -#include "../../integrations/bullet/include/fggl/phys/bullet/types.hpp" + +#if __has_include("fggl/phys/bullet/bullet.hpp") + #include "fggl/phys/bullet/bullet.hpp" +#endif namespace fggl::scenes { @@ -33,8 +36,10 @@ namespace fggl::scenes { // setup the scene m_world = std::make_unique<ecs3::World>(*m_owner.registry()); - // FIXME this ties bullet to the game state - which shouldn't be the case - m_phys = std::make_unique<phys::bullet::BulletPhysicsEngine>(m_world.get()); + #ifdef FGGL_MODULE_BULLET + // FIXME this ties bullet to the game state - which shouldn't be the case + m_phys = std::make_unique<fggl::phys::bullet::BulletPhysicsEngine>(m_world.get()); + #endif } void Game::deactivate() { diff --git a/include/fggl/phys/types.hpp b/include/fggl/phys/types.hpp index 09d0307f04e095d3c685343a709ec176a20be077..bbc2b468716caa194f08d254e991dd3470d46597 100644 --- a/include/fggl/phys/types.hpp +++ b/include/fggl/phys/types.hpp @@ -19,6 +19,7 @@ #ifndef FGGL_PHYS_TYPES_HPP #define FGGL_PHYS_TYPES_HPP +#include "fggl/math/types.hpp" #include "fggl/phys/callbacks.hpp" namespace fggl::phys { diff --git a/integrations/bullet/include/fggl/phys/bullet/bullet.hpp b/integrations/bullet/include/fggl/phys/bullet/bullet.hpp index 73db6fd355abe718060778f17ca18e96add73a2d..fb28ce6110466b8ad56781d6289649d91cdf5777 100644 --- a/integrations/bullet/include/fggl/phys/bullet/bullet.hpp +++ b/integrations/bullet/include/fggl/phys/bullet/bullet.hpp @@ -33,10 +33,12 @@ #ifndef FGGL_PHYS_BULLET_BULLET_HPP #define FGGL_PHYS_BULLET_BULLET_HPP +#define FGGL_MODULE_BULLET fggl::phys::Bullet3 + #include "fggl/ecs3/module/module.hpp" #include "fggl/phys/types.hpp" -#include "types.hpp" +#include "fggl/phys/bullet/types.hpp" namespace fggl::phys::bullet {