本文整理汇总了C++中boneInfo_v::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ boneInfo_v::push_back方法的具体用法?C++ boneInfo_v::push_back怎么用?C++ boneInfo_v::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boneInfo_v
的用法示例。
在下文中一共展示了boneInfo_v::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: G2_Add_Bone
// we need to add a bone to the list - find a free one and see if we can find a corresponding bone in the gla file
int G2_Add_Bone (const model_t *mod, boneInfo_v &blist, const char *boneName)
{
int i, x;
mdxaSkel_t *skel;
mdxaSkelOffsets_t *offsets;
boneInfo_t tempBone;
offsets = (mdxaSkelOffsets_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t));
// walk the entire list of bones in the gla file for this model and see if any match the name of the bone we want to find
for (x=0; x< mod->mdxa->numBones; x++)
{
skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[x]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
{
break;
}
}
// check to see we did actually make a match with a bone in the model
if (x == mod->mdxa->numBones)
{
// didn't find it? Error
assert(0);
return -1;
}
// look through entire list - see if it's already there first
for(i=0; i<blist.size(); i++)
{
// if this bone entry has info in it, bounce over it
if (blist[i].boneNumber != -1)
{
skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[blist[i].boneNumber]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
{
return i;
}
}
else
{
// if we found an entry that had a -1 for the bonenumber, then we hit a bone slot that was empty
blist[i].boneNumber = x;
blist[i].flags = 0;
return i;
}
}
// ok, we didn't find an existing bone of that name, or an empty slot. Lets add an entry
tempBone.boneNumber = x;
tempBone.flags = 0;
blist.push_back(tempBone);
return blist.size()-1;
}
示例2: G2_Add_Bone
// we need to add a bone to the list - find a free one and see if we can find a corresponding bone in the gla file
int G2_Add_Bone (const model_t *mod, boneInfo_v &blist, const char *boneName)
{
int i, x;
mdxaSkel_t *skel;
mdxaSkelOffsets_t *offsets;
boneInfo_t tempBone;
offsets = (mdxaSkelOffsets_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t));
// walk the entire list of bones in the gla file for this model and see if any match the name of the bone we want to find
for (x=0; x< mod->mdxa->numBones; x++)
{
skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[x]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
{
break;
}
}
// check to see we did actually make a match with a bone in the model
if (x == mod->mdxa->numBones)
{
#if _DEBUG
G2_Bone_Not_Found(boneName,mod->name);
#endif
return -1;
}
// look through entire list - see if it's already there first
for(i=0; i<blist.size(); i++)
{
// if this bone entry has info in it, bounce over it
if (blist[i].boneNumber != -1)
{
skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[blist[i].boneNumber]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
{
#if DEBUG_G2_BONES
{
char mess[1000];
sprintf(mess,"ADD BONE1 blistIndex=%3d physicalIndex=%3d %s\n",
i,
x,
boneName);
OutputDebugString(mess);
}
#endif
return i;
}
}
else
{
// if we found an entry that had a -1 for the bonenumber, then we hit a bone slot that was empty
blist[i].boneNumber = x;
blist[i].flags = 0;
#if DEBUG_G2_BONES
{
char mess[1000];
sprintf(mess,"ADD BONE1 blistIndex=%3d physicalIndex=%3d %s\n",
i,
x,
boneName);
OutputDebugString(mess);
}
#endif
return i;
}
}
// ok, we didn't find an existing bone of that name, or an empty slot. Lets add an entry
tempBone.boneNumber = x;
tempBone.flags = 0;
blist.push_back(tempBone);
#if DEBUG_G2_BONES
{
char mess[1000];
sprintf(mess,"ADD BONE1 blistIndex=%3d physicalIndex=%3d %s\n",
blist.size()-1,
x,
boneName);
OutputDebugString(mess);
}
#endif
return blist.size()-1;
}