本文整理汇总了C++中Skeleton::getMFJoints方法的典型用法代码示例。如果您正苦于以下问题:C++ Skeleton::getMFJoints方法的具体用法?C++ Skeleton::getMFJoints怎么用?C++ Skeleton::getMFJoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skeleton
的用法示例。
在下文中一共展示了Skeleton::getMFJoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSkin
Action::ResultE
SkeletonSkinningAlgorithm::renderEnter(Action *action)
{
Action::ResultE res = Action::Continue;
RenderAction *ract =
boost::polymorphic_downcast<RenderAction *>(action);
SkinnedGeometry *skinGeo = getSkin();
Skeleton *skel = skinGeo->getSkeleton();
skel->renderEnter(action, skinGeo);
const Skeleton::MFJointsType *joints = skel->getMFJoints();
const Skeleton::MFParentJointsType *parentJoints =
skel->getMFParentJoints();
const Skeleton::MFJointMatricesType *jointMats =
skel->getMFJointMatrices();
UInt32 numJoints = joints->size32();
#ifndef OSG_SKELETON_SKINNING_ALGO_DRAW_AXIS
_mfDrawPositions.resize(numJoints);
_mfDrawIndex .clear ( );
for(UInt32 i = 0; i < numJoints; ++i)
{
(*jointMats)[i].mult(Pnt3f(0.f, 0.f, 0.f),
_mfDrawPositions[i] );
if((*parentJoints)[i] != NULL)
{
_mfDrawIndex.push_back(i );
_mfDrawIndex.push_back((*parentJoints)[i]->getJointId());
}
}
#else
Real32 axisLen = 1.f;
_mfDrawPositions.resize(4 * numJoints);
_mfDrawIndex .clear ( );
for(UInt32 i = 0; i < numJoints; ++i)
{
(*jointMats)[i].mult(Pnt3f(0.f, 0.f, 0.f),
_mfDrawPositions[4 * i + 0]);
if((*parentJoints)[i] != NULL)
{
_mfDrawIndex.push_back(4 * i + 0);
_mfDrawIndex.push_back(4 * (*parentJoints)[i]->getJointId() + 0);
Vec3f vec =
_mfDrawPositions[4 * i + 0] -
_mfDrawPositions[4 * (*parentJoints)[i]->getJointId() + 0];
axisLen = 0.2f * vec.length();
axisLen = 1.f;
}
else
{
axisLen = 1.f;
}
(*jointMats)[i].mult(
Pnt3f(axisLen, 0.f, 0.f ), _mfDrawPositions[4 * i + 1]);
(*jointMats)[i].mult(
Pnt3f(0.f, axisLen, 0.f ), _mfDrawPositions[4 * i + 2]);
(*jointMats)[i].mult(
Pnt3f(0.f, 0.f, axisLen), _mfDrawPositions[4 * i + 3]);
_mfDrawIndex.push_back(4 * i + 0);
_mfDrawIndex.push_back(4 * i + 1);
_mfDrawIndex.push_back(4 * i + 0);
_mfDrawIndex.push_back(4 * i + 2);
_mfDrawIndex.push_back(4 * i + 0);
_mfDrawIndex.push_back(4 * i + 3);
}
#endif // #ifndef OSG_SKELETON_SKINNING_ALGO_DRAW_AXIS
DrawEnv::DrawFunctor drawFuncSkinAlgo =
boost::bind(&SkeletonSkinningAlgorithm::drawFunc, this, _1);
PrimeMaterial *skelMat = getDefaultUnlitMaterial();
State *state = skelMat->getState ();
ract->dropFunctor(drawFuncSkinAlgo, state, skelMat->getSortKey());
return res;
}