10 #ifndef INCLUDED_IMATHLINEALGO_H
11 #define INCLUDED_IMATHLINEALGO_H
18 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
30 IMATH_CONSTEXPR14
bool
34 T d1w = line1.dir ^
w;
35 T d2w = line2.dir ^
w;
36 T d1d2 = line1.dir ^ line2.dir;
37 T n1 = d1d2 * d2w - d1w;
38 T n2 = d2w - d1d2 * d1w;
39 T d = 1 - d1d2 * d1d2;
44 point1 = line1 (n1 / d);
45 point2 = line2 (n2 / d);
79 IMATH_CONSTEXPR14
bool
104 T d = normal ^ (v0 - line.pos);
105 T nd = normal ^ line.dir;
127 if (e >= 0 && e <= f)
128 barycentric.z = e /
f;
142 if (e >= 0 && e <= f)
143 barycentric.x = e /
f;
148 barycentric.y = 1 - barycentric.x - barycentric.z;
150 if (barycentric.y < 0)
153 front = ((line.dir ^ normal) < 0);
167 T neardot = (
v0 - l.closestPointTo (
v0)).length2();
169 T tmp = (
v1 - l.closestPointTo (
v1)).length2();
177 tmp = (
v2 - l.closestPointTo (
v2)).length2();
210 Vec3<T> r = q + x * radius * cosangle + y * radius * sinangle;
215 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
217 #endif // INCLUDED_IMATHLINEALGO_H
SYS_API double cos(double x)
SIM_API const UT_StringHolder angle
IMATH_HOSTDEVICE T length() const IMATH_NOEXCEPT
Return the Euclidean norm.
IMATH_CONSTEXPR14 Vec3< T > closestVertex(const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, const Line3< T > &l) IMATH_NOEXCEPT
GLboolean GLboolean GLboolean GLboolean a
IMATH_HOSTDEVICE Vec3< T > normalized() const IMATH_NOEXCEPT
Return a normalized vector. Does not modify *this.
GLfloat GLfloat GLfloat v2
GLdouble GLdouble GLdouble q
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_CONSTEXPR14 bool closestPoints(const Line3< T > &line1, const Line3< T > &line2, Vec3< T > &point1, Vec3< T > &point2) IMATH_NOEXCEPT
GLboolean GLboolean GLboolean b
IMATH_CONSTEXPR14 Vec3< T > rotatePoint(const Vec3< T > p, Line3< T > l, T angle) IMATH_NOEXCEPT
IMATH_CONSTEXPR14 bool intersect(const Line3< T > &line, const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, Vec3< T > &pt, Vec3< T > &barycentric, bool &front) IMATH_NOEXCEPT
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLubyte GLubyte GLubyte GLubyte w
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE constexpr T abs(T a) IMATH_NOEXCEPT
IMATH_HOSTDEVICE const Vec3 & normalize() IMATH_NOEXCEPT
Normalize in place. If length()==0, return a null vector.
SYS_API double sin(double x)
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept