本文整理汇总了C++中MFloatArray::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ MFloatArray::clear方法的具体用法?C++ MFloatArray::clear怎么用?C++ MFloatArray::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFloatArray
的用法示例。
在下文中一共展示了MFloatArray::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: edgeIter
MStatus Molecule3Cmd::redoIt()
{
MStatus stat;
MDagPath dagPath;
MFnMesh meshFn;
// Create a ball
int nBallPolys;
MPointArray ballVerts;
MIntArray ballPolyCounts;
MIntArray ballPolyConnects;
MFloatArray ballUCoords;
MFloatArray ballVCoords;
MIntArray ballFvUVIDs;
genBall( MPoint::origin, ballRodRatio * radius.value(), segs, nBallPolys,
ballVerts, ballPolyCounts, ballPolyConnects,
true, ballUCoords, ballVCoords, ballFvUVIDs );
unsigned int i, j, vertOffset;
MPointArray meshVerts;
MPoint p0, p1;
MObject objTransform;
// Setup for rods
int nRodPolys;
MPointArray rodVerts;
MIntArray rodPolyCounts;
MIntArray rodPolyConnects;
MFloatArray rodUCoords;
MFloatArray rodVCoords;
MIntArray rodFvUVIDs;
// Setup for newMesh
int nNewPolys;
MPointArray newVerts;
MIntArray newPolyCounts;
MIntArray newPolyConnects;
MFloatArray newUCoords;
MFloatArray newVCoords;
MIntArray newFvUVIDs;
int uvOffset;
MDagModifier dagMod;
MFnDagNode dagFn;
objTransforms.clear();
// Iterate over the meshes
unsigned int mi;
for( mi=0; mi < selMeshes.length(); mi++ )
{
dagPath = selMeshes[mi];
meshFn.setObject( dagPath );
uvOffset = 0;
nNewPolys = 0;
newVerts.clear();
newPolyCounts.clear();
newPolyConnects.clear();
newUCoords.clear();
newVCoords.clear();
newFvUVIDs.clear();
// Generate balls
meshFn.getPoints( meshVerts, MSpace::kWorld );
for( i=0; i < meshVerts.length(); i++ )
{
vertOffset = newVerts.length();
// Add the ball to the new mesh
nNewPolys += nBallPolys;
// Move the ball vertices to the mesh vertex. Add it to the newMesh
for( j=0; j < ballVerts.length(); j++ )
newVerts.append( meshVerts[i] + ballVerts[j] );
for( j=0; j < ballPolyCounts.length(); j++ )
newPolyCounts.append( ballPolyCounts[j] );
for( j=0; j < ballPolyConnects.length(); j++ )
newPolyConnects.append( vertOffset + ballPolyConnects[j] );
// Only add the uv coordinates once, since they are shared
// by all balls
if( i == 0 )
{
for( j=0; j < ballUCoords.length(); j++ )
{
newUCoords.append( ballUCoords[j] );
newVCoords.append( ballVCoords[j] );
}
}
for( j=0; j < ballFvUVIDs.length(); j++ )
{
newFvUVIDs.append( uvOffset + ballFvUVIDs[j] );
}
}
uvOffset = newUCoords.length();
//.........这里部分代码省略.........