10 #ifndef INCLUDED_IMATHLINEALGO_H
11 #define INCLUDED_IMATHLINEALGO_H
18 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
30 IMATH_CONSTEXPR14
bool
38 T d1w = line1.dir ^
w;
39 T d2w = line2.dir ^
w;
40 T d1d2 = line1.dir ^ line2.dir;
41 T n1 = d1d2 * d2w - d1w;
42 T n2 = d2w - d1d2 * d1w;
43 T d = 1 - d1d2 * d1d2;
49 point1 = line1 (n1 / d);
50 point2 = line2 (n2 / d);
84 IMATH_CONSTEXPR14
bool
110 T d = normal ^ (v0 - line.pos);
111 T nd = normal ^ line.dir;
133 if (e >= 0 && e <= f)
134 barycentric.z = e /
f;
148 if (e >= 0 && e <= f)
149 barycentric.x = e /
f;
154 barycentric.y = 1 - barycentric.x - barycentric.z;
156 if (barycentric.y < 0)
return false;
158 front = ((line.dir ^ normal) < 0);
174 T neardot = (
v0 - l.closestPointTo (
v0)).length2 ();
176 T tmp = (
v1 - l.closestPointTo (
v1)).length2 ();
184 tmp = (
v2 - l.closestPointTo (
v2)).length2 ();
214 T cosangle = std::cos (
angle);
215 T sinangle = std::sin (
angle);
217 Vec3<T> r = q + x * radius * cosangle + y * radius * sinangle;
222 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
224 #endif // INCLUDED_IMATHLINEALGO_H
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.