Added getCameraPosition to Level because it is used very often.
This commit is contained in:
parent
49dfdff413
commit
7d0cf9fca2
4
level.cc
4
level.cc
@ -133,3 +133,7 @@ Object* Level::getCameraCenter() {
|
|||||||
Light* Level::getDirectionalLight() {
|
Light* Level::getDirectionalLight() {
|
||||||
return &directionalLight;
|
return &directionalLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec3 Level::getCameraPosition() {
|
||||||
|
return cameraCenter->getPosition() + camera.getVector();
|
||||||
|
}
|
||||||
|
1
level.hh
1
level.hh
@ -23,6 +23,7 @@ class Level {
|
|||||||
std::vector<Light> getLights();
|
std::vector<Light> getLights();
|
||||||
Object* getCameraCenter();
|
Object* getCameraCenter();
|
||||||
Camera* getCamera();
|
Camera* getCamera();
|
||||||
|
glm::vec3 getCameraPosition();
|
||||||
private:
|
private:
|
||||||
std::string filePath;
|
std::string filePath;
|
||||||
std::vector<Object> objects;
|
std::vector<Object> objects;
|
||||||
|
Loading…
Reference in New Issue
Block a user