org.odejava
Class GeomTerrain

java.lang.Object
  extended by org.odejava.Geom
      extended by org.odejava.GeomTerrain

public class GeomTerrain
extends Geom

Terrain is an infinite ground based on a height map. It is an contrib module. Contributed by Benoit Chaperot, www.jstarlab.com This module is currently disabled. Drawing related routines made by William Denniss, these routines are under development. Created 16.12.2003 (dd.mm.yyyy)

Author:
Jani Laakso E-mail: jani.laakso@itmill.com, William Denniss see http://odejava.dev.java.net

Field Summary
 
Fields inherited from class org.odejava.Geom
geomId, isEncapsulated, spaceId
 
Constructor Summary
GeomTerrain(float[] pHeights, float vLength, int numNodesPerSide)
           
GeomTerrain(String name, float[] pHeights, float vLength, int numNodesPerSide)
          Create terrain geometry to specific space.
 
Method Summary
static org.openmali.vecmath2.Point3f[] dsDrawTerrain(float x, float y, float vLength, float vNodeLength, int nNumNodesPerSide, float[] pHeights)
          Returns a coordinate array representing this terrain object.
 org.openmali.vecmath2.Point3f[] getGeometry()
           
 org.openmali.vecmath2.Point3f[] getGeometry(float x, float y, float vLength)
           
 int getNumNodesPerSide()
           
 float[] getPHeights()
           
 float getVLength()
           
 
Methods inherited from class org.odejava.Geom
addToSpace, delete, finalize, getGeomFromNativeAddr, getId, getID, getName, getNativeAddr, getUserData, isEnabled, removeFromSpace, setCategoryBits, setCollideBits, setEnabled, setName, setUserData, updateNativeAddr
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeomTerrain

public GeomTerrain(String name,
                   float[] pHeights,
                   float vLength,
                   int numNodesPerSide)
Create terrain geometry to specific space. Terrain is unmovable. This module is currently disabled.

Parameters:
name -
pHeights -
vLength -
numNodesPerSide -

GeomTerrain

public GeomTerrain(float[] pHeights,
                   float vLength,
                   int numNodesPerSide)
Method Detail

getNumNodesPerSide

public int getNumNodesPerSide()
Returns:
Returns the numNodesPerSide.

getPHeights

public float[] getPHeights()
Returns:
Returns the pHeights.

getVLength

public float getVLength()
Returns:
Returns the vLength.

getGeometry

public org.openmali.vecmath2.Point3f[] getGeometry()

getGeometry

public org.openmali.vecmath2.Point3f[] getGeometry(float x,
                                                   float y,
                                                   float vLength)

dsDrawTerrain

public static org.openmali.vecmath2.Point3f[] dsDrawTerrain(float x,
                                                            float y,
                                                            float vLength,
                                                            float vNodeLength,
                                                            int nNumNodesPerSide,
                                                            float[] pHeights)
Returns a coordinate array representing this terrain object. This can then be used to generate geometry for example using Xith3D. The geometry is not indexed.

Parameters:
x - Amount which the terrain will be offset along the x axis
y - Amount which the terrain will be offset along the y axis
vLength - Offset multiplier (the x and y offset is multiplied by this amount), if in doubt set to 1
vNodeLength - distance between each vertex
nNumNodesPerSide - number of vertexes per side
pHeights - heightmap array. The length of this array must be equal to nNumNodesPerSide squared
Returns:
a coordinate array representing this terrain object