Go to the documentation of this file.
17 #ifndef IGNITION_MATH_PLANE_HH_
18 #define IGNITION_MATH_PLANE_HH_
23 #include <ignition/math/config.hh>
29 inline namespace IGNITION_MATH_VERSION_NAMESPACE
66 : normal(_normal), d(_offset)
77 this->
Set(_normal, _size, _offset);
88 this->normal = _normal;
99 this->normal = _normal;
112 return this->normal.Dot(_point) - this->d;
143 double maxAbsDist = this->normal.AbsDot(_box.
Size()/2.0);
145 if (dist < -maxAbsDist)
148 if (dist > maxAbsDist)
161 T denom = this->normal.Dot(_dir);
163 if (std::abs(denom) < 1e-3)
170 T nom = _origin.
Dot(this->normal) - this->d;
211 this->normal = _p.normal;
212 this->size = _p.size;
math::Vector3d Center() const
Get the box center.
Plane< double > Planed
Definition: Plane.hh:229
Vector3< T > & Normal()
Get the plane offset.
Definition: Plane.hh:195
virtual ~Plane()
Destructor.
Definition: Plane.hh:81
@ BOTH_SIDE
On both sides of the plane.
Definition: Plane.hh:53
const Vector3< T > & Normal() const
Get the plane offset.
Definition: Plane.hh:189
math::Vector3d Size() const
Get the size of the box.
Plane< T > & operator=(const Plane< T > &_p)
Equal operator.
Definition: Plane.hh:209
void Set(const Vector3< T > &_normal, T _offset)
Set the plane.
Definition: Plane.hh:86
@ POSITIVE_SIDE
Positive side of the plane.
Definition: Plane.hh:47
Plane(const Vector3< T > &_normal, const Vector2< T > &_size, T _offset)
Constructor.
Definition: Plane.hh:74
Plane()
Constructor.
Definition: Plane.hh:57
Plane< float > Planef
Definition: Plane.hh:230
@ NO_SIDE
On the plane.
Definition: Plane.hh:50
The Vector3 class represents the generic vector containing 3 elements. Since it's commonly used to ke...
Definition: Vector3.hh:39
T Distance(const Vector3< T > &_origin, const Vector3< T > &_dir) const
Get distance to the plane give an origin and direction.
Definition: Plane.hh:158
T Dot(const Vector3< T > &_v) const
Return the dot product of this vector and another vector.
Definition: Vector3.hh:198
const Vector2< T > & Size() const
Get the plane size.
Definition: Plane.hh:177
@ NEGATIVE_SIDE
Negative side of the plane.
Definition: Plane.hh:43
Mathematical representation of a box and related functions.
Definition: Box.hh:38
void Set(const Vector3< T > &_normal, const Vector2< T > &_size, T _offset)
Set the plane.
Definition: Plane.hh:96
PlaneSide Side(const math::Box &_box) const
The side of the plane a box is on.
Definition: Plane.hh:140
A plane and related functions.
Definition: Plane.hh:34
T Offset() const
Get the plane offset.
Definition: Plane.hh:201
Plane< int > Planei
Definition: Plane.hh:228
Two dimensional (x, y) vector.
Definition: Vector2.hh:32
Vector2< T > & Size()
Get the plane size.
Definition: Plane.hh:183
Plane(const Vector3< T > &_normal, T _offset=0.0)
Constructor from a normal and a distance.
Definition: Plane.hh:65
PlaneSide Side(const Vector3< T > &_point) const
The side of the plane a point is on.
Definition: Plane.hh:121
PlaneSide
Enum used to indicate a side of the plane, no side, or both sides for entities on the plane.
Definition: Plane.hh:39
T Distance(const Vector3< T > &_point) const
The distance to the plane from the given point.
Definition: Plane.hh:110