HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_ShrinkTools.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Shrink Tools (C++)
7  *
8  * COMMENTS: Shrink Tools header file
9  *
10  */
11 
12 #ifndef __GU_ShrinkTools_h__
13 #define __GU_ShrinkTools_h__
14 
15 #include "GU_API.h"
16 #include <UT/UT_VectorTypes.h>
17 #include <SYS/SYS_Types.h>
18 
19 namespace GU_ShrinkTools
20 {
21  // Compute the interesection of a line segment with a particular plane given
22  // by normal and distance from the origin.
23  // pre: the line is defined by the two positions: pos1 and pos2
24  // the plane is defined by the normal and the dist which is the
25  // orthogonal distance from the origin to the plane
26  // IMPORTANT: the line segment is assumed to be intersecting the plane
27  // post: the output is alpha which is the normalized distance from the point v
28  // to the computed intersection x.
29  // if line is close to prependicular to normal then x is the midpoint
30  // if pos1 is too close to pos2 then x is u
31  GU_API extern void computeLinePlaneIntersection(const UT_Vector4R &pos1,
32  const UT_Vector4R &pos2,
33  const UT_Vector3R &normal,
34  const fpreal &dist,
35  fpreal &alpha,
36  UT_Vector4R &x );
37 
38  // same as above but ignoring the 4th coordinate
39  GU_API extern void computeLinePlaneIntersection(const UT_Vector3R &pos1,
40  const UT_Vector3R &pos2,
41  const UT_Vector3R &normal,
42  const fpreal &dist,
43  fpreal &alpha,
44  UT_Vector3R &x );
45 };
46 #endif
GA_API const UT_StringHolder dist
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
#define GU_API
Definition: GU_API.h:14
GLint GLenum GLint x
Definition: glcorearb.h:409
fpreal64 fpreal
Definition: SYS_Types.h:277
GU_API void computeLinePlaneIntersection(const UT_Vector4R &pos1, const UT_Vector4R &pos2, const UT_Vector3R &normal, const fpreal &dist, fpreal &alpha, UT_Vector4R &x)