diff options
author | jjesswan <jessica_wan@brown.edu> | 2024-04-22 21:56:26 -0400 |
---|---|---|
committer | jjesswan <jessica_wan@brown.edu> | 2024-04-22 21:56:26 -0400 |
commit | a556b45abf18f1bd509daaf63b66b7d55e9fd291 (patch) | |
tree | bc9b8a2d184c12aee236e7f9f276a34b84ca552d /engine-ocean/Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.h | |
parent | cd7c76017a12bb548036571c1ff13e551369d06d (diff) |
add engine version
Diffstat (limited to 'engine-ocean/Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.h')
-rw-r--r-- | engine-ocean/Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/engine-ocean/Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.h b/engine-ocean/Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.h new file mode 100644 index 0000000..8beca39 --- /dev/null +++ b/engine-ocean/Game/Systems/CollisionSystems/environmentcollisiondetectionsystem.h @@ -0,0 +1,43 @@ +#ifndef ENVIRONMENTCOLLISIONDETECTIONSYSTEM_H +#define ENVIRONMENTCOLLISIONDETECTIONSYSTEM_H + + +#include "Game/Components/CollisionComponents/CollisionComponent.h" +#include "Game/Components/TransformComponent.h" +#include "Game/Systems/CollisionSystems/ellipsoidtrianglecollisionsystem.h" +#include <memory> +#include "Game/Systems/system.h" + +class EnvironmentCollisionDetectionSystem /*: public System*/ +{ +public: + EnvironmentCollisionDetectionSystem( + std::map<std::string, std::shared_ptr<GameObject>>& dynamic_gameobjects, + std::map<std::string, std::shared_ptr<GameObject>>& rigid_gameobjects, + std::map<std::string, std::vector<std::shared_ptr<GameObject>>>& lootables, + std::map<std::string, BlackboardData>& global_blackboard); + void draw() ; + void update(double deltaTime); + void scrollEvent(double distance); + void mousePosEvent(double xpos, double ypos) ; + + +private: + void detectCollisionWithEnvironment(double deltaTime); + CollisionComponent* getCollisionComp(std::shared_ptr<GameObject> &go); + TransformComponent* getTransform(std::shared_ptr<GameObject> &go); + + void collideDynamic(std::string go_name, std::shared_ptr<GameObject> go); + + + std::map<std::string, std::shared_ptr<GameObject>>& m_dynamic_gameobjects; + std::unique_ptr<EllipsoidTriangleCollisionSystem> m_ellipsoid_triangle_collision_system; + //std::unique_ptr<BVHTree> m_bvh_system; + std::vector<std::shared_ptr<GameObject>> all_rigid_go; + std::map<std::string, BlackboardData>& m_global_blackboard; + + std::map<std::string, std::vector<std::shared_ptr<GameObject>>>& m_lootables; + +}; + +#endif // ENVIRONMENTCOLLISIONDETECTIONSYSTEM_H |