public class GeoMap
extends java.lang.Object
implements com.jme3.export.Savable
| Modifier and Type | Field and Description |
|---|---|
protected float[] |
hdata |
protected int |
height |
protected int |
maxval |
protected int |
width |
| Constructor and Description |
|---|
GeoMap() |
GeoMap(float[] heightData,
int width,
int height,
int maxval) |
| Modifier and Type | Method and Description |
|---|---|
com.jme3.scene.Mesh |
createMesh(com.jme3.math.Vector3f scale,
com.jme3.math.Vector2f tcScale,
boolean center) |
int |
getHeight()
Returns the height of this Geomap
|
float[] |
getHeightArray() |
int |
getMaximumValue() |
com.jme3.math.Vector2f |
getUV(int x,
int y,
com.jme3.math.Vector2f store) |
com.jme3.math.Vector2f |
getUV(int i,
com.jme3.math.Vector2f store) |
float |
getValue(int i)
Returns the height value at the given index.
|
float |
getValue(int x,
int y)
Returns the height value for a given point.
|
int |
getWidth()
Returns the width of this Geomap
|
boolean |
isLoaded()
Returns true if the Geomap data is loaded in memory
If false, then the data is unavailable- must be loaded with load()
before the methods getHeight/getNormal can be used
|
void |
read(com.jme3.export.JmeImporter im) |
void |
write(com.jme3.export.JmeExporter ex) |
java.nio.IntBuffer |
writeIndexArray(java.nio.IntBuffer store) |
java.nio.FloatBuffer |
writeNormalArray(java.nio.FloatBuffer store,
com.jme3.math.Vector3f scale)
Creates a normal array from the normal data in this Geomap
|
java.nio.FloatBuffer |
writeTexCoordArray(java.nio.FloatBuffer store,
com.jme3.math.Vector2f offset,
com.jme3.math.Vector2f scale) |
java.nio.FloatBuffer |
writeVertexArray(java.nio.FloatBuffer store,
com.jme3.math.Vector3f scale,
boolean center)
Creates a vertex array from the height data in this Geomap
The scale argument specifies the scale to use for the vertex buffer.
|
protected float[] hdata
protected int width
protected int height
protected int maxval
public GeoMap()
public GeoMap(float[] heightData,
int width,
int height,
int maxval)
public float[] getHeightArray()
public int getMaximumValue()
getValue() can
return. Mostly depends on the source data format (byte, short, int, etc).public float getValue(int x,
int y)
x - the X coordinatey - the Y coordinatejava.lang.NullPointerException - If isLoaded() is falsepublic float getValue(int i)
i - The indexjava.lang.NullPointerException - If isLoaded() is falsepublic int getWidth()
public int getHeight()
public boolean isLoaded()
public java.nio.FloatBuffer writeNormalArray(java.nio.FloatBuffer store,
com.jme3.math.Vector3f scale)
store - A preallocated FloatBuffer where to store the data (optional), size must be >= getWidth()*getHeight()*3java.lang.NullPointerException - If isLoaded() or hasNormalmap() is falsepublic java.nio.FloatBuffer writeVertexArray(java.nio.FloatBuffer store,
com.jme3.math.Vector3f scale,
boolean center)
store - A preallocated FloatBuffer where to store the data (optional),
size must be >= getWidth()*getHeight()*3scale - Created vertexes are scaled by this vectorjava.lang.NullPointerException - If isLoaded() is falsepublic com.jme3.math.Vector2f getUV(int x,
int y,
com.jme3.math.Vector2f store)
public com.jme3.math.Vector2f getUV(int i,
com.jme3.math.Vector2f store)
public java.nio.FloatBuffer writeTexCoordArray(java.nio.FloatBuffer store,
com.jme3.math.Vector2f offset,
com.jme3.math.Vector2f scale)
public java.nio.IntBuffer writeIndexArray(java.nio.IntBuffer store)
public com.jme3.scene.Mesh createMesh(com.jme3.math.Vector3f scale,
com.jme3.math.Vector2f tcScale,
boolean center)
public void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savablejava.io.IOExceptionpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savablejava.io.IOException