Files
Hoops_Exchange/exchange/exchangesource/MeshViewer/utils/bounding_box.h
2025-12-15 23:22:33 +08:00

41 lines
1.5 KiB
C++

/***********************************************************************************************************************
*
* Copyright (c) 2010 - 2025 by Tech Soft 3D, Inc.
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
* scope and manner of such use.
*
***********************************************************************************************************************/
#ifndef BOUNDING_BOX_H
#define BOUNDING_BOX_H
#include <vector>
#include <glm/vec3.hpp>
#include <glm/mat4x4.hpp>
namespace utils
{
namespace geometry
{
struct BoundingBox
{
glm::vec3 min = glm::vec3(std::numeric_limits<float>::max());
glm::vec3 max = glm::vec3(std::numeric_limits<float>::lowest());
void reset();
void add_point(const glm::vec3& point);
void add_box(const BoundingBox& box);
BoundingBox transform(const glm::mat4& mat) const;
void add_boxes(const BoundingBox& box, const std::vector<glm::mat4>& mat4s);
glm::vec3 diagonal() const;
glm::vec3 center() const;
double size_max() const;
};
}
}
#endif // BOUNDING_BOX_H