本文整理汇总了C++中ParameterMap::addQuat方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterMap::addQuat方法的具体用法?C++ ParameterMap::addQuat怎么用?C++ ParameterMap::addQuat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterMap
的用法示例。
在下文中一共展示了ParameterMap::addQuat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rotateComponent
/**
* Add/modify an entry in the parameter map for the given component
* to update its rotation. The component is const
* as the move doesn't actually change the object
* @param comp A reference to the component to move
* @param pmap A reference to the ParameterMap that will hold the new position
* @param rot The rotation quaternion
* @param rotType Defines how the given rotation should be interpreted @see
* TransformType enumeration
*/
void rotateComponent(const IComponent &comp, ParameterMap &pmap,
const Kernel::Quat &rot, const TransformType rotType) {
//
// This behaviour was copied from how RotateInstrumentComponent worked
//
Quat newRot = rot;
if (rotType == Absolute) {
// Find the corresponding relative position
auto parent = comp.getParent();
if (parent) {
Quat rot0 = parent->getRelativeRot();
rot0.inverse();
newRot = rot * rot0;
}
} else if (rotType == Relative) {
const Quat &Rot0 = comp.getRelativeRot();
newRot = Rot0 * rot;
} else {
throw std::invalid_argument("rotateComponent - Unknown rotType: " +
boost::lexical_cast<std::string>(rotType));
}
// Add a parameter for the new rotation
pmap.addQuat(comp.getComponentID(), "rot", newRot);
}