Adapted level to new camera implementation.

This commit is contained in:
Faerbit 2014-11-13 17:19:56 +01:00
parent 497a0b060c
commit 1050e6072f
2 changed files with 6 additions and 5 deletions

View File

@ -13,7 +13,7 @@ Level::~Level() {
void Level::load(ACGL::OpenGL::SharedShaderProgram shader) { void Level::load(ACGL::OpenGL::SharedShaderProgram shader) {
// currently hard coded should later read this stuff out of a file // currently hard coded should later read this stuff out of a file
cameraPosition = glm::vec3(0.0f, 0.0f, 0.0f); this->camera = Camera(glm::vec3(0.0f, 0.0f, 0.0f), 1.0f);
// load the geometry of the stanford bunny and build a VAO: // load the geometry of the stanford bunny and build a VAO:
Model model = Model("Bunny.obj", 0.25f); Model model = Model("Bunny.obj", 0.25f);
// load a texture: // load a texture:
@ -54,8 +54,8 @@ std::vector<Light> Level::getLights() {
return lights; return lights;
} }
glm::vec3 Level::getCameraPosition() { Camera Level::getCamera() {
return cameraPosition; return camera;
} }
Object* Level::getCameraCenter() { Object* Level::getCameraCenter() {

View File

@ -7,6 +7,7 @@
#include "entity.hh" #include "entity.hh"
#include "terrain.hh" #include "terrain.hh"
#include "material.hh" #include "material.hh"
#include "camera.hh"
class Level { class Level {
public: public:
@ -18,15 +19,15 @@ class Level {
void render(); void render();
glm::vec3 getAmbientLight(); glm::vec3 getAmbientLight();
std::vector<Light> getLights(); std::vector<Light> getLights();
glm::vec3 getCameraPosition();
Object* getCameraCenter(); Object* getCameraCenter();
Camera getCamera();
private: private:
std::string filePath; std::string filePath;
std::vector<Object> objects; std::vector<Object> objects;
std::vector<Light> lights; std::vector<Light> lights;
glm::vec3 ambientLight; glm::vec3 ambientLight;
Object* cameraCenter; Object* cameraCenter;
glm::vec3 cameraPosition; Camera camera;
Terrain terrain; Terrain terrain;
}; };