BsPhysXPlugin.cpp 583 B

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