CRotationRandom.cpp 822 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "CRotationRandom.h"
  2. using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
  3. CRotationRandom* CRotationRandom::fromJSON (json data, irr::u32 id)
  4. {
  5. json::const_iterator min_it = data.find ("min");
  6. json::const_iterator max_it = data.find ("max");
  7. irr::f64 min = 0.0f;
  8. irr::f64 max = 360.0f;
  9. if (min_it != data.end ())
  10. {
  11. min = *min_it;
  12. }
  13. if (max_it != data.end ())
  14. {
  15. max = *max_it;
  16. }
  17. return new CRotationRandom (id, min, max);
  18. }
  19. CRotationRandom::CRotationRandom (irr::u32 id, irr::f64 min, irr::f64 max) :
  20. CInitializer (id, "rotationrandom"),
  21. m_min (min),
  22. m_max (max)
  23. {
  24. }
  25. irr::f64 CRotationRandom::getMinimum ()
  26. {
  27. return this->m_min;
  28. }
  29. irr::f64 CRotationRandom::getMaximum ()
  30. {
  31. return this->m_max;
  32. }