enum SortOrder
{
- FRONT_TO_BACK,
- BACK_TO_FRONT
+ FRONT_TO_BACK = 0,
+ BACK_TO_FRONT = 1
};
enum DepthReference
{
- CLOSEST,
- CENTER,
- FURTHEST
+ CLOSEST = 0,
+ CENTER = 1,
+ FURTHEST = 2
};
/**
-Sorts renderables by their distance from the camera before rendering. Requires
-renderables to have a matrix.
+A scene which sorts renderables by their distance from the camera before
+rendering.
+
+Renderables must have valid model matrices to be sorted. Those without a
+matrix are sorted as closest to the camera.
*/
class ZSortedScene: public Scene
{
bool operator<(const SortedRenderable &o) const { return depth<o.depth; }
};
- std::set<Renderable *> renderables;
+ std::vector<Renderable *> content;
SortOrder order = BACK_TO_FRONT;
DepthReference reference = FURTHEST;
mutable std::vector<SortedRenderable> sorted_cache;