| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // entity.hpp
- // engine
- //
- // Created by Sam Jaffe on 5/20/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include <json/forwards.h>
- #include "game/engine/engine_fwd.hpp"
- #include "game/graphics/object.hpp"
- #include "game/util/identity.hpp"
- namespace engine {
- class scene;
- class entity : identity<entity> {
- public:
- entity(Json::Value const & json);
- void update(tick const & tk);
- private:
- // The scene that owns this object
- std::weak_ptr<scene> 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<math::vec2> frame_texture_coords;
- float scale;
- int collides_with;
- int collides_as;
- };
- }
|