public abstract class AbstractHeightMap extends java.lang.Object implements HeightMap, java.lang.Cloneable, java.io.Serializable
getHeight(int, int)
and getHeight(float, float)
.
HeightMap.getRange()
HeightMap.getIcon()
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name |
protected long |
seed |
Constructor and Description |
---|
AbstractHeightMap() |
AbstractHeightMap(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
AbstractHeightMap |
clone()
Create a deep copy of the height map.
|
double |
getBaseHeight()
Get the base height of this height map, in other words the lowest value
it can have.
|
int |
getColour(int x,
int y)
Get the colour of the height map at a particular location as a combined
RGB value consisting of the red component in bits 16-23, the green
component in bits 8-15, and the blue component in bits 0-7.
|
double |
getConstantValue()
If the height map is
constant : returns the constant
value that would be returned for any location from
HeightMap.getHeight(int, int) and HeightMap.getHeight(float, float) . |
java.awt.Rectangle |
getExtent()
Get the extent of the height map, if any.
|
double |
getHeight(float x,
float y)
Get the height of the height map at a particular location.
|
double |
getHeight(int x,
int y)
Get the height of the height map at a particular location.
|
java.lang.String |
getName()
Get the name of the height map.
|
DelegatingHeightMap |
getParent() |
long |
getSeed()
Get the seed of the height map.
|
boolean |
isConstant()
Indicate whether the height map is constant, i.e.
|
void |
setName(java.lang.String name) |
void |
setSeed(long seed)
Set the seed of the height map.
|
public AbstractHeightMap()
public AbstractHeightMap(java.lang.String name)
public DelegatingHeightMap getParent()
public java.lang.String getName()
HeightMap
public void setName(java.lang.String name)
public long getSeed()
HeightMap
public void setSeed(long seed)
HeightMap
public AbstractHeightMap clone()
HeightMap
public java.awt.Rectangle getExtent()
HeightMap
null
.public int getColour(int x, int y)
HeightMap
public double getHeight(float x, float y)
HeightMap
public double getHeight(int x, int y)
HeightMap
public boolean isConstant()
HeightMap
isConstant
in interface HeightMap
true
if the height map is constant.public double getConstantValue()
HeightMap
constant
: returns the constant
value that would be returned for any location from
HeightMap.getHeight(int, int)
and HeightMap.getHeight(float, float)
. If the
height map is not constant the behaviour is undefined.getConstantValue
in interface HeightMap
HeightMap.isConstant()
.public double getBaseHeight()
HeightMap
getBaseHeight
in interface HeightMap