float GetDistanceCoefficient( Vec3 pos )
{
switch( distanceFunction )
{
case DistanceFunctionType.One:
return 1;
case DistanceFunctionType.NormalFadeAxisX:
float distance = ( Rotation.GetInverse() * ( pos - Position ) ).X;
return 1.0f - Math.Abs( distance ) / ( Scale.X * .5f );
default:
throw new Exception( "GetDistanceCoefficient no code" );
}
}