示例#1
0
std::string tq2pov(const Vector3r& t, const Quaternionr& q){
	Matrix3r m=q.toRotationMatrix();
	return "matrix <"
		+to_string(m(0,0))+","+to_string(m(0,1))+","+to_string(m(0,2))+", "
		+to_string(m(1,0))+","+to_string(m(1,1))+","+to_string(m(1,2))+", "
		+to_string(m(2,0))+","+to_string(m(2,1))+","+to_string(m(2,2))+", "
		+to_string(t[0])+","+to_string(t[1])+","+to_string(t[2])+">";
}
示例#2
0
/*! @brief Recalculate body's inertia tensor in rotated coordinates.
 *
 * @param I inertia tensor in old coordinates
 * @param rot quaternion that describes rotation from old to new coordinates
 * @return inertia tensor in new coordinates
 */
Matrix3r woo::Volumetric::inertiaTensorRotate(const Matrix3r& I, const Quaternionr& rot){
	Matrix3r T=rot.toRotationMatrix();
	return inertiaTensorRotate(I,T);
}