From 7d0cf9fca2b42249366ee741cc18828d18a9a11d Mon Sep 17 00:00:00 2001 From: Faerbit Date: Wed, 19 Nov 2014 01:57:38 +0100 Subject: [PATCH] Added getCameraPosition to Level because it is used very often. --- level.cc | 4 ++++ level.hh | 1 + 2 files changed, 5 insertions(+) diff --git a/level.cc b/level.cc index f8d0c7a..10bf0fe 100644 --- a/level.cc +++ b/level.cc @@ -133,3 +133,7 @@ Object* Level::getCameraCenter() { Light* Level::getDirectionalLight() { return &directionalLight; } + +glm::vec3 Level::getCameraPosition() { + return cameraCenter->getPosition() + camera.getVector(); +} diff --git a/level.hh b/level.hh index 21d6d81..4efd74b 100644 --- a/level.hh +++ b/level.hh @@ -23,6 +23,7 @@ class Level { std::vector getLights(); Object* getCameraCenter(); Camera* getCamera(); + glm::vec3 getCameraPosition(); private: std::string filePath; std::vector objects;