BsTorus.h 748 B

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