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#include "BsPhysXPrerequisites.h"
4#include "Physics/BsPhysicsManager.h"
5#include "BsPhysX.h"
6
7namespace bs
8{
9 class BS_PLUGIN_EXPORT PhysXFactory : public PhysicsFactory
10 {
11 public:
12 void startUp(bool cooking) override
13 {
14 PHYSICS_INIT_DESC desc;
15 desc.initCooking = cooking;
16
17 Physics::startUp<PhysX>(desc);
18 }
19
20 void shutDown() override
21 {
22 Physics::shutDown();
23 }
24 };
25
26 extern "C" BS_PLUGIN_EXPORT PhysXFactory* loadPlugin()
27 {
28 return bs_new<PhysXFactory>();
29 }
30
31 extern "C" BS_PLUGIN_EXPORT void unloadPlugin(PhysXFactory* instance)
32 {
33 bs_delete(instance);
34 }
35}