Vis 2 Demo
1.0
Technical illustration type real-time rendering of geometry
|
This class is for the complex objects in the scene. More...
Public Member Functions | |
ModelMultiTextured (const char *_id_name, const glm::vec3 _id_color, const glm::vec3 _contour_color, glm::mat4 &_modelMatrix, LoaderOBJ *_loader, ShaderController *_shader_controller) | |
Constructor. More... | |
virtual | ~ModelMultiTextured () |
Destructor. More... | |
virtual void | update (double _deltaT) |
Standard function for framerate-independent updates. More... | |
virtual void | draw (glm::mat4 &_projectionMatrix) |
Standard drawing function, uses the standard shader program (slot 0) More... | |
virtual void | assignShaderController (ShaderController *_shader_ctrl, const unsigned int _slot) |
Function for assigning additional shader controllers. More... | |
virtual void | updateModelMatrix (glm::mat4 &_modelMatrix) |
Updates the model matrix. More... | |
virtual void | draw (glm::mat4 &_projectionMatrix, const unsigned int _slot) |
Drawing function that uses the shader program occupying slot _slot. More... | |
const char * | getIdName () const |
getter for the object's unique name More... | |
glm::vec3 | getIdColor () const |
getter for the object's unique color More... | |
Public Member Functions inherited from vis2::DrawableObject | |
DrawableObject (glm::mat4 &_modelMatrix) | |
Constructor. More... | |
virtual | ~DrawableObject () |
Destructor. More... | |
Protected Attributes | |
const char * | id_name |
the unique name of this object More... | |
const glm::vec3 | id_color |
the unique color of this object (used in the color_ID shader program) More... | |
const glm::vec3 | contour_color |
the edge color to use in edge detecting shaders More... | |
LoaderOBJ * | loader_Ptr |
pointer to the geometry loader, which fills index_count, and buffers vao_handle to index_buffer_handle More... | |
unsigned int | index_count |
nr of polygons to be drawn More... | |
ShaderController * | shader_ctrl [3] |
is a pointer to the standard, solid color, and transparency shader controller for this object More... | |
GLuint | vao_handle [3] |
handle to the vertex array object for the standard, solid color, and transparency shader program More... | |
bool | vao_setup_done [3] |
signifies if the setup for shader slot 0, 1, or 2 was completed More... | |
GLuint | position_buffer_handle |
handle to the vertex buffer object containing the vertex coordinates in object space More... | |
GLuint | normal_buffer_handle |
handle to the normal buffer object containing the vertex normals in object space More... | |
GLuint | uv_buffer_handle |
handle to the uv buffer object containing the vertex texture coordinates in object space More... | |
GLuint | index_buffer_handle |
handle to the vertex buffer object containing the face indices for each polygon More... | |
Protected Attributes inherited from vis2::DrawableObject | |
glm::mat4 | modelMatrix |
holds the current model matrix More... | |
Private Member Functions | |
ModelMultiTextured (const ModelMultiTextured &) | |
Hidden copy-constructor. More... | |
This class is for the complex objects in the scene.
The class contains methods for loading geometry, multiple textures and shader programs as wells as
for rendering in multiple modes.
Definition at line 22 of file ModelMultiTextured.h.
ModelMultiTextured::ModelMultiTextured | ( | const char * | _id_name, |
const glm::vec3 | _id_color, | ||
const glm::vec3 | _contour_color, | ||
glm::mat4 & | _modelMatrix, | ||
LoaderOBJ * | _loader, | ||
ShaderController * | _shader_controller | ||
) |
Constructor.
[in] | _id_name | is the unique name of this object, |
[in] | _id_color | is the unique color of this object, used in picking algorithms, |
[in] | _contour_color | is the color to use in edge detecting shaders, |
[in] | _modelMatrix | is the model matrix for the object, |
[in] | _loader | is the geometry loader. |
[in] | _shader_controller | is the standard diffuse shader and cannot be NULL. All other textures and shader programs are optional. |
Definition at line 9 of file ModelMultiTextured.cpp.
|
virtual |
Destructor.
Deletes the VBOs and the VAO built in the constructor.
Definition at line 88 of file ModelMultiTextured.cpp.
|
private |
Hidden copy-constructor.
|
virtual |
Function for assigning additional shader controllers.
Each shader controller slot can be assigned only once. The standard shader program
is assigned in the constructor.
[in] | _shader_ctrl | is the shader program controller to be assigned to |
[in] | _slot,which | can take values VIS2_SHADER_DIFFUSE_SLOT, VIS2_SHADER_COLORID_SLOT or VIS2_SHADER_TRANSP_SLOT. |
Definition at line 130 of file ModelMultiTextured.cpp.
|
virtual |
Standard drawing function, uses the standard shader program (slot 0)
[in] | _projectionMatrix | is the current projection matrix of the camera. |
Implements vis2::DrawableObject.
Definition at line 105 of file ModelMultiTextured.cpp.
|
virtual |
Drawing function that uses the shader program occupying slot _slot.
[in] | _projectionMatrix | is the current projection matrix of the camera, |
[in] | _slot | is the id of the shader program to be used |
Definition at line 157 of file ModelMultiTextured.cpp.
|
inline |
getter for the object's unique color
Definition at line 84 of file ModelMultiTextured.h.
|
inline |
getter for the object's unique name
Definition at line 81 of file ModelMultiTextured.h.
|
virtual |
Standard function for framerate-independent updates.
[in] | _deltaT | is the duration of the last frame in seconds. |
Implements vis2::DrawableObject.
Definition at line 101 of file ModelMultiTextured.cpp.
|
virtual |
Updates the model matrix.
[in] | _modelMatrix | is the new model matrix. |
Definition at line 152 of file ModelMultiTextured.cpp.
|
protected |
the edge color to use in edge detecting shaders
Definition at line 90 of file ModelMultiTextured.h.
|
protected |
the unique color of this object (used in the color_ID shader program)
Definition at line 89 of file ModelMultiTextured.h.
|
protected |
the unique name of this object
Definition at line 88 of file ModelMultiTextured.h.
|
protected |
handle to the vertex buffer object containing the face indices for each polygon
Definition at line 104 of file ModelMultiTextured.h.
|
protected |
nr of polygons to be drawn
Definition at line 94 of file ModelMultiTextured.h.
|
protected |
pointer to the geometry loader, which fills index_count, and buffers vao_handle to index_buffer_handle
Definition at line 92 of file ModelMultiTextured.h.
|
protected |
handle to the normal buffer object containing the vertex normals in object space
Definition at line 102 of file ModelMultiTextured.h.
|
protected |
handle to the vertex buffer object containing the vertex coordinates in object space
Definition at line 101 of file ModelMultiTextured.h.
|
protected |
is a pointer to the standard, solid color, and transparency shader controller for this object
Definition at line 96 of file ModelMultiTextured.h.
|
protected |
handle to the uv buffer object containing the vertex texture coordinates in object space
Definition at line 103 of file ModelMultiTextured.h.
|
protected |
handle to the vertex array object for the standard, solid color, and transparency shader program
Definition at line 98 of file ModelMultiTextured.h.
|
protected |
signifies if the setup for shader slot 0, 1, or 2 was completed
Definition at line 99 of file ModelMultiTextured.h.