235
rotate the whole triangle around an axis
237
\param origin a point on the axis
238
\param axis the orientation of the rotation axis
239
\param angle the rotation angle
241
void Triangle::rotate(const Vec3& origin, const Vec3& axis, double angle)
243
// get positions of corners 1 & 2
247
m_p0.rotateBy(origin,axis,angle);
248
c1.rotateBy(origin,axis,angle);
249
c2.rotateBy(origin,axis,angle);
250
// reconstruct edge vectors
253
// recalculate normal and invtrans
255
m_normal=cross(m_p2,m_p1).unit_s();
256
m_trans=Matrix3(m_p1,m_p2,m_normal);
257
m_invtrans=m_trans.inv();
259
catch(VecErr V){ // if unit_s thows exception -> v1||v2
260
throw TriangleError();