Loading CMakeLists.txt +1 −1 Changes for CMakeLists.txt: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -18,5 +18,5 @@ include_directories("glitter/ext/tinyobjloader" ${OPENGL_INCLUDE_DIR}) add_executable(GLE-test src/main.cpp src/RenderObject.cpp src/RenderObjectPart.cpp src/GlApplication.cpp src/model/Spaceship.cpp src/model/Entity.cpp) src/model/Spaceship.cpp src/model/Entity.cpp src/model/Missile.cpp) target_link_libraries(GLE-test utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES}) glitter @ 2b5bb541 Compare a4d399b0 to 2b5bb541 Changes for glitter: 1 added line, 1 removed line. Original line number Diff line number Diff line Subproject commit a4d399b0d9584f2cb8700873be7afe67ed8cc305 Subproject commit 2b5bb5417f9dc0aff393bb9131f8bd70f5c51598 include/GlApplication.hpp +3 −1 Changes for include/GlApplication.hpp: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ #include <memory> #include "RenderObject.hpp" #include "model/Missile.hpp" #include "model/Player.hpp" #include "model/Spaceship.hpp" Loading @@ -32,6 +33,8 @@ class GlApplication : public Application { enum ModelKeys { SPACESHIP_1, SPACESHIP_2, LASER_1, LASER_2, PLANKS, TRON }; Loading @@ -48,7 +51,6 @@ class GlApplication : public Application { void processPlayer1Input(GLFWwindow *window, float deltaTime); void processPlayer2Input(GLFWwindow *window, float deltaTime); private: std::map<ModelKeys, std::vector<std::shared_ptr<Entity>>> m_entities; ///< objects to render std::map<ModelKeys, std::unique_ptr<RenderObject>> m_models; ///< loaded models Loading include/model/Entity.hpp +3 −1 Changes for include/model/Entity.hpp: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -14,13 +14,15 @@ class Entity { public: Entity(); virtual void update(const double &time); virtual void update(const float &time); glm::mat4 getModelMatrix() const; glm::vec3 get_x_axis() const; glm::vec3 get_y_axis() const; glm::vec3 get_z_axis() const; glm::quat get_rotation() const; glm::vec3 get_position() const; void move(glm::vec3 translation); Loading include/model/Missile.hpp 0 → 100644 +18 −0 Changes for include/model/Missile.hpp: 18 added lines, 0 removed lines. Original line number Diff line number Diff line #pragma once #include "glm/glm.hpp" #include "model/Entity.hpp" #define MISSILE_SPEED 30.0 #define MISSILE_COOLDOWN 0.3 class Missile : public Entity { private: public: Missile(const Entity* const shotBy); ~Missile(); void update(const float &deltaTime) override; }; Loading
CMakeLists.txt +1 −1 Changes for CMakeLists.txt: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -18,5 +18,5 @@ include_directories("glitter/ext/tinyobjloader" ${OPENGL_INCLUDE_DIR}) add_executable(GLE-test src/main.cpp src/RenderObject.cpp src/RenderObjectPart.cpp src/GlApplication.cpp src/model/Spaceship.cpp src/model/Entity.cpp) src/model/Spaceship.cpp src/model/Entity.cpp src/model/Missile.cpp) target_link_libraries(GLE-test utils ${GLFW3_LIBRARIES} ${GLEW_LIBRARIES})
glitter @ 2b5bb541 Compare a4d399b0 to 2b5bb541 Changes for glitter: 1 added line, 1 removed line. Original line number Diff line number Diff line Subproject commit a4d399b0d9584f2cb8700873be7afe67ed8cc305 Subproject commit 2b5bb5417f9dc0aff393bb9131f8bd70f5c51598
include/GlApplication.hpp +3 −1 Changes for include/GlApplication.hpp: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ #include <memory> #include "RenderObject.hpp" #include "model/Missile.hpp" #include "model/Player.hpp" #include "model/Spaceship.hpp" Loading @@ -32,6 +33,8 @@ class GlApplication : public Application { enum ModelKeys { SPACESHIP_1, SPACESHIP_2, LASER_1, LASER_2, PLANKS, TRON }; Loading @@ -48,7 +51,6 @@ class GlApplication : public Application { void processPlayer1Input(GLFWwindow *window, float deltaTime); void processPlayer2Input(GLFWwindow *window, float deltaTime); private: std::map<ModelKeys, std::vector<std::shared_ptr<Entity>>> m_entities; ///< objects to render std::map<ModelKeys, std::unique_ptr<RenderObject>> m_models; ///< loaded models Loading
include/model/Entity.hpp +3 −1 Changes for include/model/Entity.hpp: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -14,13 +14,15 @@ class Entity { public: Entity(); virtual void update(const double &time); virtual void update(const float &time); glm::mat4 getModelMatrix() const; glm::vec3 get_x_axis() const; glm::vec3 get_y_axis() const; glm::vec3 get_z_axis() const; glm::quat get_rotation() const; glm::vec3 get_position() const; void move(glm::vec3 translation); Loading
include/model/Missile.hpp 0 → 100644 +18 −0 Changes for include/model/Missile.hpp: 18 added lines, 0 removed lines. Original line number Diff line number Diff line #pragma once #include "glm/glm.hpp" #include "model/Entity.hpp" #define MISSILE_SPEED 30.0 #define MISSILE_COOLDOWN 0.3 class Missile : public Entity { private: public: Missile(const Entity* const shotBy); ~Missile(); void update(const float &deltaTime) override; };