Plane.hpp
Go to the documentation of this file.
1 
2 namespace GfxTL
3 {
4  template< class PointT >
6  {}
7 
8  template< class PointT >
9  Plane< PointT >::Plane(const PointType& normal, const PointType& origin)
10  : _normal(normal)
11  {
12  _d = -(_normal * origin);
13  }
14 
15  template< class PointT >
16  void Plane< PointT >::Set(const PointType& origin, const PointType& normal)
17  {
18  _normal = normal;
19  _d = -(_normal * origin);
20  }
21 
22  template< class PointT >
24  const PointType& p) const
25  {
26  return _normal * p + _d;
27  }
28 
29  template< class PointT >
31  {
32  ScalarType factor = Math< ScalarType >::Sign(_normal * n);
33  _normal *= factor;
34  _d *= factor;
35  }
36 
37  template< class PointT >
39  {
40  *s = p - SignedDistance(p) * _normal;
41  }
42 
43  template< class PointT >
44  void Plane< PointT >::Normal(PointType* normal) const
45  {
46  *normal = _normal;
47  }
48 
49  template< class PointT >
50  void Plane< PointT >::Normal(const PointType& normal)
51  {
52  _normal = normal;
53  }
54 
55  template< class PointT >
57  {
58  return _normal;
59  }
60 
61  template< class PointT >
63  {
64  return _normal;
65  }
66 
67  template< class PointT >
69  {
70  _d = -(_normal * o);
71  }
72 
73  template< class PointT >
75  const PointType& p, const PointType& r) const
76  {
77  return -SignedDistance(p) / (_normal * r);
78  }
79 };
GfxTL::Plane::ScalarType
PointType::ScalarType ScalarType
Definition: Plane.h:18
GfxTL::Plane::PointType
PointT PointType
Definition: Plane.h:17
GfxTL::Plane::Orient
void Orient(const PointType &n)
Definition: Plane.hpp:30
GfxTL::Plane::Intersect
ScalarType Intersect(const PointType &p, const PointType &r) const
Definition: Plane.hpp:74
GfxTL::Plane::Origin
void Origin(const PointType &o)
Definition: Plane.hpp:68
GfxTL::Math::Sign
static ScalarT Sign(ScalarT s)
Definition: MathHelper.h:23
GfxTL::Plane::Set
void Set(const PointType &origin, const PointType &normal)
Definition: Plane.hpp:16
GfxTL::Plane::Project
void Project(const PointType &p, PointType *s) const
Definition: Plane.hpp:38
GfxTL
Definition: AABox.h:8
GfxTL::Plane::Plane
Plane()
Definition: Plane.hpp:5
GfxTL::Plane::Normal
PointType & Normal()
Definition: Plane.hpp:56
GfxTL::Plane::SignedDistance
ScalarType SignedDistance(const PointType &p) const
Definition: Plane.hpp:23
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33