本文整理汇总了C++中CBox::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ CBox::Set方法的具体用法?C++ CBox::Set怎么用?C++ CBox::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBox
的用法示例。
在下文中一共展示了CBox::Set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateHitColModelSkinned
void CPedModelInfo::CreateHitColModelSkinned(RpClump* clump)
{
RpHAnimHierarchy* hier = GetAnimHierarchyFromSkinClump(clump);
CColModel* hitColModel = new CColModel;
RwMatrixTag* frameInverseMat = CGame::GetWorkingMatrix1();
RwMatrixTag* transformMatrix = CGame::GetWorkingMatrix2();
hitColModel->AllocateData(12, 0, 0, 0, 0, 0);
RwMatrixInvert(frameInverseMat, &RpClumpGetFrame(clump)->modelling);
for (size_t i = 0; i < ELEMS_COUNT(m_pColNodeInfos); i++)
{
CColSphere colSphere;
colSphere.Set(m_pColNodeInfos[i].sphere.GetRadius(), m_pColNodeInfos[i].sphere.GetCenter());
CCollisionData* colData = hitColModel->GetColData();
*transformMatrix = *frameInverseMat;
RwInt32 matIndex = RpHAnimIDGetIndex(hier, m_pColNodeInfos[i].animId) << 6;
RwMatrix* mat = (RwMatrix*)(RpHAnimHierarchyGetMatrixArray(hier) + matIndex);
RwMatrixTransform((RwMatrix *)transformMatrix, mat, rwCOMBINEPRECONCAT);
RwV3dTransformPoints(&colSphere.center, &colSphere.center, 1, (RwMatrix *)transformMatrix);
colSphere.SetSurfaceTypeA(EColSurface::PED);
colSphere.SetSurfaceTypeB(m_pColNodeInfos[i].surfaceTypeB);
colData->SetSphere(i, colSphere);
}
CBoundingBox boundingBox;
CVector maxbb(0.5f, 0.5f, 1.2f);
CVector minbb(-0.5f,-0.5f,-1.2f);
CBox box;
box.Set(minbb, maxbb);
boundingBox.SetBoundingSphere(CSphere(0, 0, 0, 1.5f));
hitColModel->SetBoundingBox(boundingBox);
hitColModel->SetColNum(0);
m_hitColModel = hitColModel;
}