Loading CMakeLists.txt +2 −1 Changes for CMakeLists.txt: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -17,5 +17,6 @@ include_directories("glitter/ext/tinyobjloader" "glitter/ext/glm" ${OPENGL_INCLUDE_DIR}) add_executable(GLE-test src/main.cpp src/RenderObject.cpp src/RenderObjectPart.cpp src/GlApplication.cpp) add_executable(GLE-test src/main.cpp src/RenderObject.cpp src/RenderObjectPart.cpp src/GlApplication.cpp src/model/Spaceship.cpp src/model/Renderable.cpp) target_link_libraries(GLE-test utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES}) include/GlApplication.hpp +1 −1 Changes for include/GlApplication.hpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class GlApplication : public Application { void computeView(bool reset = false); private: std::vector<std::unique_ptr<RenderObject>> m_objects; ///< render objects std::vector<std::shared_ptr<RenderObject>> m_objects; ///< render objects glm::mat4 m_proj; ///< Projection matrix glm::mat4 m_view; ///< worldView matrix float m_eyePhi; ///< Camera position longitude angle Loading include/RenderObject.hpp +1 −1 Changes for include/RenderObject.hpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class RenderObject { * @param modelWorld the matrix transform between the object (a.k.a model) space and the world space * @return the created RenderObject as a smart pointer */ static std::unique_ptr<RenderObject> createWavefrontInstance(const std::string & objname, const glm::mat4 & modelWorld); static std::shared_ptr<RenderObject> createWavefrontInstance(const std::string & objname, const glm::mat4 & modelWorld); /** * @brief Sets all uniform variables related to material and lighting Loading include/model/Renderable.hpp 0 → 100644 +23 −0 Changes for include/model/Renderable.hpp: 23 added lines, 0 removed lines. Original line number Diff line number Diff line #ifndef __RENDERABLE_HPP_ #include <string> #include <memory> #include "glm/glm.hpp" #include "RenderObject.hpp" class Renderable { private: std::shared_ptr<RenderObject> renderObject; public: Renderable(const glm::mat4 &modelWorld, const std::string &objName); virtual void update(const double &time, const glm::mat4 &proj, const glm::mat4 &view); const std::shared_ptr<RenderObject> &get_render_object() const; }; #endif // !__RENDERABLE_HPP_ include/model/Spaceship.hpp 0 → 100644 +26 −0 Changes for include/model/Spaceship.hpp: 26 added lines, 0 removed lines. Original line number Diff line number Diff line #ifndef __SPACESHIP_HPP_ #include "glm/glm.hpp" #include "Renderable.hpp" enum Player {one, two}; class Spaceship : public Renderable { private: glm::vec3 acceleration; Player playerNumber; public: Spaceship(const Player &playerNumber, const glm::mat4 &modelWorld); const glm::vec3 &get_acceleration() const; const Player &get_player_number() const; }; #endif // !__SPACESHIP_HPP_ Loading
CMakeLists.txt +2 −1 Changes for CMakeLists.txt: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -17,5 +17,6 @@ include_directories("glitter/ext/tinyobjloader" "glitter/ext/glm" ${OPENGL_INCLUDE_DIR}) add_executable(GLE-test src/main.cpp src/RenderObject.cpp src/RenderObjectPart.cpp src/GlApplication.cpp) add_executable(GLE-test src/main.cpp src/RenderObject.cpp src/RenderObjectPart.cpp src/GlApplication.cpp src/model/Spaceship.cpp src/model/Renderable.cpp) target_link_libraries(GLE-test utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES})
include/GlApplication.hpp +1 −1 Changes for include/GlApplication.hpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class GlApplication : public Application { void computeView(bool reset = false); private: std::vector<std::unique_ptr<RenderObject>> m_objects; ///< render objects std::vector<std::shared_ptr<RenderObject>> m_objects; ///< render objects glm::mat4 m_proj; ///< Projection matrix glm::mat4 m_view; ///< worldView matrix float m_eyePhi; ///< Camera position longitude angle Loading
include/RenderObject.hpp +1 −1 Changes for include/RenderObject.hpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class RenderObject { * @param modelWorld the matrix transform between the object (a.k.a model) space and the world space * @return the created RenderObject as a smart pointer */ static std::unique_ptr<RenderObject> createWavefrontInstance(const std::string & objname, const glm::mat4 & modelWorld); static std::shared_ptr<RenderObject> createWavefrontInstance(const std::string & objname, const glm::mat4 & modelWorld); /** * @brief Sets all uniform variables related to material and lighting Loading
include/model/Renderable.hpp 0 → 100644 +23 −0 Changes for include/model/Renderable.hpp: 23 added lines, 0 removed lines. Original line number Diff line number Diff line #ifndef __RENDERABLE_HPP_ #include <string> #include <memory> #include "glm/glm.hpp" #include "RenderObject.hpp" class Renderable { private: std::shared_ptr<RenderObject> renderObject; public: Renderable(const glm::mat4 &modelWorld, const std::string &objName); virtual void update(const double &time, const glm::mat4 &proj, const glm::mat4 &view); const std::shared_ptr<RenderObject> &get_render_object() const; }; #endif // !__RENDERABLE_HPP_
include/model/Spaceship.hpp 0 → 100644 +26 −0 Changes for include/model/Spaceship.hpp: 26 added lines, 0 removed lines. Original line number Diff line number Diff line #ifndef __SPACESHIP_HPP_ #include "glm/glm.hpp" #include "Renderable.hpp" enum Player {one, two}; class Spaceship : public Renderable { private: glm::vec3 acceleration; Player playerNumber; public: Spaceship(const Player &playerNumber, const glm::mat4 &modelWorld); const glm::vec3 &get_acceleration() const; const Player &get_player_number() const; }; #endif // !__SPACESHIP_HPP_