VisPro  1.0
Project of Visualisierung 2
Mesh Class Reference

Public Member Functions

 Mesh (std::vector< glm::vec3 > &v, std::vector< glm::vec3 > &n, std::vector< Face * > &f, std::vector< glm::vec2 > &uv, Shader *shader, glm::mat4 &model_m)
 
virtual void update (float delta_t)
 
void rotateLocally (float delta_t, glm::vec3 axis)
 
void rotateAroundCenter (glm::vec3 &world_center, float angle, glm::vec3 axis)
 
std::vector< glm::vec3 > getNormals ()
 
std::vector< glm::vec3 > getVertices ()
 
std::vector< GLuint > getIndices ()
 
void zBufferPass (ZBufferShader *z, glm::mat4 &vp)
 
void setUniformsForZBufferPass (ZBufferShader *z, glm::mat4 &vp)
 
void renderToZBuffer ()
 
void renderPass (const CutawaySurface *c, glm::mat4 &vp, glm::vec3 cam, float clip)
 
void setUniformsForRenderPass (glm::mat4 &vp, glm::vec3 cam, float clip)
 
virtual void draw ()
 
void setLighting (std::vector< std::shared_ptr< PointLight >> *allLights)
 
void setCutawayDimension (glm::vec2 dim)
 
void setShader (Shader *s)
 
BoundingBoxcalcBoundingBoxWithApplying ()
 
BoundingBoxcalcBoundingBoxWithOutApplying ()
 
glm::vec3 getRelativePosition (glm::vec3 p)
 

Public Attributes

glm::mat4 model_matrix
 
GLuint f_count
 

Member Function Documentation

void Mesh::draw ( )
virtual

Draw mesh triangles in current OpenGL context.

void Mesh::renderPass ( const CutawaySurface c,
glm::mat4 &  vp,
glm::vec3  cam,
float  clip 
)

Render the given mesh (on screen). Clip against cutaway surface if wished.

Parameters
ccutaway surface
vpview projection matrix
camcamera position
cliptrue to clip mesh against cutaway surface
void Mesh::renderToZBuffer ( )

Actual OpenGL render call to draw elements to z buffer.

void Mesh::setUniformsForRenderPass ( glm::mat4 &  vp,
glm::vec3  cam,
float  clip 
)

Set model matrix, view projection matrix, camera position and clipping against cutaway surface in shader.

Parameters
vpview projection matrix
camcamera position
cliptrue to clip mesh against cutaway surface
void Mesh::setUniformsForZBufferPass ( ZBufferShader z,
glm::mat4 &  vp 
)

Set model and view projection matrix in z buffer shader.

Parameters
zz buffer shader
vpview projection matrix
void Mesh::update ( float  delta_t)
virtual

Update mesh according to time passed.

Parameters
delta_ttime passed since last update
void Mesh::zBufferPass ( ZBufferShader z,
glm::mat4 &  vp 
)

Render depth values to z buffer.

Parameters
zz buffer shader
vpview projection matrix

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