SuzanneIsland: An island of Real-time rendering effects!
Public Member Functions
Surface Class Reference

A Surface holds mesh data (vertex data and indices) and textures. More...

#include <surface.h>

Public Member Functions

 Surface (const std::vector< Vertex > &vertices_, const std::vector< GLuint > &indices_, const std::shared_ptr< Texture > &texDiffuse_, const std::shared_ptr< Texture > &texSpecular_, const std::shared_ptr< Texture > &texNormal_)
 
std::vector< VertexgetVertices ()
 
std::vector< GLuint > getIndices ()
 
void draw (Shader *shader, Texture::FilterType filterType)
 draw triangles from vertex data from buffers bound as specified by the vba. More...
 
glm::vec3 getBoundingSphereCenter ()
 get the center of the bounding sphere for this surface to be used in view frustum culling More...
 
glm::vec3 getBoundingSphereFarthestPoint ()
 get the farthest point on the bounding sphere whose length defines the bounding sphere radius. More...
 

Detailed Description

A Surface holds mesh data (vertex data and indices) and textures.

This communicates with Vertex Buffer Objects to store vertex data directly on GPU memory and with compiled shader programs for drawing.

Member Function Documentation

§ draw()

void Surface::draw ( Shader shader,
Texture::FilterType  filterType 
)

draw triangles from vertex data from buffers bound as specified by the vba.

note: the transformation matrices must be set already in shader program!

Parameters
shaderthe compiled shader program to use for drawing

§ getBoundingSphereCenter()

glm::vec3 Surface::getBoundingSphereCenter ( )

get the center of the bounding sphere for this surface to be used in view frustum culling

Returns
the bounding sphere center

§ getBoundingSphereFarthestPoint()

glm::vec3 Surface::getBoundingSphereFarthestPoint ( )

get the farthest point on the bounding sphere whose length defines the bounding sphere radius.

used for view frustum culling

Returns
the farthest point on the bounding sphere

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