本文整理汇总了C++中Quaterniond::getEulerAngles方法的典型用法代码示例。如果您正苦于以下问题:C++ Quaterniond::getEulerAngles方法的具体用法?C++ Quaterniond::getEulerAngles怎么用?C++ Quaterniond::getEulerAngles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quaterniond
的用法示例。
在下文中一共展示了Quaterniond::getEulerAngles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qx
void
EditorIkSolver::_checkPivotXZ(ArRef<Joint> joint, Vector3d /* requestedTranslation */, Quaterniond requestedRotation) {
double prx, pry, prz;
joint->getDeltaRotation().getEulerAngles(prx, pry, prz);
requestedRotation = joint->getDeltaRotation() * requestedRotation;
double rx, ry, rz;
requestedRotation.getEulerAngles(rx, ry, rz);
double* max[2];
double* min[2];
ar_down_cast<JointConstraint2DOF>(joint->getConstraint())->getLimitValues(min, max);
double xmin = *min[0], xmax = *max[0], zmin = *min[1], zmax = *max[1];
rx = _clampWithPreviousValue(xmin, xmax, prx, rx);
rz = _clampWithPreviousValue(zmin, zmax, prz, rz);
Quaterniond qx(Vector3d(1.0, 0.0, 0.0), rx);
Quaterniond qz(Vector3d(0.0, 0.0, 1.0), rz);
joint->setDeltaRotation(qx * qz);
}
示例2:
void
EditorIkSolver::_checkHingeZ(ArRef<Joint> joint, Vector3d /* requestedTranslation */, Quaterniond requestedRotation) {
double prx, pry, prz;
joint->getDeltaRotation().getEulerAngles(prx, pry, prz);
requestedRotation = joint->getDeltaRotation() * requestedRotation;
double rx, ry, rz;
requestedRotation.getEulerAngles(rx, ry, rz);
double min, max;
ar_down_cast<JointConstraint1DOF>(joint->getConstraint())->getLimitValues(min, max);
rz = _clampWithPreviousValue(min, max, prz, rz);
joint->setDeltaRotation(Quaterniond(Vector3d(0.0, 0.0, 1.0), rz));
}