public class LODGeomap extends GeoMap
| Modifier and Type | Class and Description |
|---|---|
class |
LODGeomap.VerboseBuffer
Keeps a count of the number of indexes, good for debugging
|
| Constructor and Description |
|---|
LODGeomap() |
LODGeomap(int size,
float[] heightMap) |
| Modifier and Type | Method and Description |
|---|---|
static com.jme3.math.Vector3f |
calculateTangent(com.jme3.math.Vector3f[] v,
com.jme3.math.Vector2f[] t,
com.jme3.math.Vector3f tangent,
com.jme3.math.Vector3f binormal) |
com.jme3.scene.Mesh |
createMesh(com.jme3.math.Vector3f scale,
com.jme3.math.Vector2f tcScale,
com.jme3.math.Vector2f tcOffset,
float offsetAmount,
int totalSize,
boolean center) |
com.jme3.scene.Mesh |
createMesh(com.jme3.math.Vector3f scale,
com.jme3.math.Vector2f tcScale,
com.jme3.math.Vector2f tcOffset,
float offsetAmount,
int totalSize,
boolean center,
int lod,
boolean rightLod,
boolean topLod,
boolean leftLod,
boolean bottomLod) |
protected int |
findClosestHeightIndex(int x,
int z) |
protected com.jme3.math.Triangle[] |
getGridTrianglesAtPoint(float x,
float z)
Get the two triangles that make up the grid section at the specified point.
|
protected com.jme3.math.Triangle[] |
getGridTrianglesAtPoint(float x,
float z,
com.jme3.math.Vector3f scale,
com.jme3.math.Vector3f translation)
Get the two triangles that make up the grid section at the specified point,
translated to world coordinates.
|
protected float |
getHeight(int x,
int z,
float xm,
float zm)
Get the two triangles that make up the grid section at the specified point.
|
protected com.jme3.math.Triangle |
getTriangleAtPoint(float x,
float z)
Get the triangle that the point is on.
|
protected com.jme3.math.Triangle |
getTriangleAtPoint(float x,
float z,
com.jme3.math.Vector3f scale,
com.jme3.math.Vector3f translation)
Get a representation of the underlying triangle at the given point,
translated to world coordinates.
|
com.jme3.math.Vector2f |
getUV(int x,
int y,
com.jme3.math.Vector2f store,
com.jme3.math.Vector2f offset,
float offsetAmount,
int totalSize) |
void |
read(com.jme3.export.JmeImporter im) |
void |
write(com.jme3.export.JmeExporter ex) |
com.jme3.scene.mesh.IndexBuffer |
writeIndexArrayLodDiff(int lod,
boolean rightLod,
boolean topLod,
boolean leftLod,
boolean bottomLod,
int totalSize)
Create the LOD index array that will seam its edges with its neighbour's LOD.
|
com.jme3.scene.mesh.IndexBuffer |
writeIndexArrayLodVariable(int lod,
int rightLod,
int topLod,
int leftLod,
int bottomLod,
int totalSize) |
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[] |
writeTangentArray(java.nio.FloatBuffer normalBuffer,
java.nio.FloatBuffer tangentStore,
java.nio.FloatBuffer binormalStore,
java.nio.FloatBuffer textureBuffer,
com.jme3.math.Vector3f scale) |
java.nio.FloatBuffer |
writeTexCoordArray(java.nio.FloatBuffer store,
com.jme3.math.Vector2f offset,
com.jme3.math.Vector2f scale,
float offsetAmount,
int totalSize) |
createMesh, getHeight, getHeightArray, getMaximumValue, getUV, getUV, getValue, getValue, getWidth, isLoaded, writeIndexArray, writeTexCoordArray, writeVertexArraypublic LODGeomap()
public LODGeomap(int size,
float[] heightMap)
public com.jme3.scene.Mesh createMesh(com.jme3.math.Vector3f scale,
com.jme3.math.Vector2f tcScale,
com.jme3.math.Vector2f tcOffset,
float offsetAmount,
int totalSize,
boolean center)
public com.jme3.scene.Mesh createMesh(com.jme3.math.Vector3f scale,
com.jme3.math.Vector2f tcScale,
com.jme3.math.Vector2f tcOffset,
float offsetAmount,
int totalSize,
boolean center,
int lod,
boolean rightLod,
boolean topLod,
boolean leftLod,
boolean bottomLod)
public java.nio.FloatBuffer writeTexCoordArray(java.nio.FloatBuffer store,
com.jme3.math.Vector2f offset,
com.jme3.math.Vector2f scale,
float offsetAmount,
int totalSize)
public com.jme3.math.Vector2f getUV(int x,
int y,
com.jme3.math.Vector2f store,
com.jme3.math.Vector2f offset,
float offsetAmount,
int totalSize)
public com.jme3.scene.mesh.IndexBuffer writeIndexArrayLodDiff(int lod,
boolean rightLod,
boolean topLod,
boolean leftLod,
boolean bottomLod,
int totalSize)
store - to store the index bufferlod - level of detail of the meshrightLod - LOD of the right neighbourtopLod - LOD of the top neighbourleftLod - LOD of the left neighbourbottomLod - LOD of the bottom neighbourpublic com.jme3.scene.mesh.IndexBuffer writeIndexArrayLodVariable(int lod,
int rightLod,
int topLod,
int leftLod,
int bottomLod,
int totalSize)
public java.nio.FloatBuffer[] writeTangentArray(java.nio.FloatBuffer normalBuffer,
java.nio.FloatBuffer tangentStore,
java.nio.FloatBuffer binormalStore,
java.nio.FloatBuffer textureBuffer,
com.jme3.math.Vector3f scale)
public static com.jme3.math.Vector3f calculateTangent(com.jme3.math.Vector3f[] v,
com.jme3.math.Vector2f[] t,
com.jme3.math.Vector3f tangent,
com.jme3.math.Vector3f binormal)
v - Takes 3 vertices: root, right, bottomt - Takes 3 tex coords: root, right, bottomtangent - that will store the resultpublic java.nio.FloatBuffer writeNormalArray(java.nio.FloatBuffer store,
com.jme3.math.Vector3f scale)
GeoMapwriteNormalArray in class GeoMapstore - A preallocated FloatBuffer where to store the data (optional), size must be >= getWidth()*getHeight()*3protected float getHeight(int x,
int z,
float xm,
float zm)
protected com.jme3.math.Triangle getTriangleAtPoint(float x,
float z,
com.jme3.math.Vector3f scale,
com.jme3.math.Vector3f translation)
x - local x coordinatez - local z coordinateprotected com.jme3.math.Triangle[] getGridTrianglesAtPoint(float x,
float z,
com.jme3.math.Vector3f scale,
com.jme3.math.Vector3f translation)
x - local x coordinatez - local z coordinatescale - translation - protected com.jme3.math.Triangle[] getGridTrianglesAtPoint(float x,
float z)
x - local x coordinatez - local z coordinateprotected com.jme3.math.Triangle getTriangleAtPoint(float x,
float z)
x - coordinate in local space to the geomapz - coordinate in local space to the geomapprotected int findClosestHeightIndex(int x,
int z)
public void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException