Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
ColliderComponent.hpp
1#pragma once
2
3#include <bullet/btBulletCollisionCommon.h>
4#include "Common/Math.hpp"
5#include "EngineCore/ECS/Entity.hpp"
6#include "EngineCore/Reflection/ComponentReflection.hpp"
7
8namespace Grindstone::Physics {
10 virtual void Initialize() = 0;
11
12 btCollisionShape* collisionShape = nullptr;
13 };
14
15
17 virtual void Initialize() override;
18 virtual void SetRadius(float radius);
19 virtual float GetRadius() const;
20 private:
21 float radius = 0.0f;
22
23 REFLECT("SphereCollider")
24 };
25
27 virtual void Initialize() override;
28 virtual void SetCollider(Math::Float3 planeNormal, float positionAlongNormal);
29 virtual Math::Float3 GetPlaneNormal() const;
30 virtual float GetPositionAlongNormal() const;
31 private:
32 Math::Float3 planeNormal;
33 float positionAlongNormal;
34
35 REFLECT("PlaneCollider")
36 };
37
39 virtual void Initialize() override;
40 virtual void SetSize(Math::Float3);
41 virtual Math::Float3 GetSize() const;
42 private:
43 Math::Float3 size;
44
45 REFLECT("BoxCollider")
46 };
47
49 virtual void Initialize() override;
50 virtual void SetCollider(float radius, float height);
51 virtual float GetRadius() const;
52 virtual float GetHeight() const;
53 private:
54 float radius;
55 float height;
56
57 REFLECT("CapsuleCollider")
58 };
59}
Definition FloatVectors.cs:108
Definition ColliderComponent.hpp:38
Definition ColliderComponent.hpp:48
Definition ColliderComponent.hpp:9
Definition ColliderComponent.hpp:26
Definition ColliderComponent.hpp:16