Factory.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/RTTI/RTTI.h>
  10. #include <NvCloth/Types.h>
  11. #include <System/NvTypes.h>
  12. namespace NvCloth
  13. {
  14. class Solver;
  15. class Fabric;
  16. class Cloth;
  17. //! This class knows how to construct Solver, Cloth and Fabric objects.
  18. //!
  19. //! All objects constructed by this factory will run on CPU.
  20. class Factory
  21. {
  22. public:
  23. AZ_RTTI(Factory, "{ABA9A937-2FE2-44A3-A143-E1594B479BE6}");
  24. virtual ~Factory() = default;
  25. virtual void Init();
  26. virtual void Destroy();
  27. AZStd::unique_ptr<Solver> CreateSolver(const AZStd::string& name);
  28. AZStd::unique_ptr<Fabric> CreateFabric(const FabricCookedData& fabricCookedData);
  29. AZStd::unique_ptr<Cloth> CreateCloth(
  30. const AZStd::vector<SimParticleFormat>& initialParticles,
  31. Fabric* fabric);
  32. protected:
  33. //! NvCloth factory object.
  34. NvFactoryUniquePtr m_nvFactory;
  35. };
  36. } // namespace NvCloth