18 #ifndef _IGNITION_PLANE_HH_
19 #define _IGNITION_PLANE_HH_
65 this->normal = _normal;
76 this->
Set(_normal, _size, _offset);
87 this->normal = _normal;
98 this->normal = _normal;
111 return this->normal.Dot(_point) - this->d;
142 double maxAbsDist = this->normal.AbsDot(_box.
Size()/2.0);
144 if (dist < -maxAbsDist)
147 if (dist > maxAbsDist)
160 T denom = this->normal.Dot(_dir);
162 if (std::abs(denom) < 1e-3)
169 T nom = _origin.
Dot(this->normal) - this->d;
210 this->normal = _p.normal;
211 this->size = _p.size;
On both sides of the plane.
Definition: Plane.hh:51
PlaneSide Side(const math::Box &_box) const
The side of the plane a box is on.
Definition: Plane.hh:139
Plane(const Vector3< T > &_normal, T _offset=0.0)
Constructor from a normal and a distance.
Definition: Plane.hh:63
Plane< float > Planef
Definition: Plane.hh:229
Two dimensional (x, y) vector.
Definition: Vector2.hh:29
A plane and related functions.
Definition: Plane.hh:32
Positive side of the plane.
Definition: Plane.hh:45
Plane< double > Planed
Definition: Plane.hh:228
On the plane.
Definition: Plane.hh:48
Plane()
Constructor.
Definition: Plane.hh:55
PlaneSide Side(const Vector3< T > &_point) const
The side of the plane a point is on.
Definition: Plane.hh:120
PlaneSide
Enum used to indicate a side of the plane, no side, or both sides for entities on the plane...
Definition: Plane.hh:37
const Vector2< T > & Size() const
Get the plane size.
Definition: Plane.hh:176
T Distance(const Vector3< T > &_origin, const Vector3< T > &_dir) const
Get distance to the plane give an origin and direction.
Definition: Plane.hh:157
math::Vector3d Center() const
Get the box center.
T Dot(const Vector3< T > &_v) const
Return the dot product of this vector and another vector.
Definition: Vector3.hh:191
T Distance(const Vector3< T > &_point) const
The distance to the plane from the given point.
Definition: Plane.hh:109
Mathematical representation of a box and related functions.
Definition: Box.hh:33
T Offset() const
Get the plane offset.
Definition: Plane.hh:200
math::Vector3d Size() const
Get the size of the box.
const Vector3< T > & Normal() const
Get the plane offset.
Definition: Plane.hh:188
Vector2< T > & Size()
Get the plane size.
Definition: Plane.hh:182
Plane(const Vector3< T > &_normal, const Vector2< T > &_size, T _offset)
Constructor.
Definition: Plane.hh:73
void Set(const Vector3< T > &_normal, T _offset)
Set the plane.
Definition: Plane.hh:85
Vector3< T > & Normal()
Get the plane offset.
Definition: Plane.hh:194
virtual ~Plane()
Destructor.
Definition: Plane.hh:80
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:37
Plane< T > & operator=(const Plane< T > &_p)
Equal operator.
Definition: Plane.hh:208
Negative side of the plane.
Definition: Plane.hh:41
Plane< int > Planei
Definition: Plane.hh:227
void Set(const Vector3< T > &_normal, const Vector2< T > &_size, T _offset)
Set the plane.
Definition: Plane.hh:95