Class Grassland


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

      • Grassland

        public Grassland()
    • Method Detail

      • getArea

        public javax.vecmath.Vector2f getArea()
        Getting the area of the grassland around the player as 2d vector. The x value is the range and the y value is the gradient. The grassblade visibility will be calculated by this formula:
        g(x) = e^-(range * x)^gradient
        Returns:
        Area of the grassland
      • getDensityMap

        public String getDensityMap()
        Returning the densitymap for this grassland. Darker means smaller grass and lighter means bigger gras. Black is no gras.
        Returns:
        Density of the grassland
      • getMesh

        public Mesh getMesh()
        Returns:
        Mesh1 that contains the grass blade positions
      • getTuftScale

        public float getTuftScale()
        Returns:
        Scale of the tuft mesh
      • setMesh

        public void setMesh​(Mesh mesh,
                            float scale)
        Parameters:
        mesh - New gras mesh
        scale - Scale of the tuft mesh
      • getWindMap

        public String getWindMap()
        Returns:
        Map that contains the grass vector transformation by wind
      • setDensityMap

        public void setDensityMap​(String density)
        Setting the densitymap for this grassland. Darker means smaller grass and lighter means bigger gras. Black is no gras.
        Parameters:
        density - New densitymap
      • setWindMap

        public void setWindMap​(String windMap)
        Setting map that contains the grass vector transformation by wind
        Parameters:
        windMap - New windmap
      • setArea

        public void setArea​(float range,
                            float gradient)
        Setting the area of the grassland around the player. The grassblade visibility will be calculated by this formula:
        g(x) = e^-(range * x)^gradient
        Parameters:
        range - Range of the grassland
        gradient - Gradient at the grassland end
      • setDensity

        public void setDensity​(int density)
        Setting the density for the grassland model. If the max range is increasing, the density is decreasing and must be reconfigured.
        Parameters:
        density - New mesh density
      • setWindOffset

        public void setWindOffset​(float windOffset)
        Parameters:
        windOffset - New offset of the windmap over the terrain
      • getWindOffset

        public float getWindOffset()
        Returns:
        Offset of the windmap over the terrain
      • getWindIntensitivity

        public float getWindIntensitivity()
        Returns:
        Intensitivity of the windmap onto the blade vectors
      • setWindIntensitivity

        public void setWindIntensitivity​(float windIntensitivity)
        Setting the intensiveness, the windmap effects the grass blades
        Parameters:
        windIntensitivity - New intensiveness
      • getDensity

        public int getDensity()
        Returns:
        Density of the gras (gras Per Row/Column)
      • getDistance

        public float getDistance()
        Returns:
        Distance between two grass tufts
      • setDistance

        public void setDistance​(int distance)
        Parameters:
        distance - Distance between two grass tufts
      • getWindMapTiling

        public float getWindMapTiling()
        Returns:
        Tiling for the windmap
      • setWindMapTiling

        public void setWindMapTiling​(float windMapTiling)
        Parameters:
        windMapTiling - New tiling for the windmap