SuzanneIsland: An island of Real-time rendering effects!
|
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< Vertex > | getVertices () |
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... | |
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.
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!
shader | the compiled shader program to use for drawing |
glm::vec3 Surface::getBoundingSphereCenter | ( | ) |
get the center of the bounding sphere for this surface to be used in view frustum culling
glm::vec3 Surface::getBoundingSphereFarthestPoint | ( | ) |
get the farthest point on the bounding sphere whose length defines the bounding sphere radius.
used for view frustum culling