本文整理汇总了C++中MeshPtr::GetSkeleton方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::GetSkeleton方法的具体用法?C++ MeshPtr::GetSkeleton怎么用?C++ MeshPtr::GetSkeleton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::GetSkeleton方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
void MeshLoader_v1::ReadSkelAnim(MeshPtr mesh, DataStreamPtr & stream)
{
Skeleton * skel = mesh->GetSkeleton();
int version = -1;
stream->Read(&version, sizeof (int));
d_assert (version == K_SkelAnim_Version);
char name[128];
stream->Read(name, 128);
Animation * anim = mesh->CreateAnimation(name);
int numAnims = 0;
stream->Read(&numAnims, sizeof(int));
for (int i = 0; i < numAnims; ++i)
{
int boneId, count;
stream->Read(&boneId, sizeof(int));
stream->Read(&count, sizeof(int));
if (count == 0)
continue;
SkeletonAnimation * skel_anim;
skel_anim = anim->CreateSkeletonAnimation(boneId);
KeyFrame * kf;
float time;
Vec3 trans;
Quat rotate;
Vec3 scale;
for (int i = 0; i < count; ++i)
{
stream->Read(&time, sizeof(float));
stream->Read(&trans, sizeof(float) * 3);
stream->Read(&rotate, sizeof(float) * 4);
stream->Read(&scale, sizeof(float) * 3);
kf = skel_anim->CreateKeyFrame();
kf->SetTime(time);
kf->SetTranslate(trans);
kf->SetRotation(rotate);
kf->SetScale(scale);
}
}
anim->_calcuLength();
}
示例2:
void MeshLoader_v0::ReadSkeleton(MeshPtr mesh, DataStreamPtr & stream)
{
String sSkeletonName;
stream->ReadString(sSkeletonName);
TString128 Source = mesh->GetSourceName();
Source = File::GetFileDir(Source);
if (Source == "")
{
Source = sSkeletonName.c_str();
}
else
{
Source += "\\";
Source += sSkeletonName.c_str();
}
SkeletonLoader::Load(mesh->GetSkeleton(), Source);
//mesh->SetSkeletonName(sSkeletonName.c_str());
}