本文整理汇总了C++中CStudioHdr::iHitboxCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CStudioHdr::iHitboxCount方法的具体用法?C++ CStudioHdr::iHitboxCount怎么用?C++ CStudioHdr::iHitboxCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStudioHdr
的用法示例。
在下文中一共展示了CStudioHdr::iHitboxCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scaleMeshes
void StudioModel::scaleMeshes (float scale)
{
CStudioHdr *pStudioHdr = GetStudioHdr();
if (!pStudioHdr)
return;
int i, j, k;
// manadatory to access correct verts
SetCurrentModel();
// scale verts
int tmp = m_bodynum;
for (i = 0; i < pStudioHdr->numbodyparts(); i++)
{
mstudiobodyparts_t *pbodypart = pStudioHdr->pBodypart( i );
for (j = 0; j < pbodypart->nummodels; j++)
{
SetBodygroup (i, j);
SetupModel (i);
const mstudio_modelvertexdata_t *vertData = m_pmodel->GetVertexData();
for (k = 0; k < m_pmodel->numvertices; k++)
{
*vertData->Position(k) *= scale;
}
}
}
m_bodynum = tmp;
// scale complex hitboxes
int hitboxset = g_MDLViewer->GetCurrentHitboxSet();
mstudiobbox_t *pbboxes = pStudioHdr->pHitbox( 0, hitboxset );
for (i = 0; i < pStudioHdr->iHitboxCount( hitboxset ); i++)
{
VectorScale (pbboxes[i].bbmin, scale, pbboxes[i].bbmin);
VectorScale (pbboxes[i].bbmax, scale, pbboxes[i].bbmax);
}
// scale bounding boxes
for (i = 0; i < pStudioHdr->GetNumSeq(); i++)
{
mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( i );
Vector tmp;
tmp = seqdesc.bbmin;
VectorScale( tmp, scale, tmp );
seqdesc.bbmin = tmp;
tmp = seqdesc.bbmax;
VectorScale( tmp, scale, tmp );
seqdesc.bbmax = tmp;
}
// maybe scale exeposition, pivots, attachments
}
示例2:
void
ControlPanel::setModelInfo()
{
static char str[2048];
CStudioHdr *hdr = models->GetActiveStudioModel()->GetStudioHdr();
if (!hdr)
return;
int hbcount = 0;
for ( int s = 0; s < hdr->numhitboxsets(); s++ )
{
hbcount += hdr->iHitboxCount( s );
}
sprintf (str,
"Bones: %d\n"
"Bone Controllers: %d\n"
"Hit Boxes: %d in %d sets\n"
"Sequences: %d\n",
hdr->numbones(),
hdr->numbonecontrollers(),
hbcount,
hdr->numhitboxsets(),
hdr->GetNumSeq()
);
lModelInfo1->setLabel (str);
sprintf (str,
"Textures: %d\n"
"Skin Families: %d\n"
"Bodyparts: %d\n"
"Attachments: %d\n",
hdr->numtextures(),
hdr->numskinfamilies(),
hdr->numbodyparts(),
hdr->GetNumAttachments());
lModelInfo2->setLabel (str);
}