Vis 2 Demo  1.0
Technical illustration type real-time rendering of geometry
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
vis2::SpinningCubeTextured Class Reference

This class produces a textured cube that rotates around the y-axis. More...

Inheritance diagram for vis2::SpinningCubeTextured:
vis2::GeometricObjectTextured vis2::GeometricObject vis2::DrawableObject

Public Member Functions

 SpinningCubeTextured (glm::mat4 _modelMatrix, Shader *_shader, Texture *_diffuseTexture)
 Constructor. More...
 
virtual ~SpinningCubeTextured ()
 Destructor. More...
 
virtual void update (double _deltaT)
 Update function, called every frame. More...
 
virtual void draw (glm::mat4 &_projectionMatrix)
 Draw function, called every frame. More...
 
- Public Member Functions inherited from vis2::GeometricObjectTextured
 GeometricObjectTextured (glm::mat4 _modelMatrix, Shader *_shader, Texture *_diffuse_texture, const float *_positions_Ptr, const unsigned int _pos_size, const float *_normals_Ptr, const unsigned int _norm_size, const float *_uv_Ptr, const unsigned int _uv_size, const unsigned int *_index_Ptr, const unsigned int _ind_size)
 Constructor. More...
 
virtual ~GeometricObjectTextured ()
 Destructor. More...
 
- Public Member Functions inherited from vis2::GeometricObject
 GeometricObject (glm::mat4 _modelMatrix, Shader *_shader, const float *_positions_Ptr, const unsigned int _pos_size, const float *_normals_Ptr, const unsigned int _norm_size, const unsigned int *_index_Ptr, const unsigned int _ind_size)
 Constructor. More...
 
virtual ~GeometricObject ()
 Destructor. More...
 
- Public Member Functions inherited from vis2::DrawableObject
 DrawableObject (glm::mat4 &_modelMatrix)
 Constructor. More...
 
virtual ~DrawableObject ()
 Destructor. More...
 

Private Member Functions

 SpinningCubeTextured (const SpinningCubeTextured &)
 Hidden copy-constructor. More...
 

Static Private Attributes

static const float generic_positions [TEXTURED_CUBE_VERTEX_COUNT *3]
 the vertex positions for a generic cube with pivot in (0,0,0) and edge length 2 More...
 
static const float generic_normlas [TEXTURED_CUBE_VERTEX_COUNT *3]
 the vertex normals for the generic cube with pivot in (0,0,0) and edge length 2 More...
 
static const float generic_uv [TEXTURED_CUBE_VERTEX_COUNT *2]
 the vertex uv coordinates for the generic cube with pivot in (0,0,0) and edge length 2 More...
 
static const unsigned int generic_indices [TEXTURED_CUBE_INDEX_COUNT]
 the face indices for the generic cube with pivot in (0,0,0) and edge length 2 More...
 

Additional Inherited Members

- Protected Attributes inherited from vis2::GeometricObjectTextured
GLuint uv_buffer_handle
 handle to the uv buffer object containing the vertex texture coordinates in object space More...
 
Texturediffuse_texture_Ptr
 handle to the texture for this object More...
 

Detailed Description

This class produces a textured cube that rotates around the y-axis.

This class is well suited for testing the basic setup of an OpenGL application.

Definition at line 14 of file SpinningCubeTextured.h.

Constructor & Destructor Documentation

SpinningCubeTextured::SpinningCubeTextured ( glm::mat4  _modelMatrix,
Shader _shader,
Texture _diffuseTexture 
)

Constructor.

Parameters
[in]_modelMatrixis the model matrix that places the object in the world coordinate system,
[in]_shaderis the shader program used by this object.
[in]_diffuseTextureis the pointer to a texture object.
The geometry description is contained within the class.

Definition at line 5 of file SpinningCubeTextured.cpp.

SpinningCubeTextured::~SpinningCubeTextured ( )
virtual

Destructor.

Definition at line 21 of file SpinningCubeTextured.cpp.

vis2::SpinningCubeTextured::SpinningCubeTextured ( const SpinningCubeTextured )
private

Hidden copy-constructor.

Member Function Documentation

void SpinningCubeTextured::draw ( glm::mat4 &  _projectionMatrix)
virtual

Draw function, called every frame.

Calls its parent's draw function.

Reimplemented from vis2::GeometricObjectTextured.

Definition at line 33 of file SpinningCubeTextured.cpp.

void SpinningCubeTextured::update ( double  _deltaT)
virtual

Update function, called every frame.

Parameters
[in]_deltaTis the duration of the last frame in seconds. The cube rotates around its vertical axis.

Implements vis2::GeometricObjectTextured.

Definition at line 25 of file SpinningCubeTextured.cpp.

Member Data Documentation

const unsigned int SpinningCubeTextured::generic_indices
staticprivate
Initial value:
=
{
0, 1, 2,
0, 2, 3,
4, 5, 6,
4, 6, 7,
8, 9, 10,
8, 10, 11,
12, 13, 14,
12, 14, 15,
16, 17, 18,
16, 18, 19,
20, 21, 22,
20, 22, 23
}

the face indices for the generic cube with pivot in (0,0,0) and edge length 2

Definition at line 46 of file SpinningCubeTextured.h.

const float SpinningCubeTextured::generic_normlas
staticprivate

the vertex normals for the generic cube with pivot in (0,0,0) and edge length 2

Definition at line 44 of file SpinningCubeTextured.h.

const float SpinningCubeTextured::generic_positions
staticprivate

the vertex positions for a generic cube with pivot in (0,0,0) and edge length 2

Definition at line 43 of file SpinningCubeTextured.h.

const float SpinningCubeTextured::generic_uv
staticprivate

the vertex uv coordinates for the generic cube with pivot in (0,0,0) and edge length 2

Definition at line 45 of file SpinningCubeTextured.h.


The documentation for this class was generated from the following files: