Package com.jme3.terrain.heightmap
Class RawHeightMap
java.lang.Object
com.jme3.terrain.heightmap.AbstractHeightMap
com.jme3.terrain.heightmap.RawHeightMap
- All Implemented Interfaces:
- HeightMap
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 SummaryFieldsModifier and TypeFieldDescriptionstatic final intFormat specification for 16 bit big endian heightmapsstatic final intFormat specification for 16 bit little endian heightmapsstatic final intFormat specification for 8 bit precision heightmapsFields inherited from class com.jme3.terrain.heightmap.AbstractHeightMapfilter, heightData, heightScale, NORMALIZE_RANGE, size
- 
Constructor SummaryConstructorsConstructorDescriptionRawHeightMap(float[] heightData) RawHeightMap(InputStream stream, int size, int format, boolean swapxy) RawHeightMap(String filename, int size) Constructor creates a newRawHeightMapobject and loads a RAW image file to use as a height field.RawHeightMap(String filename, int size, int format, boolean swapXy) RawHeightMap(URL resource, int size, int format, boolean swapxy) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanload()loadfills the height data array with the appropriate data from the set RAW image.voidsetFilename(String filename) setFilenamesets the file to use for the RAW data.voidsetHeightStream(InputStream stream) setHeightStreamsets the stream to use for the RAW data.Methods inherited from class com.jme3.terrain.heightmap.AbstractHeightMaperodeTerrain, findMinMaxHeights, flatten, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getScaledHeightMap, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, smooth, smooth, unloadHeightMap
- 
Field Details- 
FORMAT_8BITpublic static final int FORMAT_8BITFormat specification for 8 bit precision heightmaps- See Also:
 
- 
FORMAT_16BITLEpublic static final int FORMAT_16BITLEFormat specification for 16 bit little endian heightmaps- See Also:
 
- 
FORMAT_16BITBEpublic static final int FORMAT_16BITBEFormat specification for 16 bit big endian heightmaps- See Also:
 
 
- 
- 
Constructor Details- 
RawHeightMapConstructor creates a newRawHeightMapobject 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.- Parameters:
- filename- the RAW file to use as the heightmap.
- size- the size of the RAW (must be square).
- Throws:
- Exception- if the filename is null or not RAW, and if the size is 0 or less.
 
- 
RawHeightMappublic RawHeightMap(float[] heightData) 
- 
RawHeightMap- Throws:
- Exception
 
- 
RawHeightMap- Throws:
- Exception
 
- 
RawHeightMap- Throws:
- Exception
 
 
- 
- 
Method Details- 
loadpublic boolean load()loadfills the height data array with the appropriate data from the set RAW image.- Returns:
- true if the load is successful, false otherwise.
- Throws:
- RuntimeException- if the RAW image has not been set
 
- 
setFilenamesetFilenamesets the file to use for the RAW data. A call toloadis required to put the changes into effect.- Parameters:
- filename- the new file to use for the height data.
- Throws:
- Exception- if the file is null or not RAW.
 
- 
setHeightStreamsetHeightStreamsets the stream to use for the RAW data. A call toloadis required to put the changes into effect.- Parameters:
- stream- the new stream to use for the height data.
- Throws:
- Exception- if the stream is null or not RAW.
 
 
-