A Task to draw a terrain. More...
Public Member Functions | |
Impl (ptr< SceneNode > n, ptr< TerrainNode > t, ptr< MeshBuffers > m, bool culling) | |
Creates a new Impl. | |
virtual | ~Impl () |
Deletes this Impl. | |
void | findDrawableQuads (ptr< TerrainQuad > q, const vector< ptr< TileSampler > > &uniforms) |
Finds the quads whose associated tiles are ready (this may not be the case of all quads if async is true). | |
void | drawQuad (ptr< TerrainQuad > q, const vector< ptr< TileSampler > > &uniforms) |
Draw the mesh m for the leaf quads of the given quadtree. | |
Public Attributes | |
ptr< SceneNode > | n |
The SceneNode describing the terrain position and its associated data (via TileSampler fields). | |
ptr< TerrainNode > | t |
The TerrainNode describing the terrain and its quadtree. | |
ptr< MeshBuffers > | m |
The mesh to be drawn for each leaf quad. | |
bool | culling |
True to draw only visible leaf quads, false to draw all leaf quads. | |
bool | async |
True if one the TileSampler associated with this terrain uses the asynchronous mode. | |
int | gridSize |
Number of primitives (triangles, lines, etc) per *quarter* of the grid mesh. |
A Task to draw a terrain.
proland::DrawTerrainTask::Impl::Impl | ( | ptr< SceneNode > | n, | |
ptr< TerrainNode > | t, | |||
ptr< MeshBuffers > | m, | |||
bool | culling | |||
) |
Creates a new Impl.
n | the SceneNode describing the terrain position. | |
t | the TerrainNode describing the terrain and its quadtree. | |
m | the mesh to be drawn for each leaf quad. | |
culling | true to draw only visible leaf quads. |
virtual proland::DrawTerrainTask::Impl::~Impl | ( | ) | [virtual] |
Deletes this Impl.
void proland::DrawTerrainTask::Impl::drawQuad | ( | ptr< TerrainQuad > | q, | |
const vector< ptr< TileSampler > > & | uniforms | |||
) |
Draw the mesh m for the leaf quads of the given quadtree.
Before drawing each quad, this method calls Deformation::setUniforms for this quad, and calls TileSampler::setTile on each TileSampler the given uniforms vector.
q | the terrain quadtree to be drawn. | |
uniforms | the TileSampler associated with the terrain. |
void proland::DrawTerrainTask::Impl::findDrawableQuads | ( | ptr< TerrainQuad > | q, | |
const vector< ptr< TileSampler > > & | uniforms | |||
) |
Finds the quads whose associated tiles are ready (this may not be the case of all quads if async is true).
q | the terrain quadtree to be drawn. | |
uniforms | the TileSampler associated with the terrain. |
True if one the TileSampler associated with this terrain uses the asynchronous mode.
True to draw only visible leaf quads, false to draw all leaf quads.
Number of primitives (triangles, lines, etc) per *quarter* of the grid mesh.
Used to draw only parts of the mesh to fill holes when using asynchronous mode.
ptr<MeshBuffers> proland::DrawTerrainTask::Impl::m |
The mesh to be drawn for each leaf quad.
ptr<SceneNode> proland::DrawTerrainTask::Impl::n |
The SceneNode describing the terrain position and its associated data (via TileSampler fields).
The TerrainNode describing the terrain and its quadtree.