本文整理汇总了C++中AffineTransform::rotation方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::rotation方法的具体用法?C++ AffineTransform::rotation怎么用?C++ AffineTransform::rotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AffineTransform
的用法示例。
在下文中一共展示了AffineTransform::rotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTfDifference
void getTfDifference(
const AffineTransform& transform,
double& dist, double& angle)
{
Matrix3f R = transform.rotation();
Vector3f t = transform.translation();
dist = sqrt(t(0,0)*t(0,0) + t(1,0)*t(1,0) + t(2,0)*t(2,0));
double trace = R(0,0) + R(1,1) + R(2,2);
angle = acos(std::min(1.0, std::max(-1.0, (trace - 1.0)/2.0)));
}
示例2: transformMeans
void transformMeans(
Vector3fVector& means,
const AffineTransform& transform)
{
Matrix3f R = transform.rotation();
Vector3f t = transform.translation();
unsigned int size = means.size();
for(unsigned int i = 0; i < size; ++i)
{
Vector3f& m = means[i];
m = R * m + t;
}
}
示例3: transformDistributions
void transformDistributions(
Vector3fVector& means,
Matrix3fVector& covariances,
const AffineTransform& transform)
{
Matrix3f R = transform.rotation();
Vector3f t = transform.translation();
Matrix3f R_T = R.transpose();
unsigned int size = means.size();
for(unsigned int i = 0; i < size; ++i)
{
Vector3f& m = means[i];
Matrix3f& c = covariances[i];
m = R * m + t;
c = R * c * R_T;
}
}