1 #ifndef B_MODEL_RENDERER_H
2 #define B_MODEL_RENDERER_H
10 #include "vmmlib/util.hpp"
11 #include "vmmlib/frustum_culler.hpp"
57 virtual void drawModel(
const std::string &modelName,
const std::string &cameraName,
const vmml::Matrix4f &modelMatrix,
const std::vector<std::string> &lightNames,
bool doFrustumCulling =
true,
bool cullIndividualGeometry =
false);
68 virtual void drawModel(
ModelPtr model,
const vmml::Matrix4f &modelMatrix,
const vmml::Matrix4f &viewMatrix,
const vmml::Matrix4f &projectionMatrix,
const std::vector<std::string> &lightNames,
bool doFrustumCulling =
true,
bool cullIndividualGeometry =
false);
83 virtual void queueModelInstance(
const std::string &modelName,
const std::string &instanceName,
const std::string &cameraName,
const vmml::Matrix4f &modelMatrix,
const std::vector<std::string> &lightNames,
bool doFrustumCulling =
true,
bool cullIndividualGeometry =
false,
bool isTransparent =
false, GLenum blendSfactor = GL_SRC_ALPHA, GLenum blendDfactor = GL_ONE_MINUS_SRC_ALPHA, GLfloat customDistance = 10000.0f);
99 virtual void queueModelInstance(
ModelPtr model,
const std::string &instanceName,
const vmml::Matrix4f &modelMatrix,
const vmml::Matrix4f &viewMatrix,
const vmml::Matrix4f &projectionMatrix,
const std::vector<std::string> &lightNames,
bool doFrustumCulling =
true,
bool cullIndividualGeometry =
false,
bool isTransparent =
false, GLenum blendSfactor = GL_SRC_ALPHA, GLenum blendDfactor = GL_ONE_MINUS_SRC_ALPHA, GLfloat customDistance = 10000.0f);
108 virtual void drawText(
const std::string &textSpriteName,
const std::string &cameraName,
const vmml::Matrix4f &modelMatrix,
const std::vector<std::string> &lightNames,
bool doFrustumCulling =
false);
121 virtual void queueTextInstance(
const std::string &textSpriteName,
const std::string &instanceName,
const std::string &cameraName,
const vmml::Matrix4f &modelMatrix,
const std::vector<std::string> &lightNames,
bool doFrustumCulling =
true, GLenum blendSfactor = GL_SRC_ALPHA, GLenum blendDfactor = GL_ONE_MINUS_SRC_ALPHA, GLfloat customDistance = 10000.0f);
126 void drawQueue(GLenum mode = GL_TRIANGLES);
136 vmml::Visibility
viewFrustumCulling(
const vmml::AABBf &aabbObjectSpace,
const vmml::Matrix4f &modelViewProjectionMatrix);
RenderQueuePtr getRenderQueue()
Returns a pointer to the render queue.
Definition: ModelRenderer.cpp:27
virtual void drawModel(const std::string &modelName, const std::string &cameraName, const vmml::Matrix4f &modelMatrix, const std::vector< std::string > &lightNames, bool doFrustumCulling=true, bool cullIndividualGeometry=false)
Draw specified model into the current framebuffer.
Definition: ModelRenderer.cpp:32
A helper class to efficiently draw and queue models with one function call.
Definition: ModelRenderer.h:17
std::shared_ptr< ModelRenderer > ModelRendererPtr
Definition: ModelRenderer.h:146
ObjectManagerPtr getObjectManager()
Returns a pointer to the object manager used to get the models, cameras and lights from...
Definition: ModelRenderer.cpp:17
virtual void queueModelInstance(const std::string &modelName, const std::string &instanceName, const std::string &cameraName, const vmml::Matrix4f &modelMatrix, const std::vector< std::string > &lightNames, bool doFrustumCulling=true, bool cullIndividualGeometry=false, bool isTransparent=false, GLenum blendSfactor=GL_SRC_ALPHA, GLenum blendDfactor=GL_ONE_MINUS_SRC_ALPHA, GLfloat customDistance=10000.0f)
Queue specified model into the render queue.
Definition: ModelRenderer.cpp:110
virtual ~ModelRenderer()
Virtual destructor.
Definition: ModelRenderer.h:34
virtual void drawText(const std::string &textSpriteName, const std::string &cameraName, const vmml::Matrix4f &modelMatrix, const std::vector< std::string > &lightNames, bool doFrustumCulling=false)
Draw specified text sprite into the current framebuffer.
Definition: ModelRenderer.cpp:201
void setObjectManager(ObjectManagerPtr o)
Set the object manager to get the models, cameras and lights from.
Definition: ModelRenderer.cpp:22
vmml::Visibility viewFrustumCulling(const vmml::AABBf &aabbObjectSpace, const vmml::Matrix4f &modelViewProjectionMatrix)
Tests an axis-aligned bounding box against the view frustum.
Definition: ModelRenderer.cpp:221
ModelRenderer()
Constructor.
Definition: ModelRenderer.cpp:6
virtual void queueTextInstance(const std::string &textSpriteName, const std::string &instanceName, const std::string &cameraName, const vmml::Matrix4f &modelMatrix, const std::vector< std::string > &lightNames, bool doFrustumCulling=true, GLenum blendSfactor=GL_SRC_ALPHA, GLenum blendDfactor=GL_ONE_MINUS_SRC_ALPHA, GLfloat customDistance=10000.0f)
Queue specified text sprite into the render queue.
Definition: ModelRenderer.cpp:206
void clearQueue()
Clears the render queue.
Definition: ModelRenderer.cpp:216
std::shared_ptr< ObjectManager > ObjectManagerPtr
Definition: ObjectManager.h:690
void drawQueue(GLenum mode=GL_TRIANGLES)
Draws the render queue into the current framebuffer.
Definition: ModelRenderer.cpp:211
std::shared_ptr< RenderQueue > RenderQueuePtr
Definition: RenderQueue.h:80
std::shared_ptr< Model > ModelPtr
Definition: Model.h:188