本文整理汇总了C++中Noise::turbulence3dS方法的典型用法代码示例。如果您正苦于以下问题:C++ Noise::turbulence3dS方法的具体用法?C++ Noise::turbulence3dS怎么用?C++ Noise::turbulence3dS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Noise
的用法示例。
在下文中一共展示了Noise::turbulence3dS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
MStatus mDbl3dTurbulence::doIt( const MArgList& args )
{
if (args.length() == 2)
{
// vector array
// get the arguments
MDoubleArray dblA, dblB;
unsigned int incA, incB, count;
MStatus stat = getArgVecDbl(args, dblA, dblB, incA, incB, count);
ERROR_FAIL(stat);
// do the actual job
unsigned int iterA, iterB;
iterA = iterB = 0;
MDoubleArray result(count);
Noise noiseGen;
for(int i=0;i<count;i++)
{
int id = ELEMENTS_VEC *iterA;
result[i] = noiseGen.turbulence3dS(float(dblA[id]), float(dblA[id+1]),float(dblA[id+2]),int(dblB[iterB]),false,NOISE_IMPROVED_PERLIN);
iterA += incA;
iterB += incB;
}
setResult(result);
}
else if (args.length() == 4)
{
// get the arguments
MDoubleArray dblA, dblB, dblC,dblD;
unsigned int incA, incB, incC, incD, count;
MStatus stat = getArgDblDblDblDbl(args, dblA, dblB, dblC,dblD, incA, incB, incC, incD,count);
ERROR_FAIL(stat);
// do the actual job
unsigned int iterA, iterB, iterC,iterD;
iterA = iterB = iterC =iterD = 0;
MDoubleArray result(count);
Noise noiseGen;
for (unsigned int i=0;i<count;i++)
{
result[i] = noiseGen.turbulence3dS(float(dblA[iterA]), float(dblB[iterB]), float(dblC[iterC]), int(dblD[iterD]),false,NOISE_IMPROVED_PERLIN);
iterA += incA;
iterB += incB;
iterC += incC;
iterD += incD;
}
setResult(result);
}
else
{
USER_ERROR_CHECK(MS::kFailure,("mDbl3dTurbulence: wrong number of arguments, should be 1 vecArray + 1 dblArray or 4 dblArrays!"));
}
return MS::kSuccess;
}