BsTorus.h 658 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "BsPrerequisitesUtil.h"
  3. #include "BsVector3.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Represents a torus at the world center. Outer radius represents
  8. * the distance from the center, and inner radius represents the radius of the tube.
  9. * Inner radius must be less or equal than the outer radius.
  10. */
  11. class BS_UTILITY_EXPORT Torus
  12. {
  13. public:
  14. Torus();
  15. Torus(float outerRadius, float innerRadius);
  16. /**
  17. * @brief Ray/torus intersection, returns boolean result and distance to nearest intersection point.
  18. */
  19. std::pair<bool, float> intersects(const Ray& ray) const;
  20. float outerRadius;
  21. float innerRadius;
  22. };
  23. }