![]() |
LibCarna Version 3.4.0
|
Gathers renderable geometry nodes from scene graph and provides those in a particular order, if required. More...
#include <RenderQueue.hpp>
Public Member Functions | |
RenderQueue (unsigned int geometryType, unsigned int geometryTypeMask=EXACT_MATCH_GEOMETRY_TYPE_MASK) | |
Creates new instance that enqueues Geometry scene graph nodes if their geometry type AND-linked with geometryTypeMask equals the geometryType of this RenderQueue instance. | |
void | build (const Node &root, const math::Matrix4f &viewTransform) |
Rebuilds this queue by gathering matching geometry nodes from children of root recursively. The argument viewTransform is required for the computation of the model-view matrix. | |
void | rewind () |
Rewinds this queue. This is an \(\mathcal O\left(1\right)\) operation in contrast to build, so prefer it whenever possible. You might also need to updateModelViewTransforms if you use this. | |
void | updateModelViewTransforms (const math::Matrix4f &viewTransform) |
Recomputes the model-view transforms of all enqueued renderables. This only is neccessary in certain cases when you have rewinded this queue previously. Also recomputes the elements order of this queue if necessary. | |
bool | isEmpty () const |
Tells whether this queue has reached it's end. | |
const Renderable & | poll () |
References the next element of the queue and moves ahead. The referenced object stays alive until the queue is deleted or rebuilt. | |
const Renderable & | first () const |
References the next element of the queue, but does not move ahead. The referenced object stays alive until the queue is deleted or rebuilt. | |
const Renderable & | last () const |
References the last element of the queue. The referenced object stays alive until the queue is deleted or rebuilt. | |
Public Attributes | |
const unsigned int | geometryType |
Holds the geometry type that this queue uses for matching geometry nodes. | |
const unsigned int | geometryTypeMask |
Holds the mask that this queue uses for matching geometry nodes. | |
Static Public Attributes | |
static const unsigned int | EXACT_MATCH_GEOMETRY_TYPE_MASK = std::numeric_limits< unsigned int >::max() |
Holds the mask that makes this queue only accept such geometry nodes whose geometry type matches the geometry type of this queue exactly. | |
Gathers renderable geometry nodes from scene graph and provides those in a particular order, if required.
RenderableCompare | Binary function that establishes partial order on Renderable objects. Typical choices are Renderable::BackToFront, Renderable::FrontToBack or Renderable::VideoResourcesOrder. Use void if no particular order is required. |
The geometry nodes are only enqueued if their geometry type matches. The matching is done as follows. First a bit-wise AND operation is applied to the node's geometry type and the mask of this RenderQueue
instance. Than the result from this operation is compared to the geometryType of this instance. Only if they match, the Geometry
node is enqueued.
Definition at line 66 of file RenderQueue.hpp.
LibCarna::base::RenderQueue< RenderableCompare >::RenderQueue | ( | unsigned int | geometryType, |
unsigned int | geometryTypeMask = EXACT_MATCH_GEOMETRY_TYPE_MASK |
||
) |
Creates new instance that enqueues Geometry scene graph nodes if their geometry type AND-linked with geometryTypeMask equals the geometryType of this RenderQueue
instance.
Definition at line 158 of file RenderQueue.hpp.
void LibCarna::base::RenderQueue< RenderableCompare >::build | ( | const Node & | root, |
const math::Matrix4f & | viewTransform | ||
) |
Rebuilds this queue by gathering matching geometry nodes from children of root recursively. The argument viewTransform is required for the computation of the model-view matrix.
Definition at line 188 of file RenderQueue.hpp.
const Renderable & LibCarna::base::RenderQueue< RenderableCompare >::first | ( | ) | const |
References the next element of the queue, but does not move ahead. The referenced object stays alive until the queue is deleted or rebuilt.
isEmpty() == false
Definition at line 253 of file RenderQueue.hpp.
bool LibCarna::base::RenderQueue< RenderableCompare >::isEmpty | ( | ) | const |
Tells whether this queue has reached it's end.
Definition at line 238 of file RenderQueue.hpp.
const Renderable & LibCarna::base::RenderQueue< RenderableCompare >::last | ( | ) | const |
References the last element of the queue. The referenced object stays alive until the queue is deleted or rebuilt.
isEmpty() == false
Definition at line 261 of file RenderQueue.hpp.
const Renderable & LibCarna::base::RenderQueue< RenderableCompare >::poll | ( | ) |
References the next element of the queue and moves ahead. The referenced object stays alive until the queue is deleted or rebuilt.
isEmpty() == false
Definition at line 245 of file RenderQueue.hpp.
void LibCarna::base::RenderQueue< RenderableCompare >::rewind | ( | ) |
Rewinds this queue. This is an \(\mathcal O\left(1\right)\) operation in contrast to build, so prefer it whenever possible. You might also need to updateModelViewTransforms if you use this.
Definition at line 213 of file RenderQueue.hpp.
void LibCarna::base::RenderQueue< RenderableCompare >::updateModelViewTransforms | ( | const math::Matrix4f & | viewTransform | ) |
Recomputes the model-view transforms of all enqueued renderables. This only is neccessary in certain cases when you have rewinded this queue previously. Also recomputes the elements order of this queue if necessary.
Definition at line 220 of file RenderQueue.hpp.
|
static |
Holds the mask that makes this queue only accept such geometry nodes whose geometry type matches the geometry type of this queue exactly.
Definition at line 90 of file RenderQueue.hpp.
const unsigned int LibCarna::base::RenderQueue< RenderableCompare >::geometryType |
Holds the geometry type that this queue uses for matching geometry nodes.
Definition at line 79 of file RenderQueue.hpp.
const unsigned int LibCarna::base::RenderQueue< RenderableCompare >::geometryTypeMask |
Holds the mask that this queue uses for matching geometry nodes.
Definition at line 84 of file RenderQueue.hpp.
Written by Leonid Kostrykin © 2021–2025. Based on Carna (© 2010-2016).
Documentation generated by Doxygen