Cogs.Core
CollisionComponent.h
1#pragma once
2
3#include "Resources/Resources.h"
4
5#include "Foundation/ComponentModel/Component.h"
6
7#include <glm/vec3.hpp>
8
9class btCollisionShape;
10
11namespace Cogs
12{
13 namespace Core
14 {
16 {
17 public:
18 static void registerType();
19
20 btCollisionShape * collisionShape = nullptr;
21 };
22
24 {
25 public:
26 static void registerType();
27 };
28
30 {
31 public:
32 static void registerType();
33
34 float radius = 1;
35 };
36
38 {
39 public:
40 static void registerType();
41
42 glm::vec3 halfSize = { 1, 1, 1 };
43 };
44
46 {
47 public:
48 static void registerType();
49
50 float height = 1.0f;
51 float radius = 1.0f;
52 };
53
55 {
56 public:
57 static void registerType();
58
59 float height = 1.0f;
60 float radius = 1.0f;
61 };
62
64 {
65 public:
66 static void registerType();
67 };
68
70 {
71 public:
72 static void registerType();
73
76 };
77 }
78}
79
80template<> inline Cogs::StringView getName<Cogs::Core::CollisionComponent>() { return "CollisionComponent"; }
81template<> inline Cogs::StringView getName<Cogs::Core::PlaneCollisionComponent>() { return "PlaneCollisionComponent"; }
82template<> inline Cogs::StringView getName<Cogs::Core::SphereCollisionComponent>() { return "SphereCollisionComponent"; }
83template<> inline Cogs::StringView getName<Cogs::Core::BoxCollisionComponent>() { return "BoxCollisionComponent"; }
84template<> inline Cogs::StringView getName<Cogs::Core::CapsuleCollisionComponent>() { return "CapsuleCollisionComponent"; }
85template<> inline Cogs::StringView getName<Cogs::Core::CylinderCollisionComponent>() { return "CylinderCollisionComponent"; }
86template<> inline Cogs::StringView getName<Cogs::Core::EmptyCollisionComponent>() { return "EmptyCollisionComponent"; }
87template<> inline Cogs::StringView getName<Cogs::Core::MeshCollisionComponent>() { return "MeshCollisionComponent"; }
Base class for Component instances.
Definition: Component.h:143
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
static const ResourceHandle_t NoHandle
Handle representing a default (or none if default not present) resource.