Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/core/bounding_box.h
- This file was moved from extern/draco/dracoenc/src/draco/core/bounding_box.h.
| Show All 30 Lines | public: | ||||
| inline const Vector3f &min_point() const { return min_point_; } | inline const Vector3f &min_point() const { return min_point_; } | ||||
| inline const Vector3f &max_point() const { return max_point_; } | inline const Vector3f &max_point() const { return max_point_; } | ||||
| // Conditionally updates the bounding box. | // Conditionally updates the bounding box. | ||||
| // TODO(xiaoxumeng): Change the function to a template function and change the | // TODO(xiaoxumeng): Change the function to a template function and change the | ||||
| // argument to an iterator. | // argument to an iterator. | ||||
| inline void update_bounding_box(const Vector3f &new_point) { | inline void update_bounding_box(const Vector3f &new_point) { | ||||
| for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
| if (new_point[i] < min_point_[i]) | if (new_point[i] < min_point_[i]) { | ||||
| min_point_[i] = new_point[i]; | min_point_[i] = new_point[i]; | ||||
| if (new_point[i] > max_point_[i]) | } | ||||
| if (new_point[i] > max_point_[i]) { | |||||
| max_point_[i] = new_point[i]; | max_point_[i] = new_point[i]; | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| private: | private: | ||||
| Vector3f min_point_; | Vector3f min_point_; | ||||
| Vector3f max_point_; | Vector3f max_point_; | ||||
| }; | }; | ||||
| } // namespace draco | } // namespace draco | ||||
| #endif // DRACO_CORE_BOUNDING_BOX_H_ | #endif // DRACO_CORE_BOUNDING_BOX_H_ | ||||