HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Proximity.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2012-2017 DreamWorks Animation LLC
4 //
5 // All rights reserved. This software is distributed under the
6 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
7 //
8 // Redistributions of source code must retain the above copyright
9 // and license notice and the following restrictions and disclaimer.
10 //
11 // * Neither the name of DreamWorks Animation nor the names of
12 // its contributors may be used to endorse or promote products derived
13 // from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 // IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
27 // LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
28 //
29 ///////////////////////////////////////////////////////////////////////////
30 
31 #ifndef OPENVDB_MATH_PROXIMITY_HAS_BEEN_INCLUDED
32 #define OPENVDB_MATH_PROXIMITY_HAS_BEEN_INCLUDED
33 
34 #include <openvdb/Types.h>
35 
36 
37 namespace openvdb {
39 namespace OPENVDB_VERSION_NAME {
40 namespace math {
41 
42 /// @brief Closest Point on Triangle to Point. Given a triangle @c abc and a point @c p,
43 /// return the point on @c abc closest to @c p and the corresponding barycentric coordinates.
44 ///
45 /// @details Algorithms from "Real-Time Collision Detection" pg 136 to 142 by Christer Ericson.
46 /// The closest point is obtained by first determining which of the triangles'
47 /// Voronoi feature regions @c p is in and then computing the orthogonal projection
48 /// of @c p onto the corresponding feature.
49 ///
50 /// @param a The triangle's first vertex point.
51 /// @param b The triangle's second vertex point.
52 /// @param c The triangle's third vertex point.
53 /// @param p Point to compute the closest point on @c abc for.
54 /// @param uvw Barycentric coordinates, computed and returned.
57  const Vec3d& a, const Vec3d& b, const Vec3d& c, const Vec3d& p, Vec3d& uvw);
58 
59 
60 /// @brief Closest Point on Line Segment to Point. Given segment @c ab and point @c p,
61 /// return the point on @c ab closest to @c p and @c t the parametric distance to @c b.
62 ///
63 /// @param a The segment's first vertex point.
64 /// @param b The segment's second vertex point.
65 /// @param p Point to compute the closest point on @c ab for.
66 /// @param t Parametric distance to @c b.
69  const Vec3d& a, const Vec3d& b, const Vec3d& p, double& t);
70 
71 } // namespace math
72 } // namespace OPENVDB_VERSION_NAME
73 } // namespace openvdb
74 
75 #endif // OPENVDB_TOOLS_MESH_TO_VOLUME_UTIL_HAS_BEEN_INCLUDED
76 
77 // Copyright (c) 2012-2017 DreamWorks Animation LLC
78 // All rights reserved. This software is distributed under the
79 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
OPENVDB_API Vec3d closestPointOnTriangleToPoint(const Vec3d &a, const Vec3d &b, const Vec3d &c, const Vec3d &p, Vec3d &uvw)
Closest Point on Triangle to Point. Given a triangle abc and a point p, return the point on abc close...
#define OPENVDB_API
Helper macros for defining library symbol visibility.
Definition: Platform.h:194
#define OPENVDB_VERSION_NAME
Definition: version.h:43
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
OPENVDB_API Vec3d closestPointOnSegmentToPoint(const Vec3d &a, const Vec3d &b, const Vec3d &p, double &t)
Closest Point on Line Segment to Point. Given segment ab and point p, return the point on ab closest ...