org.xith3d.terrain
Interface GridResourceProvider

All Known Implementing Classes:
DefaultGridResourceProvider, L3DTResourceProvider, SimpleGridResourceProvider

public interface GridResourceProvider

A GridProvider is used in conjunction with the LOD enabled terrain subsystem to provide GridSampler and GridSurface instances of specific subareas of the grid. To enable effective LOD rendering of large scale landscapes,a grids surface needs to be divided into tiles with surfaces of different detail, so the provider has a findSampler and findSurface method that returns such tiles and constructs them on the fly if needed. The value of the detail argument has no strict meaning other than a value of 0 requests the most detailed resolution. Higher numbers are for less detailed data resolutions.

Since:
1.0

Method Summary
 GridSampler findSampler(float s1, float t1, float s2, float t2, int detail)
          Will be called by the terrain subsystem to retrieve a sampler, that holds the data for the area sampled next.
 GridSurface findSurface(float s1, float t1, float s2, float t2, int detail)
          Will be called by the terrain subsystem to retrieve a surface of the specfied detail level.
 void releaseSampler(GridSampler sampler)
           
 void releaseSurface(GridSurface surface)
           
 

Method Detail

findSampler

GridSampler findSampler(float s1,
                        float t1,
                        float s2,
                        float t2,
                        int detail)
Will be called by the terrain subsystem to retrieve a sampler, that holds the data for the area sampled next.

Parameters:
s1 - the "longitude" corner coordinate of the grid tile sampled next.
t1 - the "latitude" corner coordinate of the grid tile sampled next.
s2 - the opposite corners "longitude" coordinate of the grid tile sampled next.
t2 - the opposite corners "latitude" coordinate of the grid tile sampled next.
detail - the detail level of the grid tile sampled next. If '-1' the best already initialized sampler is returned.
Returns:
a GridSampler implementation to provide the height and local coordinate values

releaseSampler

void releaseSampler(GridSampler sampler)

findSurface

GridSurface findSurface(float s1,
                        float t1,
                        float s2,
                        float t2,
                        int detail)
Will be called by the terrain subsystem to retrieve a surface of the specfied detail level.

Parameters:
s1 - the "longitude" corner coordinate of the grid tile sampled next.
t1 - the "latitude" corner coordinate of the grid tile sampled next.
s2 - the opposite corners "longitude" coordinate of the grid tile sampled next.
t2 - the opposite corners "latitude" coordinate of the grid tile sampled next.
detail - the detail level of the grid tile textured next. If '-1' the best already initialized surface is returned.
Returns:
a GridSurface implementation that provides the appearance texture coordinate infos.

releaseSurface

void releaseSurface(GridSurface surface)