Class Grassland
- java.lang.Object
-
- de.coreengine.rendering.renderable.Grassland
-
public class Grassland extends Object
Class that represent a grassland for a terrain- Author:
- Darius Dinger
-
-
Constructor Summary
Constructors Constructor Description Grassland()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.vecmath.Vector2f
getArea()
Getting the area of the grassland around the player as 2d vector.int
getDensity()
String
getDensityMap()
Returning the densitymap for this grassland.float
getDistance()
Mesh
getMesh()
float
getTuftScale()
float
getWindIntensitivity()
String
getWindMap()
float
getWindMapTiling()
float
getWindOffset()
void
setArea(float range, float gradient)
Setting the area of the grassland around the player.void
setDensity(int density)
Setting the density for the grassland model.void
setDensityMap(String density)
Setting the densitymap for this grassland.void
setDistance(int distance)
void
setMesh(Mesh mesh, float scale)
void
setWindIntensitivity(float windIntensitivity)
Setting the intensiveness, the windmap effects the grass bladesvoid
setWindMap(String windMap)
Setting map that contains the grass vector transformation by windvoid
setWindMapTiling(float windMapTiling)
void
setWindOffset(float windOffset)
-
-
-
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 meshscale
- 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 grasslandgradient
- 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
-
-