当前位置: 首页>>代码示例>>C++>>正文


C++ TransformUnrecPtr::editMatrix方法代码示例

本文整理汇总了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);
}
开发者ID:msteners,项目名称:OpenSGDevMaster_Toolbox,代码行数:31,代码来源:OSGColladaNode.cpp

示例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);
    }
}
开发者ID:danguilliams,项目名称:OpenSGDevMaster_Toolbox,代码行数:51,代码来源:OSGColladaNode.cpp

示例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);
    }
}
开发者ID:danguilliams,项目名称:OpenSGDevMaster_Toolbox,代码行数:49,代码来源:OSGColladaNode.cpp


注:本文中的TransformUnrecPtr::editMatrix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。