org.xith3d.terrain
Interface GridSampler

All Superinterfaces:
GridResource
All Known Implementing Classes:
HeightMapSampler

public interface GridSampler
extends GridResource

A GridSampler is used to retrieve height values from a regular grid. A grid is defined as rectangular area with coordinates [s,t] ranging from [0,0] to [1,1]. The values stored in the grid range from 0 to 1. The GridSampler is normally used by a triangulator, that generates the triangle representation of the grid. To enable effective data storage for LOD rendering of large scale landscapes, the prepare() method accept a detail argument specifying the needed resolution for the triangulation. The values of the detail argument have no strict meaning other than a value of 0 requests the most detailed resolution, the GridSampler implementation has to offer. Higher numbers are for less detailed data resolutions. A detail-level of 0 requests the lowest available resolution. Typically (depends on the overall setup) a detail-level of 2 requests the highest available resolution.

Since:
1.0

Method Summary
 void release()
           
 org.openmali.vecmath2.Vector3f sampleBinormal(float s, float t)
          Samples a binormal vector from the grid
 float sampleHeight(float s, float t)
          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
 

Method Detail

sampleHeight

float sampleHeight(float s,
                   float t)
Samples a height value from the grid

Parameters:
s - the "longitude" coordinate of the grid
t - the "latitude" coordinate of the grid
Returns:
a height value for the given [s,t] coordinate

sampleNormal

org.openmali.vecmath2.Vector3f sampleNormal(float s,
                                            float t)
Samples a normal vector from the grid

Parameters:
s - the "longitude" coordinate of the grid
t - the "latitude" coordinate of the grid
Returns:
a normal vector for the given [s,t] coordinate

sampleTangent

org.openmali.vecmath2.Vector3f sampleTangent(float s,
                                             float t)
Samples a tangent vector from the grid

Parameters:
s - the "longitude" coordinate of the grid
t - the "latitude" coordinate of the grid
Returns:
a tangent vector for the given [s,t] coordinate

sampleBinormal

org.openmali.vecmath2.Vector3f sampleBinormal(float s,
                                              float t)
Samples a binormal vector from the grid

Parameters:
s - the "longitude" coordinate of the grid
t - the "latitude" coordinate of the grid
Returns:
a binormal vector for the given [s,t] coordinate

release

void release()
Specified by:
release in interface GridResource