Class TerrainConfig


  • public class TerrainConfig
    extends Object
    Class that represent a configuration for a terrain
    Author:
    Darius Dinger
    • Constructor Detail

      • TerrainConfig

        public TerrainConfig()
        Creates new default terrain config
    • Method Detail

      • setLodRanges

        public void setLodRanges​(float[] lodRanges)
        Setting this terrains lod stage area ranges.
        lodRanges does not have to be null or empty, else it will rejected
        Parameters:
        lodRanges - New ranges of the lod stages
      • getTexturePack

        public TerrainTexturePack getTexturePack()
        Returns:
        Terrain texturepack that contains all materials of the terrain
      • setTexturePack

        public void setTexturePack​(TerrainTexturePack texturePack)
        Setting the new texture pack of the terrain
        Parameters:
        texturePack - New texture pack
      • getLightMap

        public String getLightMap()
        Returns:
        Lightmap of the terrain that contains the normals for faster lighting calculation
      • setLightMap

        public void setLightMap​(String lightMap)
        Setting the new light map of the terrain
        Parameters:
        lightMap - New light map
      • getHeightMap

        public TextureData getHeightMap()
        Returns:
        The heightmap contains the height at the specific points
      • setHeightMap

        public void setHeightMap​(TextureData heightMap)
        Setting the new height map of the terrain
        Parameters:
        heightMap - New height map
      • getBlendMap

        public String getBlendMap()
        Returns:
        The blend map contains, wich texture should mapped on wich point on the terrain
      • setBlendMap

        public void setBlendMap​(String blendMap)
        Setting the new blend map of the terrain
        Parameters:
        blendMap - New blend map
      • setAmplitude

        public void setAmplitude​(float amplitude)
        Setting the vertical scaling of the terrain in world space.
        The terrain max height in world space will be scale * amplitude + y. Can be calculated by Amplitude = (TerrainMaxHeight -TerrainY) / TerrainSize.
        Parameters:
        amplitude - New terrain vertical scaling in terrain space
      • getAmplitude

        public float getAmplitude()
        Returning the current vertical scaling of the terrain in terrain space.
        The terrain max height in world space will be scale * amplitude + y.
        Returns:
        Terrain vertical scaling in terrain space
      • getTesselationArea

        public javax.vecmath.Vector3f getTesselationArea()
        Getting the terrains current tesselation area as 3d vector. The x value describes the maximum tesselation, the y value describes the range of the tesselation and the z value describes the tesselation gradient. The formula for the terrain tesselation is:
        t(x) = tessFactor * e^-(tessDensity * x)^tessGradient
        Returns:
        Terrains current tesselation area as 3d vector
      • setTesselationAttenuation

        public void setTesselationAttenuation​(float tessFactor,
                                              float tessRange,
                                              float dessGradient)
        Setting the terrains current tesselation attenuations. They must be greater than 0, else the change will rejected. The formula for the terrain tesselation is:
        t(x) = tessFactor * e^-(tessDensity * x)^tessGradient
        Parameters:
        tessFactor - New tesselation Factor (Max tesselation)
        tessRange - New tesselation density (Range)
        dessGradient - New tesselation gradient (Attenuation)