Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
DepthSortCallback sorts the primitives of the Geometry bound to the Actor in which the callback is installed. More...
#include <DepthSortCallback.hpp>
Classes | |
class | Line |
class | Point |
class | PrimitiveZ |
class | Quad |
class | Sorter_Back_To_Front |
class | Sorter_Front_To_Back |
class | Triangle |
Public Member Functions | |
DepthSortCallback () | |
Constructor. | |
void | onActorDelete (Actor *) |
Event notifying that an Actor is being deleted. | |
virtual void | onActorRenderStarted (Actor *actor, real, const Camera *cam, Renderable *renderable, const Shader *, int pass) |
Performs the actual sorting. | |
template<typename T , typename deT > | |
void | sort (deT *polys, std::vector< Point< T > > &sorted_points, std::vector< Line< T > > &sorted_lines, std::vector< Triangle< T > > &sorted_triangles, std::vector< Quad< T > > &sorted_quads) |
ESortMode | sortMode () const |
void | setSortMode (ESortMode sort_mode) |
void | invalidateCache () |
Forces sorting at the next rendering. | |
Protected Attributes | |
std::vector< vec3 > | mEyeSpaceVerts |
std::vector< PrimitiveZ > | mPrimitiveZ |
std::vector< PointUInt > | mSortedPointsUInt |
std::vector< LineUInt > | mSortedLinesUInt |
std::vector< TriangleUInt > | mSortedTrianglesUInt |
std::vector< QuadUInt > | mSortedQuadsUInt |
std::vector< PointUShort > | mSortedPointsUShort |
std::vector< LineUShort > | mSortedLinesUShort |
std::vector< TriangleUShort > | mSortedTrianglesUShort |
std::vector< QuadUShort > | mSortedQuadsUShort |
std::vector< PointUByte > | mSortedPointsUByte |
std::vector< LineUByte > | mSortedLinesUByte |
std::vector< TriangleUByte > | mSortedTrianglesUByte |
std::vector< QuadUByte > | mSortedQuadsUByte |
vl::mat4 | mCacheMatrix |
ESortMode | mSortMode |
DepthSortCallback sorts the primitives of the Geometry bound to the Actor in which the callback is installed.
In order to work properly DepthSortCallback requires the following:
Despite the fact that the condition list seems to be quite limiting it actually covers the most common usage cases. Furthermore the use of DrawElements* and the primitive types PT_POINTS, PT_LINES, PT_TRIANGLES, PT_QUADS grants the maximum flexibility.
Definition at line 74 of file DepthSortCallback.hpp.
vl::DepthSortCallback::DepthSortCallback | ( | ) | [inline] |
Constructor.
Definition at line 137 of file DepthSortCallback.hpp.
References setSortMode(), vl::SM_SortBackToFront, and VL_DEBUG_SET_OBJECT_NAME.
void vl::DepthSortCallback::onActorDelete | ( | Actor * | actor ) | [inline, virtual] |
Event notifying that an Actor is being deleted.
Implements vl::ActorEventCallback.
Definition at line 143 of file DepthSortCallback.hpp.
virtual void vl::DepthSortCallback::onActorRenderStarted | ( | Actor * | actor, |
real | , | ||
const Camera * | cam, | ||
Renderable * | renderable, | ||
const Shader * | , | ||
int | pass | ||
) | [inline, virtual] |
Performs the actual sorting.
Implements vl::ActorEventCallback.
Definition at line 146 of file DepthSortCallback.hpp.
References vl::Object::as(), vl::Collection< T >::at(), vl::VertexAttribInfo::data(), vl::Geometry::drawCalls(), vl::ArrayAbstract::getAsVec3(), mCacheMatrix, mEyeSpaceVerts, mSortedLinesUByte, mSortedLinesUInt, mSortedLinesUShort, mSortedPointsUByte, mSortedPointsUInt, mSortedPointsUShort, mSortedQuadsUByte, mSortedQuadsUInt, mSortedQuadsUShort, mSortedTrianglesUByte, mSortedTrianglesUInt, mSortedTrianglesUShort, NULL, vl::Renderable::setBufferObjectDirty(), vl::Renderable::setDisplayListDirty(), vl::Collection< T >::size(), vl::ArrayAbstract::size(), vl::Actor::transform(), vl::VA_Position, vl::Geometry::vertexArray(), vl::Geometry::vertexAttribArray(), vl::Camera::viewMatrix(), and vl::Transform::worldMatrix().
void vl::DepthSortCallback::sort | ( | deT * | polys, |
std::vector< Point< T > > & | sorted_points, | ||
std::vector< Line< T > > & | sorted_lines, | ||
std::vector< Triangle< T > > & | sorted_triangles, | ||
std::vector< Quad< T > > & | sorted_quads | ||
) | [inline] |
Definition at line 201 of file DepthSortCallback.hpp.
References vl::BU_DYNAMIC_DRAW, vl::Has_BufferObject, mEyeSpaceVerts, mPrimitiveZ, vl::PT_LINES, vl::PT_POINTS, vl::PT_QUADS, vl::PT_TRIANGLES, vl::SM_SortBackToFront, and sortMode().
ESortMode vl::DepthSortCallback::sortMode | ( | ) | const [inline] |
Definition at line 334 of file DepthSortCallback.hpp.
References mSortMode.
Referenced by vl::VLXClassWrapper_ActorEventCallback::exportActorEventCallback(), and sort().
void vl::DepthSortCallback::setSortMode | ( | ESortMode | sort_mode ) | [inline] |
Definition at line 335 of file DepthSortCallback.hpp.
References mSortMode.
Referenced by DepthSortCallback().
void vl::DepthSortCallback::invalidateCache | ( | ) | [inline] |
Forces sorting at the next rendering.
Definition at line 340 of file DepthSortCallback.hpp.
References mCacheMatrix.
std::vector<vec3> vl::DepthSortCallback::mEyeSpaceVerts [protected] |
Definition at line 343 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted(), and sort().
std::vector<PrimitiveZ> vl::DepthSortCallback::mPrimitiveZ [protected] |
Definition at line 344 of file DepthSortCallback.hpp.
Referenced by sort().
std::vector<PointUInt> vl::DepthSortCallback::mSortedPointsUInt [protected] |
Definition at line 346 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<LineUInt> vl::DepthSortCallback::mSortedLinesUInt [protected] |
Definition at line 347 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<TriangleUInt> vl::DepthSortCallback::mSortedTrianglesUInt [protected] |
Definition at line 348 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<QuadUInt> vl::DepthSortCallback::mSortedQuadsUInt [protected] |
Definition at line 349 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<PointUShort> vl::DepthSortCallback::mSortedPointsUShort [protected] |
Definition at line 351 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<LineUShort> vl::DepthSortCallback::mSortedLinesUShort [protected] |
Definition at line 352 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<TriangleUShort> vl::DepthSortCallback::mSortedTrianglesUShort [protected] |
Definition at line 353 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<QuadUShort> vl::DepthSortCallback::mSortedQuadsUShort [protected] |
Definition at line 354 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<PointUByte> vl::DepthSortCallback::mSortedPointsUByte [protected] |
Definition at line 356 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<LineUByte> vl::DepthSortCallback::mSortedLinesUByte [protected] |
Definition at line 357 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<TriangleUByte> vl::DepthSortCallback::mSortedTrianglesUByte [protected] |
Definition at line 358 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
std::vector<QuadUByte> vl::DepthSortCallback::mSortedQuadsUByte [protected] |
Definition at line 359 of file DepthSortCallback.hpp.
Referenced by onActorRenderStarted().
vl::mat4 vl::DepthSortCallback::mCacheMatrix [protected] |
Definition at line 361 of file DepthSortCallback.hpp.
Referenced by invalidateCache(), and onActorRenderStarted().
ESortMode vl::DepthSortCallback::mSortMode [protected] |
Definition at line 363 of file DepthSortCallback.hpp.
Referenced by setSortMode(), and sortMode().