69 explicit AABox2d(
const std::vector<Vec2d> &points);
93 double length()
const {
return length_; }
99 double width()
const {
return width_; }
117 double area()
const {
return length_ * width_; }
124 double min_x()
const {
return center_.
x() - half_length_; }
131 double max_x()
const {
return center_.
x() + half_length_; }
138 double min_y()
const {
return center_.
y() - half_width_; }
145 double max_y()
const {
return center_.
y() + half_width_; }
220 double length_ = 0.0;
222 double half_length_ = 0.0;
223 double half_width_ = 0.0;
double x() const
Getter for x component.
Definition: vec2d.h:54
double width() const
Getter of width_.
Definition: aabox2d.h:99
bool IsPointIn(const Vec2d &point) const
Determines whether a given point is in the box.
double y() const
Getter for y component.
Definition: vec2d.h:57
void Shift(const Vec2d &shift_vec)
Shift the center of AABox by the input vector.
AABox2d()=default
Default constructor. Creates an axes-aligned box with zero length and width at the origin...
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool HasOverlap(const AABox2d &box) const
Determines whether two boxes overlap.
double center_x() const
Getter of x-component of center_.
Definition: aabox2d.h:81
bool IsPointOnBoundary(const Vec2d &point) const
Determines whether a given point is on the boundary of the box.
double center_y() const
Getter of y-component of center_.
Definition: aabox2d.h:87
double length() const
Getter of length_.
Definition: aabox2d.h:93
double half_width() const
Getter of half_width_.
Definition: aabox2d.h:111
void MergeFrom(const AABox2d &other_box)
Changes box to include another given box, as well as the current one.
void GetAllCorners(std::vector< Vec2d > *const corners) const
Gets all corners in counter clockwise order.
double area() const
Getter of length_*width_.
Definition: aabox2d.h:117
double max_y() const
Returns the maximum y-coordinate of the box.
Definition: aabox2d.h:145
double max_x() const
Returns the maximum x-coordinate of the box.
Definition: aabox2d.h:131
const Vec2d & center() const
Getter of center_.
Definition: aabox2d.h:75
std::string DebugString() const
Gets a human-readable debug string.
Implements a class of 2-dimensional vectors.
Definition: vec2d.h:42
double half_length() const
Getter of half_length_.
Definition: aabox2d.h:105
double min_y() const
Returns the minimum y-coordinate of the box.
Definition: aabox2d.h:138
double DistanceTo(const Vec2d &point) const
Determines the distance between a point and the box.
double min_x() const
Returns the minimum x-coordinate of the box.
Definition: aabox2d.h:124
Implements a class of (undirected) axes-aligned bounding boxes in 2-D. This class is referential-agno...
Definition: aabox2d.h:42