org.xith3d.terrain
Class HeightMapSampler
java.lang.Object
org.xith3d.terrain.HeightMapSampler
- All Implemented Interfaces:
- GridResource, GridSampler
public class HeightMapSampler
- extends java.lang.Object
- implements GridSampler
|
Field Summary |
float[][] |
map
|
|
Method Summary |
void |
release()
|
org.openmali.vecmath2.Vector3f |
sampleBinormal(float s,
float t)
Samples a binormal vector from the grid |
float |
sampleHeight(float x,
float z)
Samples a height value from the grid |
org.openmali.vecmath2.Vector3f |
sampleNormal(float s,
float t)
Samples a normal vector from the grid |
org.openmali.vecmath2.Vector3f |
sampleTangent(float s,
float t)
Samples a tangent vector from the grid |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
map
public float[][] map
HeightMapSampler
public HeightMapSampler(java.net.URL resource)
throws java.io.IOException
- Throws:
java.io.IOException
HeightMapSampler
public HeightMapSampler(java.net.URL resource,
int xDim,
int zDim)
throws java.io.IOException
- Throws:
java.io.IOException
HeightMapSampler
public HeightMapSampler(java.net.URL resource,
int xDim,
int zDim,
HeightMapSampler.Type type)
throws java.io.IOException
- Throws:
java.io.IOException
HeightMapSampler
public HeightMapSampler(GridResourceSpec<GridSampler> spec)
throws java.io.IOException
- Throws:
java.io.IOException
release
public void release()
- Specified by:
release in interface GridResource- Specified by:
release in interface GridSampler
sampleHeight
public float sampleHeight(float x,
float z)
- Description copied from interface:
GridSampler
- Samples a height value from the grid
- Specified by:
sampleHeight in interface GridSampler
- Parameters:
x - the "longitude" coordinate of the gridz - the "latitude" coordinate of the grid
- Returns:
- a height value for the given [s,t] coordinate
sampleBinormal
public org.openmali.vecmath2.Vector3f sampleBinormal(float s,
float t)
- Description copied from interface:
GridSampler
- Samples a binormal vector from the grid
- Specified by:
sampleBinormal in interface GridSampler
- Parameters:
s - the "longitude" coordinate of the gridt - the "latitude" coordinate of the grid
- Returns:
- a binormal vector for the given [s,t] coordinate
sampleNormal
public org.openmali.vecmath2.Vector3f sampleNormal(float s,
float t)
- Description copied from interface:
GridSampler
- Samples a normal vector from the grid
- Specified by:
sampleNormal in interface GridSampler
- Parameters:
s - the "longitude" coordinate of the gridt - the "latitude" coordinate of the grid
- Returns:
- a normal vector for the given [s,t] coordinate
sampleTangent
public org.openmali.vecmath2.Vector3f sampleTangent(float s,
float t)
- Description copied from interface:
GridSampler
- Samples a tangent vector from the grid
- Specified by:
sampleTangent in interface GridSampler
- Parameters:
s - the "longitude" coordinate of the gridt - the "latitude" coordinate of the grid
- Returns:
- a tangent vector for the given [s,t] coordinate