本文整理汇总了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));
}
}
示例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);
}
}
示例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);
}
}