blob: 3363b84b1d7e07d01b0591a2af185cd9d6e10eab (
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
35
36
37
|
#ifndef CYLINDERCOLLIDER_H
#define CYLINDERCOLLIDER_H
#include "Game/Components/CollisionComponents/BoundingTriangle.h"
#include "Graphics/modeltransform.h"
#include "glm/glm.hpp"
#include "BoundingShape.h"
#include <memory>
struct Cylinder {
glm::vec2 point; // bottom Center
float radius;
// lines
float height;
float min;
float max;
glm::vec3 aabbDimensions;
glm::vec3 aabbCenterPos;
Bounds3f bounds;
};
class CylinderCollider
{
public:
CylinderCollider(glm::vec3 initial_pos, glm::vec3 initial_scale);
Cylinder getCylinder();// override;
void updateCollisionPos(glm::vec3 new_pos);
void updateBounds();
private:
glm::vec3 m_scale;
Cylinder m_cyl;
};
#endif // CYLINDERCOLLIDER_H
|