fCraft.Noise.CalculateCoverage C# (CSharp) Method

CalculateCoverage() public static method

public static CalculateCoverage ( [ data, int length, float threshold ) : float
data [
length int
threshold float
return float
        public static unsafe float CalculateCoverage( [NotNull] float* data, int length, float threshold )
        {
            if ( data == null )
                throw new ArgumentNullException( "data" );
            int coveredVoxels = 0;
            float* end = data + length;
            while ( data < end ) {
                if ( *data < threshold )
                    coveredVoxels++;
                data++;
            }
            return coveredVoxels / ( float )length;
        }