本文整理汇总了C++中Point3F::setMin方法的典型用法代码示例。如果您正苦于以下问题:C++ Point3F::setMin方法的具体用法?C++ Point3F::setMin怎么用?C++ Point3F::setMin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point3F
的用法示例。
在下文中一共展示了Point3F::setMin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCommonScale
void CelAnimMesh::setCommonScale( Shape::Mesh & otherMesh )
{
CelAnimMesh *potherMesh = dynamic_cast<CelAnimMesh *>(&otherMesh);
AssertFatal(potherMesh,
"TS::CelAnimMesh::setCommonScale: meshes not same type");
#if 0
// array of unpacked verts -- points only
Point3F *unpackedVerts = new Point3F[fVerts.size()];
int v;
for (v=0;v<fVerts.size();v++)
fVerts[v].getPoint(unpackedVerts[v],fScale,fOrigin);
Point3F *otherUnpackedVerts = new Point3F[potherMesh->fVerts.size()];
for (v=0;v<potherMesh->fVerts.size();v++)
potherMesh->fVerts[v].getPoint(otherUnpackedVerts[v],potherMesh->fScale,potherMesh->fOrigin);
// get minVert and maxVert for setting new fScale, fOrigin, and fRadius
Point3F minVert = unpackedVerts[0];
Point3F maxVert = unpackedVerts[0];
for (v=1;v<fVerts.size();v++)
{
minVert.setMin( unpackedVerts[v] );
maxVert.setMax( unpackedVerts[v] );
}
for (v=0;v<potherMesh->fVerts.size();v++)
{
minVert.setMin( otherUnpackedVerts[v] );
maxVert.setMax( otherUnpackedVerts[v] );
}
// figure new fOrigin, fScale, and fRadius
Point3F newOrigin = minVert;
maxVert -= minVert;
Point3F newScale( maxVert.x/255.0f, maxVert.y/255.0f, maxVert.z/255.0f);
float newRadius = maxVert.len();
// re-pack this shapes verts
int i;
Point3F temp;
for (i=0;i<fVerts.size();i++)
fVerts[i].setPoint(unpackedVerts[i],newScale,newOrigin);
fOrigin=newOrigin;
fScale=newScale;
fRadius=newRadius;
// re-pack other shapes verts
for (i=0;i<potherMesh->fVerts.size();i++)
potherMesh->fVerts[i].setPoint(otherUnpackedVerts[i],newScale,newOrigin);
potherMesh->fOrigin=fOrigin;
potherMesh->fScale=newScale;
potherMesh->fRadius=newRadius;
delete [] unpackedVerts;
delete [] otherUnpackedVerts;
#endif
}