BsTorus.h 699 B

12345678910111213141516171819202122232425262728
  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(const Vector3& normal, 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. Vector3 normal;
  21. float outerRadius;
  22. float innerRadius;
  23. };
  24. }