// // entity.hpp // engine // // Created by Sam Jaffe on 5/20/19. // Copyright © 2019 Sam Jaffe. All rights reserved. // #pragma once #include #include "game/engine/engine_fwd.hpp" #include "game/graphics/graphics_fwd.h" #include "game/graphics/object.hpp" #include "game/util/identity.hpp" namespace engine { class entity : identity { public: // TODO: Extract this out? entity(Json::Value const & json, graphics::manager const & mgr); void update(float delta); void collide(entity const &); graphics::object const & render_info() const { return render_info_; } private: // The scene that owns this object std::weak_ptr in_scene; // Position info math::vec2 last_position; math::vec2 velocity; math::vec2 acceleration; float angular_velocity; // A mix of position and graphics info graphics::object render_info_; // Graphics info std::size_t frame_index; std::vector frame_texture_coords; float scale; collision_t collides_with; collision_t collides_as; }; }