5 #include <glm/vec2.hpp>
24 : minimumX(0.0), minimumY(0.0), maximumX(0.0), maximumY(0.0) {}
42 double maximumY_) noexcept
43 : minimumX(minimumX_),
46 maximumY(maximumY_) {}
78 bool contains(
const glm::dvec2& position)
const noexcept;
123 return glm::dvec2(this->minimumX, this->minimumY);
134 return glm::dvec2(this->maximumX, this->minimumY);
145 return glm::dvec2(this->minimumX, this->maximumY);
156 return glm::dvec2(this->maximumX, this->maximumY);
166 (this->minimumX + this->maximumX) * 0.5,
167 (this->minimumY + this->maximumY) * 0.5);
176 return this->maximumX - this->minimumX;
185 return this->maximumY - this->minimumY;
195 std::optional<Rectangle>
Basic geometry classes for Cesium.
bool overlaps(const Rectangle &other) const noexcept
Checks whether this rectangle overlaps the given rectangle.
constexpr Rectangle() noexcept
Creates a new instance with all coordinate values set to 0.0.
constexpr glm::dvec2 getLowerLeft() const noexcept
Returns a point at the lower left of this rectangle.
double minimumX
The minimum x-coordinate.
bool contains(const glm::dvec2 &position) const noexcept
Checks whether this rectangle contains the given position.
Rectangle computeUnion(const Rectangle &other) const noexcept
Computes the union of this rectangle with another.
double maximumY
The maximum y-coordinate.
double maximumX
The maximum x-coordinate.
double minimumY
The minimum y-coordinate.
constexpr double computeHeight() const noexcept
Computes the height of this rectangle.
bool fullyContains(const Rectangle &other) const noexcept
Checks whether this rectangle fully contains the given rectangle.
constexpr double computeWidth() const noexcept
Computes the width of this rectangle.
constexpr glm::dvec2 getCenter() const noexcept
Returns a point at the center of this rectangle.
constexpr glm::dvec2 getLowerRight() const noexcept
Returns a point at the lower right of this rectangle.
constexpr Rectangle(double minimumX_, double minimumY_, double maximumX_, double maximumY_) noexcept
Creates a new instance.
std::optional< Rectangle > computeIntersection(const Rectangle &other) const noexcept
double computeSignedDistance(const glm::dvec2 &position) const noexcept
Computes the signed distance from a position to the edge of the rectangle.
constexpr glm::dvec2 getUpperRight() const noexcept
Returns a point at the upper right of this rectangle.
constexpr glm::dvec2 getUpperLeft() const noexcept
Returns a point at the upper left of this rectangle.