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


C++ Matrix::isIdentity方法代码示例

本文整理汇总了C++中osg::Matrix::isIdentity方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix::isIdentity方法的具体用法?C++ Matrix::isIdentity怎么用?C++ Matrix::isIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osg::Matrix的用法示例。


在下文中一共展示了Matrix::isIdentity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readRotationElement

void readRotationElement(KFbxTypedProperty<fbxDouble3>& prop,
                         ERotationOrder fbxRotOrder,
                         bool quatInterpolate,
                         osgAnimation::UpdateMatrixTransform* pUpdate,
                         osg::Matrix& staticTransform)
{
    if (prop.GetKFCurve(KFCURVENODE_R_X) ||
        prop.GetKFCurve(KFCURVENODE_R_Y) ||
        prop.GetKFCurve(KFCURVENODE_R_Z))
    {
        if (quatInterpolate)
        {
            if (!staticTransform.isIdentity())
            {
                pUpdate->getStackedTransforms().push_back(
                    new osgAnimation::StackedMatrixElement(staticTransform));
                staticTransform.makeIdentity();
            }
            pUpdate->getStackedTransforms().push_back(new osgAnimation::StackedQuaternionElement(
                "quaternion", makeQuat(prop.Get(), fbxRotOrder)));
        }
        else
        {
            char* curveNames[3] = {KFCURVENODE_R_X, KFCURVENODE_R_Y, KFCURVENODE_R_Z};
            osg::Vec3 axes[3] = {osg::Vec3(1,0,0), osg::Vec3(0,1,0), osg::Vec3(0,0,1)};

            fbxDouble3 fbxPropValue = prop.Get();
            fbxPropValue[0] = osg::DegreesToRadians(fbxPropValue[0]);
            fbxPropValue[1] = osg::DegreesToRadians(fbxPropValue[1]);
            fbxPropValue[2] = osg::DegreesToRadians(fbxPropValue[2]);

            int order[3] = {0, 1, 2};
            getRotationOrder(fbxRotOrder, order);

            for (int i = 0; i < 3; ++i)
            {
                int j = order[2-i];
                if (prop.GetKFCurve(curveNames[j]))
                {
                    if (!staticTransform.isIdentity())
                    {
                        pUpdate->getStackedTransforms().push_back(new osgAnimation::StackedMatrixElement(staticTransform));
                        staticTransform.makeIdentity();
                    }

                    pUpdate->getStackedTransforms().push_back(new osgAnimation::StackedRotateAxisElement(
                        std::string("rotate") + curveNames[j], axes[j], fbxPropValue[j]));
                }
                else
                {
                    staticTransform.preMultRotate(osg::Quat(fbxPropValue[j], axes[j]));
                }
            }
        }
    }
    else
    {
        staticTransform.preMultRotate(makeQuat(prop.Get(), fbxRotOrder));
    }
}
开发者ID:crimzon,项目名称:osg,代码行数:60,代码来源:fbxRNode.cpp

示例2: readScaleElement

void readScaleElement(FbxPropertyT<FbxDouble3>& prop,
                      osgAnimation::UpdateMatrixTransform* pUpdate,
                      osg::Matrix& staticTransform,
                      FbxScene& fbxScene)
{
    FbxDouble3 fbxPropValue = prop.Get();
    osg::Vec3d val(
        fbxPropValue[0],
        fbxPropValue[1],
        fbxPropValue[2]);

    if (isAnimated(prop, fbxScene))
    {
        if (!staticTransform.isIdentity())
        {
            pUpdate->getStackedTransforms().push_back(new osgAnimation::StackedMatrixElement(staticTransform));
            staticTransform.makeIdentity();
        }
        pUpdate->getStackedTransforms().push_back(new osgAnimation::StackedScaleElement("scale", val));
    }
    else
    {
        staticTransform.preMultScale(val);
    }
}
开发者ID:Jeff885,项目名称:osg,代码行数:25,代码来源:fbxRNode.cpp

示例3: readScaleElement

void readScaleElement(KFbxTypedProperty<fbxDouble3>& prop,
                      osgAnimation::UpdateMatrixTransform* pUpdate,
                      osg::Matrix& staticTransform)
{
    fbxDouble3 fbxPropValue = prop.Get();
    osg::Vec3d val(
        fbxPropValue[0],
        fbxPropValue[1],
        fbxPropValue[2]);

    if (prop.GetKFCurve(KFCURVENODE_S_X) ||
        prop.GetKFCurve(KFCURVENODE_S_Y) ||
        prop.GetKFCurve(KFCURVENODE_S_Z))
    {
        if (!staticTransform.isIdentity())
        {
            pUpdate->getStackedTransforms().push_back(new osgAnimation::StackedMatrixElement(staticTransform));
            staticTransform.makeIdentity();
        }
        pUpdate->getStackedTransforms().push_back(new osgAnimation::StackedScaleElement("scale", val));
    }
    else
    {
        staticTransform.preMultScale(val);
    }
}
开发者ID:crimzon,项目名称:osg,代码行数:26,代码来源:fbxRNode.cpp


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