IDRandomUtil.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef ID_RANDOM_UTIL_HPP_
  2. #define ID_RANDOM_UTIL_HPP_
  3. #include "BulletInverseDynamics/IDConfig.hpp"
  4. namespace btInverseDynamics
  5. {
  6. /// seed random number generator using time()
  7. void randomInit();
  8. /// seed random number generator with identical value to get repeatable results
  9. void randomInit(unsigned seed);
  10. /// Generate (not quite) uniformly distributed random integers in [low, high]
  11. /// Note: this is a low-quality implementation using only rand(), as
  12. /// C++11 <random> is not supported in bullet.
  13. /// The results will *not* be perfectly uniform.
  14. /// \param low is the lower bound (inclusive)
  15. /// \param high is the lower bound (inclusive)
  16. /// \return a random number within [\param low, \param high]
  17. int randomInt(int low, int high);
  18. /// Generate a (not quite) uniformly distributed random floats in [low, high]
  19. /// Note: this is a low-quality implementation using only rand(), as
  20. /// C++11 <random> is not supported in bullet.
  21. /// The results will *not* be perfectly uniform.
  22. /// \param low is the lower bound (inclusive)
  23. /// \param high is the lower bound (inclusive)
  24. /// \return a random number within [\param low, \param high]
  25. float randomFloat(float low, float high);
  26. /// generate a random valid mass value
  27. /// \returns random mass
  28. float randomMass();
  29. /// generate a random valid vector of principal moments of inertia
  30. vec3 randomInertiaPrincipal();
  31. /// generate a random valid moment of inertia matrix
  32. mat33 randomInertiaMatrix();
  33. /// generate a random unit vector
  34. vec3 randomAxis();
  35. } // namespace btInverseDynamics
  36. #endif