本文整理汇总了C++中MFMatrix::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ MFMatrix::resize方法的具体用法?C++ MFMatrix::resize怎么用?C++ MFMatrix::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFMatrix
的用法示例。
在下文中一共展示了MFMatrix::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transformGeometry
void CPUSkinningAlgorithm::transformGeometry(
SkinnedGeometry *skinGeo,
Skeleton *skel,
CPUSkinningDataAttachment *data)
{
const SkinnedGeometry::MFPropIndicesType *mfOrigIdx =
skinGeo->getMFPropIndices();
const SkinnedGeometry::MFPropertiesType *mfOrigProps =
skinGeo->getMFProperties();
SkinnedGeometry::MFPropertiesType *mfProps =
data->editMFProperties();
const GeoVec4fProperty *jointIdxProp =
dynamic_cast<const GeoVec4fProperty *>(
(*mfOrigProps)[skinGeo->getJointIndexProperty()]);
const GeoVec4fProperty *jointWeightProp =
dynamic_cast<const GeoVec4fProperty *>(
(*mfOrigProps)[skinGeo->getJointWeightProperty()]);
if(skinGeo->getIndex(skinGeo->getJointIndexProperty ()) !=
skinGeo->getIndex(skinGeo->getJointWeightProperty()) )
{
SWARNING << "CPUSkinningAlgorithm::transformGeometry: "
<< "Multi indexed geometry not supported!"
<< std::endl;
return;
}
mfProps->resize(mfOrigProps->size(), NULL);
const MFMatrix *mfJointMat = NULL;
const MFMatrix *mfJointNormalMat = NULL;
// if the geometry has a non-identity bind shape matrix
// premultiply joint matrices with bind shape matrix and store in data
// attachment
if(skinGeo->getBindShapeMatrix().equals(Matrix::identity(), Eps) == false)
{
mfJointMat = skel->getMFJointMatrices ();
MFMatrix *mfJointBindMat = data->editMFJointMatrices();
mfJointBindMat->resize(mfJointMat->size());
for(UInt32 i = 0; i < mfJointMat->size(); ++i)
{
(*mfJointBindMat)[i] = (*mfJointMat)[i];
(*mfJointBindMat)[i].mult(skinGeo->getBindShapeMatrix());
}
mfJointMat = data->getMFJointMatrices();
if(skel->getCalcNormalMatrices() == true)
{
mfJointNormalMat = skel->getMFJointNormalMatrices ();
MFMatrix *mfJointNormalBindMat = data->editMFJointNormalMatrices();
mfJointNormalBindMat->resize(mfJointNormalMat->size());
for(UInt32 i = 0; i < mfJointNormalMat->size(); ++i)
{
(*mfJointNormalBindMat)[i] = (*mfJointNormalMat)[i];
(*mfJointNormalBindMat)[i].mult(skinGeo->getBindShapeMatrix());
}
mfJointNormalMat = data->getMFJointNormalMatrices();
}
else
{
mfJointNormalMat = data->getMFJointMatrices();
}
}
else
{
mfJointMat = skel->getMFJointMatrices();
if(skel->getCalcNormalMatrices() == true)
{
mfJointNormalMat = skel->getMFJointNormalMatrices();
}
else
{
mfJointNormalMat = skel->getMFJointMatrices();
}
}
// transform all properties
for(UInt16 i = 0; i < mfProps->size(); ++i)
{
// do not transform the vertex joint indices/weights
if(i == skinGeo->getJointIndexProperty () ||
i == skinGeo->getJointWeightProperty() )
{
continue;
}
GeoIntegralProperty *origPropIdx = (*mfOrigIdx )[i];
GeoVectorProperty *origProp = (*mfOrigProps)[i];
GeoVectorProperty *prop = (*mfProps )[i];
//.........这里部分代码省略.........