Added a update function to the level which rotates the bunny.

This commit is contained in:
Faerbit 2014-11-13 00:40:28 +01:00
parent f5a1864472
commit 16f4890458
4 changed files with 11 additions and 2 deletions

View File

@ -40,6 +40,9 @@ void deleteCustomResources()
void draw(float runTime)
{
// update Level first TODO: move this with the rest of the stuff that doesn't belong here to main
level.update(runTime);
// clear the framebuffer:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

View File

@ -41,6 +41,11 @@ void Level::render() {
this->terrain.render();
}
void Level::update(float runTime) {
// rotate bunny
objects[0].setRotation(glm::vec3(0.0f, 1.0472f * runTime, 0.0f));
}
glm::vec3 Level::getAmbientLight() {
return ambientLight;
}

View File

@ -14,6 +14,7 @@ class Level {
Level();
~Level();
void load(ACGL::OpenGL::SharedShaderProgram shader); // Shader is necessary for correct texture assigning
void update(float runTime);
void render();
glm::vec3 getAmbientLight();
std::vector<Light> getLights();