GteDistPoint3Plane3.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
10 #include <Mathematics/GteVector3.h>
13 
14 namespace gte
15 {
16 
17 template <typename Real>
18 class DCPQuery<Real, Vector3<Real>, Plane3<Real>>
19 {
20 public:
21  struct Result
22  {
25  };
26 
27  Result operator()(Vector3<Real> const& point, Plane3<Real> const& plane);
28 };
29 
30 
31 template <typename Real>
34  Vector3<Real> const& point, Plane3<Real> const& plane)
35 {
36  Result result;
37  result.signedDistance = Dot(plane.normal, point) - plane.constant;
38  result.distance = std::abs(result.signedDistance);
39  result.planeClosestPoint = point - result.signedDistance*plane.normal;
40  return result;
41 }
42 
43 
44 }
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
Definition: GteBSNumber.h:966
GLsizei GLsizei GLfloat distance
Definition: glext.h:9704
Result operator()(Type0 const &primitive0, Type1 const &primitive1)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
GLuint64EXT * result
Definition: glext.h:10003


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59