obbox.h 952 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2009-2021 Intel Corporation
  2. // SPDX-License-Identifier: Apache-2.0
  3. #pragma once
  4. #include "bbox.h"
  5. #include "linearspace3.h"
  6. namespace embree
  7. {
  8. /*! Oriented bounding box */
  9. template<typename T>
  10. struct OBBox
  11. {
  12. public:
  13. __forceinline OBBox () {}
  14. __forceinline OBBox (EmptyTy)
  15. : space(one), bounds(empty) {}
  16. __forceinline OBBox (const BBox<T>& bounds)
  17. : space(one), bounds(bounds) {}
  18. __forceinline OBBox (const LinearSpace3<T>& space, const BBox<T>& bounds)
  19. : space(space), bounds(bounds) {}
  20. friend embree_ostream operator<<(embree_ostream cout, const OBBox& p) {
  21. return cout << "{ space = " << p.space << ", bounds = " << p.bounds << "}";
  22. }
  23. public:
  24. LinearSpace3<T> space; //!< orthonormal transformation
  25. BBox<T> bounds; //!< bounds in transformed space
  26. };
  27. typedef OBBox<Vec3f> OBBox3f;
  28. typedef OBBox<Vec3fa> OBBox3fa;
  29. }