Adapted level to new camera implementation.
This commit is contained in:
parent
497a0b060c
commit
1050e6072f
6
level.cc
6
level.cc
@ -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() {
|
||||||
|
5
level.hh
5
level.hh
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user