Assets/Examples/Scripts/World.cs
/// <summary>
/// Gets the density at a world position
/// </summary>
/// <param name="worldPosition">The world position of the density to get</param>
/// <returns>The density at that world position (0 if it doesn't exist)</returns>
Gets the density at a world position
Gets the density at a world position
public float GetDensity(int3 worldPosition)
        {
            if (TryGetChunk(worldPosition, out Chunk chunk))
            {
                return chunk.GetDensity(worldPosition.Mod(ChunkSize));
            }
            return 0;
        }
public float GetDensity ( int3 worldPosition ) { if ( TryGetChunk ( worldPosition , out Chunk chunk ) ) { return chunk . GetDensity ( worldPosition . Mod ( ChunkSize ) ) ; } return 0 ; }
Gets the density at a world position
Gets the density at a world position
The density at that world position (0 if it doesn't exist)
The density at that world position ( 0 if it doesn ' t exist )
worldPosition
int3
The world position of the density to get
The world position of the density to get