summaryrefslogtreecommitdiff
path: root/engine-ocean/Game/Systems/Pathfinding/aimovementsystem.h
blob: e880e44f048e33361bd13eea1cf6cf7d87613ab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef AIMOVEMENTSYSTEM_H
#define AIMOVEMENTSYSTEM_H
#include "Game/Components/TransformComponent.h"
#include "Game/Systems/Pathfinding/pathfinder.h"
#include "Game/Systems/system.h"


class AIMovementSystem : public System
{
public:
    AIMovementSystem(std::map<std::string, std::shared_ptr<GameObject>>& dynamic_gameobjects,
                                       std::map<std::string, std::shared_ptr<GameObject>>& rigid_gameobjects);
    void draw() override;
    void update(double deltaTime) override;
    void scrollEvent(double distance) override;
    void mousePosEvent(double xpos, double ypos) override;

private:
    float gravitySimulation(float &initial_v, double deltaTime, float snapshot_time, float gravity);
    TransformComponent* getTransform(std::shared_ptr<GameObject> &go);

    std::map<std::string, std::shared_ptr<GameObject>>& m_dynamic_gameobjects;
    std::map<std::string, std::shared_ptr<GameObject>>& m_rigid_gameobjects;


    float horiz_velocity = .005f;
    float snapshot_time = 0.f;

    std::vector<glm::vec3> m_path;

    //std::shared_ptr<Pathfinder> m_pathfinder;
};

#endif // AIMOVEMENTSYSTEM_H