| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsCorePrerequisites.h" |
| 6 | #include "Utility/BsModule.h" |
| 7 | |
| 8 | namespace bs |
| 9 | { |
| 10 | /** @addtogroup Physics-Internal |
| 11 | * @{ |
| 12 | */ |
| 13 | |
| 14 | /** Creates and destroys a specific physics implementation. */ |
| 15 | class BS_CORE_EXPORT PhysicsFactory |
| 16 | { |
| 17 | public: |
| 18 | virtual ~PhysicsFactory() = default; |
| 19 | |
| 20 | /** Initializes the physics system. */ |
| 21 | virtual void startUp(bool cooking) = 0; |
| 22 | |
| 23 | /** Shuts down the physics system. */ |
| 24 | virtual void shutDown() = 0; |
| 25 | }; |
| 26 | |
| 27 | /** Takes care of loading, initializing and shutting down of a particular physics implementation. */ |
| 28 | class BS_CORE_EXPORT PhysicsManager : public Module<PhysicsManager> |
| 29 | { |
| 30 | public: |
| 31 | /** |
| 32 | * Initializes the physics manager and a particular physics implementation. |
| 33 | * |
| 34 | * @param[in] pluginName Name of the plugin containing a physics implementation. |
| 35 | * @param[in] cooking Should the physics cooking library be initialized (normally only needed during |
| 36 | * development). |
| 37 | */ |
| 38 | PhysicsManager(const String& pluginName, bool cooking); |
| 39 | ~PhysicsManager(); |
| 40 | |
| 41 | private: |
| 42 | DynLib* mPlugin; |
| 43 | PhysicsFactory* mFactory; |
| 44 | }; |
| 45 | |
| 46 | /** @} */ |
| 47 | } |