BsTorus.h 976 B

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