7 #ifndef __geometry_TrianglePower_h__ 8 #define __geometry_TrianglePower_h__ 36 void setIterations(U32 iterations)
37 { m_matrixPower.setIterations(iterations); }
67 m_direction=unit(v1-v0);
70 calcFrames(m_frame0,frame1,m_direction,v0,n0,v1,n1);
73 m_delta01=inv0*frame1;
84 const T f01=(barycenter[0]+barycenter[1] > T(0))?
85 barycenter[1]/(barycenter[0]+barycenter[1]): T(0);
86 const T f2=T(1)-barycenter[0]-barycenter[1];
89 m_matrixPower.solve(partial,m_delta01,f01);
94 FEASSERT(magnitude(norm01)>0.99);
95 FEASSERT(magnitude(norm01)<1.01);
99 calcFrames(frame2,frame3,m_direction,mid01,norm01,m_v2,m_n2);
103 m_matrixPower.solve(partial,delta2,f2);
105 vertex=mid.translation();
108 FEASSERT(magnitude(normal)>0.99);
109 FEASSERT(magnitude(normal)<1.01);
112 template <
typename T>
119 a_rTransform1.left()=unit(cross(a_rNormal1,a_rDirection));
120 a_rTransform2.left()=unit(cross(a_rNormal2,a_rDirection));
121 a_rTransform1.direction()=cross(a_rTransform1.left(),a_rNormal1);
122 a_rTransform2.direction()=cross(a_rTransform2.left(),a_rNormal2);
123 a_rTransform1.up()=a_rNormal1;
124 a_rTransform2.up()=a_rNormal2;
125 a_rTransform1.translation()=a_rVertex1;
126 a_rTransform2.translation()=a_rVertex2;
129 feLog(
"a_rDirection\n%s\n",c_print(a_rDirection));
130 feLog(
"frame1\n%s\n",c_print(a_rTransform1));
131 feLog(
"frame2\n%s\n",c_print(a_rTransform2));
Matrix for 3D transformations.
Definition: Matrix3x4.h:47
kernel
Definition: namespace.dox:3
Matrix< 4, 4, T > & invert(Matrix< 4, 4, T > &a_inverted, const Matrix< 4, 4, T > &a_matrix)
4x4 full matrix inversion
Definition: Matrix.h:1033
Evaluate barycenter on triangle of surface using MatrixPower.
Definition: TrianglePower.h:21
Barycentric coordinates for a triangle.
Definition: Barycenter.h:26
solve B = A^^power, where A is a matrix
Definition: MatrixPower.h:37