Esempio n. 1
0
			);

		if(M != 0)
			NormalizationConstants[BasisIndex] *= FMath::Sqrt(2.f);

		M++;
		if(M > L)
		{
			L++;
			M = -L;
		}
	}

	return 0;
}
static int32 InitDummy = InitSHTables();

/** So that e.g. LP(1,1,1) which evaluates to -sqrt(1-1^2) is 0.*/
FORCEINLINE float SafeSqrt(float F)
{
	return FMath::Abs(F) > KINDA_SMALL_NUMBER ? FMath::Sqrt(F) : 0.f;
}

/** Evaluates the LegendrePolynomial for L,M at X */
float LegendrePolynomial(int32 L,int32 M,float X)
{
	switch(L)
	{
	case 0:
		return 1;
	case 1:
Esempio n. 2
0
			);

		if(M != 0)
			NormalizationConstants[BasisIndex] *= appSqrt(2.f);

		M++;
		if(M > L)
		{
			L++;
			M = -L;
		}
	}

	return 0;
}
static INT InitDummy = InitSHTables();

/** So that e.g. LP(1,1,1) which evaluates to -sqrt(1-1^2) is 0.*/
FORCEINLINE FLOAT SafeSqrt(FLOAT F)
{
	return Abs(F) > KINDA_SMALL_NUMBER ? appSqrt(F) : 0.f;
}

/** Evaluates the LegendrePolynomial for L,M at X */
FORCEINLINE FLOAT LegendrePolynomial(INT L,INT M,FLOAT X)
{
	switch(L)
	{
	case 0:
		return 1;
	case 1: