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