1 #ifndef RECTANGLE_AABB_H_ 2 #define RECTANGLE_AABB_H_ 20 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 const Eigen::Vector2d &_center = Eigen::Vector2d(0, 0))
24 :
Shape(_center), r_(_rx, _ry) {
28 segments_.push_back(
LineSegment(min_, Eigen::Vector2d(min_.x(), max_.y())));
30 segments_.push_back(
LineSegment(Eigen::Vector2d(min_.x(), max_.y()), max_));
32 segments_.push_back(
LineSegment(max_, Eigen::Vector2d(max_.x(), min_.y())));
34 segments_.push_back(
LineSegment(Eigen::Vector2d(max_.x(), min_.y()), min_));
37 bool rayTrace(
const Eigen::Vector2d &point1,
const Eigen::Vector2d &point2,
38 std::vector<LineSegment> &intersect)
const override;
48 void print(std::ostringstream &stream)
const;
56 Eigen::Vector2d
r()
const;
57 double r(
int i)
const;
60 Eigen::Vector2d
min()
const;
61 Eigen::Vector2d
max()
const;
69 void set_center(
const Eigen::Vector2d &_center);
70 void set_r(
const Eigen::Vector2d &_r);
83 std::vector<LineSegment>
segments(
void)
const {
return segments_; };
102 Eigen::Vector2d min_;
103 Eigen::Vector2d max_;
105 std::vector<LineSegment> segments_;
void set_r(const Eigen::Vector2d &_r)
double squareDisToPoint(const Eigen::Vector2d &p) const
Eigen::Vector2d r() const
void print(std::ostringstream &stream) const
Print all parameters of the shape.
bool rayTrace(const Eigen::Vector2d &point1, const Eigen::Vector2d &point2, std::vector< LineSegment > &intersect) const override
RectangleAABB * clone() const
fcl::CollisionObject< FCL_PRECISION > * createFCLCollisionObject(const std::shared_ptr< fcl::CollisionGeometry< FCL_PRECISION >> &col_geom) const override
Eigen::Vector2d min() const
fcl::CollisionGeometry< FCL_PRECISION > * createFCLCollisionGeometry(void) const override
void set_r_x(double _r_x)
void set_r_y(double _r_y)
ShapeType type() const
Get shape type.
virtual CollisionObjectType getCollisionObjectType() const override
void set_all(double r_x, double r_y, double center_x, double center_y)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW RectangleAABB(double _rx, double _ry, const Eigen::Vector2d &_center=Eigen::Vector2d(0, 0))
Base prototype for the shape of an obstacle.
std::vector< LineSegment > segments(void) const
Eigen::Vector2d max() const
void set_center(const Eigen::Vector2d &_center)