1234567891011121314151617181920212223242526272829303132333435 |
- /*
- * 2D Game Engine
- * BoxCollider.h:
- * Based on pikuma.com 2D game engine in C++ and Lua course
- * Copyright (c) 2021 986-Studio. All rights reserved.
- *
- * Created by Manoël Trapier on 15/02/2021.
- */
- #ifndef GAMEENGINE_BOXCOLLIDER_H
- #define GAMEENGINE_BOXCOLLIDER_H
- #include <stdint.h>
- #include <vector>
- #include <glm/glm.hpp>
- struct BoxColliderComponent
- {
- uint32_t width;
- uint32_t height;
- glm::vec2 offset;
- bool isColliding;
- std::vector<Entity>collidingList;
- explicit BoxColliderComponent(uint32_t width = 0, uint32_t height= 0,
- glm::vec2 offset = glm::vec2(0, 0)):width(width), height(height),
- offset(offset)
- {
- this->isColliding = false;
- this->collidingList.clear();
- };
- };
- #endif /* GAMEENGINE_BOXCOLLIDER_H */
|