Assets/Examples/Scripts/ProceduralTerrainDensityCalculationJob.cs
/// <summary>
/// Calculates the density at the world-space position
/// </summary>
/// <param name="worldPositionX">Sampling point's world-space x position</param>
/// <param name="worldPositionY">Sampling point's world-space y position</param>
/// <param name="worldPositionZ">Sampling point's world-space z position</param>
/// <returns>The density sampled from the world-space position</returns>
Calculates the density at the world-space position
Calculates the density at the world - space position
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public float CalculateDensity(int worldPositionX, int worldPositionY, int worldPositionZ)
        {
            return worldPositionY - OctaveNoise(worldPositionX, worldPositionZ, proceduralTerrainSettings.NoiseFrequency * 0.001f, proceduralTerrainSettings.NoiseOctaveCount) * proceduralTerrainSettings.Amplitude - proceduralTerrainSettings.HeightOffset;
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public float CalculateDensity ( int worldPositionX , int worldPositionY , int worldPositionZ ) { return worldPositionY - OctaveNoise ( worldPositionX , worldPositionZ , proceduralTerrainSettings . NoiseFrequency * 0.001f , proceduralTerrainSettings . NoiseOctaveCount ) * proceduralTerrainSettings . Amplitude - proceduralTerrainSettings . HeightOffset ; }
Calculates the density at the world-space position
Calculates the density at the world - space position
The density sampled from the world-space position
The density sampled from the world - space position
worldPositionX
int
Sampling point's world-space x position
Sampling point ' s world - space x position
worldPositionY
int
Sampling point's world-space y position
Sampling point ' s world - space y position
worldPositionZ
int
Sampling point's world-space z position
Sampling point ' s world - space z position