37 #ifndef INCLUDED_IMATHLINEALGO_H 38 #define INCLUDED_IMATHLINEALGO_H 98 T d1w = line1.
dir ^ w;
99 T d2w = line2.
dir ^ w;
100 T d1d2 = line1.
dir ^ line2.
dir;
101 T n1 = d1d2 * d2w - d1w;
102 T n2 = d2w - d1d2 * d1w;
103 T d = 1 - d1d2 * d1d2;
110 point1 = line1 (n1 / d);
111 point2 = line2 (n2 / d);
158 Vec3<T> normal = edge1 % edge0;
172 T d = normal ^ (v0 - line.
pos);
173 T nd = normal ^ line.
dir;
190 Vec3<T> c = (a - en * (en ^ a));
191 Vec3<T> d = (b - en * (en ^ b));
195 if (e >= 0 && e <= f)
196 barycentric.
z = e / f;
205 Vec3<T> c = (a - en * (en ^ a));
206 Vec3<T> d = (b - en * (en ^ b));
210 if (e >= 0 && e <= f)
211 barycentric.
x = e / f;
216 barycentric.
y = 1 - barycentric.
x - barycentric.
z;
218 if (barycentric.
y < 0)
221 front = ((line.
dir ^ normal) < 0);
271 T radius = x.length();
279 Vec3<T> r = q + x * radius * cosangle + y * radius * sinangle;
Vec3< T > closestVertex(const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, const Line3< T > &l)
Definition: ImathLineAlgo.h:229
Definition: ImathFrame.h:42
T length() const
Definition: ImathVec.h:1662
T abs(T a)
Definition: ImathFun.h:53
bool closestPoints(const Line3< T > &line1, const Line3< T > &line2, Vec3< T > &point1, Vec3< T > &point2)
Definition: ImathLineAlgo.h:84
Definition: ImathLimits.h:117
T x
Definition: ImathVec.h:274
Vec3< T > rotatePoint(const Vec3< T > p, Line3< T > l, T angle)
Definition: ImathLineAlgo.h:258
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)
Definition: ImathLineAlgo.h:124
T y
Definition: ImathVec.h:274
static T cos(T x)
Definition: ImathMath.h:97
Vec3< T > dir
Definition: ImathLine.h:59
Vec3< T > closestPointTo(const Vec3< T > &point) const
Definition: ImathLine.h:130
Vec3< T > pos
Definition: ImathLine.h:58
T z
Definition: ImathVec.h:274
Vec3< T > normalized() const
Definition: ImathVec.h:1730
Definition: ImathLine.h:54
Definition: ImathBox.h:67
static T sin(T x)
Definition: ImathMath.h:98