|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmex.terrain.util.AbstractHeightMap
com.jmex.terrain.util.RawHeightMap
public class RawHeightMap
RawHeightMap
creates a height map from a RAW image file. The
greyscale image denotes height based on the value of the pixel for each
point. Where pure black the lowest point and pure white denotes the highest.
Field Summary | |
---|---|
static int |
FORMAT_16BITBE
Format specification for 16 bit big endian heightmaps |
static int |
FORMAT_16BITLE
Format specification for 16 bit little endian heightmaps |
static int |
FORMAT_8BIT
Format specification for 8 bit precision heightmaps |
Fields inherited from class com.jmex.terrain.util.AbstractHeightMap |
---|
filter, heightData, heightScale, NORMALIZE_RANGE, size |
Constructor Summary | |
---|---|
RawHeightMap(float[] heightData)
|
|
RawHeightMap(java.io.InputStream stream,
int size,
int format,
boolean swapxy)
|
|
RawHeightMap(java.lang.String filename,
int size)
Constructor creates a new RawHeightMap object and loads a
RAW image file to use as a height field. |
|
RawHeightMap(java.lang.String filename,
int size,
int format,
boolean swapxy)
|
|
RawHeightMap(java.net.URL resource,
int size,
int format,
boolean swapxy)
|
Method Summary | |
---|---|
boolean |
load()
load fills the height data array with the appropriate data
from the set RAW image. |
void |
setFilename(java.lang.String filename)
setFilename sets the file to use for the RAW data. |
void |
setHeightStream(java.io.InputStream stream)
setHeightStream sets the stream to use for the RAW data. |
Methods inherited from class com.jmex.terrain.util.AbstractHeightMap |
---|
erodeTerrain, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, unloadHeightMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FORMAT_8BIT
public static final int FORMAT_16BITLE
public static final int FORMAT_16BITBE
Constructor Detail |
---|
public RawHeightMap(java.lang.String filename, int size)
RawHeightMap
object and loads a
RAW image file to use as a height field. The greyscale image denotes the
height of the terrain, where dark is low point and bright is high point.
The values of the RAW correspond directly with the RAW values or 0 - 255.
filename
- the RAW file to use as the heightmap.size
- the size of the RAW (must be square).
JmeException
- if the filename is null or not RAW, and if the size is 0 or
less.public RawHeightMap(float[] heightData)
public RawHeightMap(java.lang.String filename, int size, int format, boolean swapxy)
public RawHeightMap(java.io.InputStream stream, int size, int format, boolean swapxy)
public RawHeightMap(java.net.URL resource, int size, int format, boolean swapxy)
Method Detail |
---|
public boolean load()
load
fills the height data array with the appropriate data
from the set RAW image. If the RAW image has not been set a JmeException
will be thrown.
load
in class AbstractHeightMap
public void setFilename(java.lang.String filename)
setFilename
sets the file to use for the RAW data. A call
to load
is required to put the changes into effect.
filename
- the new file to use for the height data.
JmeException
- if the file is null or not RAW.public void setHeightStream(java.io.InputStream stream)
setHeightStream
sets the stream to use for the RAW data. A call
to load
is required to put the changes into effect.
stream
- the new stream to use for the height data.
JmeException
- if the stream is null or not RAW.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |