env3d.advanced
Class EnvTerrain

java.lang.Object
  extended by env3d.GameObjectAdapter
      extended by env3d.advanced.EnvAbstractNode
          extended by env3d.advanced.EnvTerrain

public class EnvTerrain
extends EnvAbstractNode


Field Summary
protected  com.jme3.material.Material mat_terrain
           
protected  com.jme3.material.Material mat_terrainLighting
           
protected  com.jme3.terrain.geomipmap.TerrainQuad terrain
           
 
Fields inherited from class env3d.advanced.EnvAbstractNode
rotateX, rotateY, rotateZ, scale
 
Fields inherited from class env3d.GameObjectAdapter
assetManager, currentAction, currentModel, currentTexture, internalObject, jme_node, lighting, locator, mat, mat_lit, objectCache, q, qX, qY, qZ
 
Constructor Summary
EnvTerrain(double[] heightMap)
           
EnvTerrain(java.lang.String imageFile)
           
 
Method Summary
 java.lang.String getAlphaMapFile()
           
 float getHeight(double x, double z)
          Returns the height of a particular point of the terrain
 java.lang.String getHeightMapFile()
           
 com.jme3.math.Vector3f getNormal(double x, double z)
          Returns the normal vector for a point on the terrain
 com.jme3.terrain.geomipmap.TerrainQuad getTerrainQuad()
           
 java.lang.String getTexture()
           
 java.lang.String getTextureB()
           
 java.lang.String getTextureG()
           
 void setScale(double x, double y, double z)
           
 void setTexture(java.lang.String texture)
           
 void setTexture(java.lang.String texture, int channel)
          Sets the texture channel for splat texture on this terrain.
 void setTextureAlpha(java.lang.String texture)
           
 void updateHeightMap(java.lang.String imageFile)
           
 void useLightingMaterial(boolean lighting)
           
 
Methods inherited from class env3d.advanced.EnvAbstractNode
attach, getRotateX, getRotateY, getRotateZ, getScale, getX, getY, getZ, remove, setRotateX, setRotateY, setRotateZ, setScale, setX, setY, setZ, update, updateRotation
 
Methods inherited from class env3d.GameObjectAdapter
drawSquare, drawSquare, getFieldFromObject, getJme_node, registerLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mat_terrain

protected com.jme3.material.Material mat_terrain

mat_terrainLighting

protected com.jme3.material.Material mat_terrainLighting

terrain

protected com.jme3.terrain.geomipmap.TerrainQuad terrain
Constructor Detail

EnvTerrain

public EnvTerrain(double[] heightMap)

EnvTerrain

public EnvTerrain(java.lang.String imageFile)
Method Detail

updateHeightMap

public void updateHeightMap(java.lang.String imageFile)

setTexture

public void setTexture(java.lang.String texture)

setTextureAlpha

public void setTextureAlpha(java.lang.String texture)

setTexture

public void setTexture(java.lang.String texture,
                       int channel)
Sets the texture channel for splat texture on this terrain.

Parameters:
texture -
channel - 1 is red, 2 is blue, 3 is green

setScale

public void setScale(double x,
                     double y,
                     double z)

getHeight

public float getHeight(double x,
                       double z)
Returns the height of a particular point of the terrain

Parameters:
x -
z -
Returns:

getNormal

public com.jme3.math.Vector3f getNormal(double x,
                                        double z)
Returns the normal vector for a point on the terrain

Returns:

useLightingMaterial

public void useLightingMaterial(boolean lighting)
Overrides:
useLightingMaterial in class GameObjectAdapter

getHeightMapFile

public java.lang.String getHeightMapFile()
Returns:
the heightMapFile

getAlphaMapFile

public java.lang.String getAlphaMapFile()

getTexture

public java.lang.String getTexture()
Returns:
the texture

getTextureB

public java.lang.String getTextureB()

getTextureG

public java.lang.String getTextureG()

getTerrainQuad

public com.jme3.terrain.geomipmap.TerrainQuad getTerrainQuad()