diff --git a/FinalProject/renderable.cpp b/FinalProject/renderable.cpp index 9f890d5..219558e 100644 --- a/FinalProject/renderable.cpp +++ b/FinalProject/renderable.cpp @@ -59,6 +59,13 @@ void Renderable::makeLight() { _light = new ScopedLight(glm::vec3(0.0f)); } +void Renderable::disposeLight() { + if (_light != nullptr) { + delete _light; + _light = nullptr; + } +} + void Renderable::render(ShaderProgram shader) { // Check if initialized if (_model == nullptr) { diff --git a/FinalProject/renderable.h b/FinalProject/renderable.h index e8b268b..eed1222 100644 --- a/FinalProject/renderable.h +++ b/FinalProject/renderable.h @@ -32,6 +32,10 @@ public: ~Renderable(); public: + glm::vec3 position() const { return _position; } + glm::mat4 rotation() const { return _rotation; } + glm::vec3 scaleVal() const { return _scale; } + void setModel(Model* model); void move(glm::vec3 deltaVec); void setPosition(glm::vec3 position); @@ -44,6 +48,7 @@ public: ScopedLight* originalLight() const; // pass out the light object to scene manager to set light attributes bool hasLight() const { return _light != nullptr; } void makeLight(); // create a light source in the object + void disposeLight(); // remove the light source in the object const Boundary& boundary() const { return _boundary; }