1 #ifndef MSP_GL_ZSORTEDSCENE_H_
2 #define MSP_GL_ZSORTEDSCENE_H_
4 #include "simplescene.h"
23 Sorts renderables by their distance from the camera before rendering. Requires
24 renderables to have a matrix.
26 class ZSortedScene: public SimpleScene
29 struct DepthRenderable
32 const Renderable *renderable;
34 DepthRenderable(float, const Renderable *);
36 bool operator<(const DepthRenderable &o) const { return depth<o.depth; }
40 DepthReference reference;
45 /// Sets the sort order. Default is back to front.
46 void set_order(SortOrder);
48 /// Sets the reference point for sorting. Default is furthest from camera.
49 void set_reference(DepthReference);
51 virtual void render(Renderer &, const Tag &) const;