diff --git a/Controller.cpp b/Controller.cpp index 4b5affe..cf3cb87 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -20,7 +20,7 @@ using namespace std; Controller::Controller(istream& scenegraphFile, Model& m,View& v): model(m), view(v) { initScenegraph(scenegraphFile); - globalCamera = new StationaryCamera(glm::vec3(200.0, 250.0, 200.0)); + globalCamera = new StationaryCamera(glm::vec3(0.0, 0.0, 100.0)); globalCamera->LookAt(glm::vec3(0.0,0.0,0.0)); cameras.push_back(globalCamera); @@ -46,7 +46,9 @@ void Controller::initScenegraph(istream& scenegraphFile) { Controller::~Controller() { - delete globalCamera; + if (globalCamera) delete globalCamera; + if (helicopterCamera) delete helicopterCamera; + if (firstPersonCamera) delete firstPersonCamera; } void Controller::run()