本文整理汇总了C++中TransformUnrecPtr::editMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformUnrecPtr::editMatrix方法的具体用法?C++ TransformUnrecPtr::editMatrix怎么用?C++ TransformUnrecPtr::editMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformUnrecPtr
的用法示例。
在下文中一共展示了TransformUnrecPtr::editMatrix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeNodeFor
void
ColladaNode::handleTranslate(domTranslate *translate)
{
if(translate == NULL)
return;
domNodeRef node = getDOMElementAs<domNode>();
TransformUnrecPtr xform = Transform::create();
NodeUnrecPtr xformN = makeNodeFor(xform);
xform->editMatrix().setTranslate(translate->getValue()[0],
translate->getValue()[1],
translate->getValue()[2] );
if(getGlobal()->getOptions()->getCreateNameAttachments() == true &&
node->getName() != NULL )
{
std::string nodeName = node->getName();
if(translate->getSid() != NULL)
{
nodeName.append("." );
nodeName.append(translate->getSid());
}
setName(xformN, nodeName);
}
appendXForm(xformN);
}
示例2: axis
void
ColladaNode::handleRotate(domRotate *rotate)
{
if(rotate == NULL)
return;
domNodeRef node = getDOMElementAs<domNode>();
Vec3f axis(rotate->getValue()[0], rotate->getValue()[1], rotate->getValue()[2]);
Real32 angle(rotate->getValue()[3]);
if(getGlobal()->getOptions()->getFlattenNodeXForms())
{
RotationTransformationElementUnrecPtr RotationElement = RotationTransformationElement::create();
RotationElement->setAxis(axis);
RotationElement->setAngle(angle);
setName(RotationElement, rotate->getSid());
appendStackedXForm(RotationElement, node);
if(getGlobal()->editAnimationMap()[rotate] != NULL)
{
SLOG << "Found Rotation Animation" << std::endl;
getGlobal()->editAnimationMap()[rotate]->getAnimation()->setAnimatedField(RotationElement,std::string("Angle"));
}
}
else
{
TransformUnrecPtr xform = Transform::create();
NodeUnrecPtr xformN = makeNodeFor(xform);
xform->editMatrix().setRotate(Quaternion(axis, osgDegree2Rad(angle)));
if(getGlobal()->getOptions()->getCreateNameAttachments() == true &&
node->getName() != NULL )
{
std::string nodeName = node->getName();
if(rotate->getSid() != NULL&&
getGlobal()->getOptions()->getFlattenNodeXForms() == false)
{
nodeName.append("." );
nodeName.append(rotate->getSid());
}
setName(xformN, nodeName);
}
appendXForm(xformN);
}
}
示例3: translation
void
ColladaNode::handleTranslate(domTranslate *translate)
{
if(translate == NULL)
return;
domNodeRef node = getDOMElementAs<domNode>();
Vec3f translation(translate->getValue()[0], translate->getValue()[1], translate->getValue()[2]);
if(getGlobal()->getOptions()->getFlattenNodeXForms())
{
TranslationTransformationElementUnrecPtr TranslateElement = TranslationTransformationElement::create();
TranslateElement->setTranslation(translation);
setName(TranslateElement, translate->getSid());
appendStackedXForm(TranslateElement, node);
if(getGlobal()->editAnimationMap()[translate] != NULL)
{
SLOG << "Found Translation Animation" << std::endl;
getGlobal()->editAnimationMap()[translate]->getAnimation()->setAnimatedField(TranslateElement,std::string("Translation")) ;
}
}
else
{
TransformUnrecPtr xform = Transform::create();
NodeUnrecPtr xformN = makeNodeFor(xform);
xform->editMatrix().setTranslate(translation);
if(getGlobal()->getOptions()->getCreateNameAttachments() == true &&
node->getName() != NULL )
{
std::string nodeName = node->getName();
if(translate->getSid() != NULL &&
getGlobal()->getOptions()->getFlattenNodeXForms() == false)
{
nodeName.append("." );
nodeName.append(translate->getSid());
}
setName(xformN, nodeName);
}
appendXForm(xformN);
}
}