de.rico.engine.geometry
Class Terrain

java.lang.Object
  extended by de.rico.engine.geometry.AbstractMesh
      extended by de.rico.engine.geometry.MeshDL
          extended by de.rico.engine.geometry.AbstractGroundMesh
              extended by de.rico.engine.geometry.Terrain

public class Terrain
extends AbstractGroundMesh

This class represents a world's terrain, that is generated from a height map file.

Author:
Frank Bruns

Constructor Summary
Terrain(java.lang.String pathHeightMap, java.lang.String texPath, int resFactor, boolean smooth)
          Creates a new height map of the specified file with the specified height map rendering resolution factor.
Terrain(java.lang.String pathHeightMap, java.lang.String texPath, int resFactor, boolean smooth, BoundingVolume type)
          Creates a new height map of the specified file with the specified height map rendering resolution factor.
 
Method Summary
 java.lang.String getFilePath()
          Returns the file path of the heightmap file used.
 int getResolution()
          Returns the resolution factor of the terrain.
 
Methods inherited from class de.rico.engine.geometry.AbstractGroundMesh
getLength, getSearchGrid, getWidth, initSearchGrid
 
Methods inherited from class de.rico.engine.geometry.MeshDL
addFace, destroy, draw, finishModel, getDisplayListId, getFaces, getFacesTransformed, specializedDraw, update
 
Methods inherited from class de.rico.engine.geometry.AbstractMesh
addShader, drawShaders, getBoundingVolume, getHeightOffset, getMaterial, getMouseOverMesh, getName, getPosition, getPosX, getPosY, getPosZ, getRotation, getRotX, getRotY, getRotZ, getScaleX, getScaleY, getScaleZ, getTex0Path, getTex1Path, getText0XMovement, getText0YMovement, getText1XMovement, getText1YMovement, getTexUnit0, getTexUnit1, isCollidable, isDrawingEnabled, isEnabledOcclusionCulling, isMouseOverMesh, isOccluded, isPickable, isShadowEnabled, isSmoothShaded, isTex0Flipped, isTex0MipMapped, isTex0Rotated, isTex1Flipped, isTex1MipMapped, isTex1Rotated, moveBackwardsGlobal, moveBackwardsLocal, moveDownGlobal, moveForwardGlobal, moveForwardLocal, moveLeftGlobal, moveLeftLocal, moveRightGlobal, moveRightLocal, moveTo, moveUpGlobal, performTransformations, rotateDown, rotateLeft, rotateRight, rotateUp, scale, setAttachedGround, setBlendDestFactor, setBlendFunction, setBlendSourceFactor, setCollidable, setDrawingEnabled, setEnabledOcclusionCulling, setEnvironmentMap, setMaterial, setName, setPickable, setPosition, setPosition, setPosX, setPosY, setPosZ, setRotation, setRotation, setRotX, setRotY, setRotZ, setScaleX, setScaleY, setScaleZ, setShadowEnabled, setShowBoundingVolume, setTex0Movement, setTex0TexEnvirMode, setTex0XMovement, setTex0YMovement, setTex1Movement, setTex1TexEnvirMode, setTex1XMovement, setTex1YMovement, setTexUnit0, setTexUnit0, setTexUnit1, setTexUnit1, setTransparency, showWireFrame, translateX, translateY, translateZ
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Terrain

public Terrain(java.lang.String pathHeightMap,
               java.lang.String texPath,
               int resFactor,
               boolean smooth)
Creates a new height map of the specified file with the specified height map rendering resolution factor. The smaller the value for the resolution factor, the more precisely the height map image is being processed, resulting in a terrain with more triangles, i.e. a smoother look.
Note: Please only use image files with a power of 2 resolution and confirm that image height and width are both equal.

Parameters:
pathHeightMap - path to file that contains the height map data
texPath - path to texture that shall be mapped onto the terrain
resFactor - height map rendering resolution factor
smooth - calculate smooth normals? true=yes, false=no

Terrain

public Terrain(java.lang.String pathHeightMap,
               java.lang.String texPath,
               int resFactor,
               boolean smooth,
               BoundingVolume type)
Creates a new height map of the specified file with the specified height map rendering resolution factor. The smaller the value for the resolution factor, the more precisely the height map image is being processed, resulting in a terrain with more triangles, i.e. a smoother look.
Note: Please only use image files with a power of 2 resolution and confirm that image height and width are both equal.

Parameters:
pathHeightMap - path to file that contains the height map data
texPath - path to texture that shall be mapped onto the terrain
resFactor - height map rendering resolution factor
smooth - calculate smooth normals? true=yes, false=no
type - value from the BoundingVolume enumertion
Method Detail

getFilePath

public java.lang.String getFilePath()
Returns the file path of the heightmap file used. This is usually important for the editor.

Returns:
file path of the model file

getResolution

public int getResolution()
Returns the resolution factor of the terrain. This factor is equal to the lenght of triangle edges in the terrain mesh.

Returns:
terrain resolution factor