BoxCollider.h 810 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * 2D Game Engine
  3. * BoxCollider.h:
  4. * Based on pikuma.com 2D game engine in C++ and Lua course
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 15/02/2021.
  8. */
  9. #ifndef GAMEENGINE_BOXCOLLIDER_H
  10. #define GAMEENGINE_BOXCOLLIDER_H
  11. #include <stdint.h>
  12. #include <vector>
  13. #include <glm/glm.hpp>
  14. struct BoxColliderComponent
  15. {
  16. uint32_t width;
  17. uint32_t height;
  18. glm::vec2 offset;
  19. bool isColliding;
  20. explicit BoxColliderComponent(uint32_t width = 0, uint32_t height= 0,
  21. glm::vec2 offset = glm::vec2(0, 0)):width(width), height(height),
  22. offset(offset)
  23. {
  24. this->isColliding = false;
  25. };
  26. };
  27. #endif /* GAMEENGINE_BOXCOLLIDER_H */