forked from phisko/kengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelColliderComponent.hpp
More file actions
57 lines (47 loc) · 1.44 KB
/
Copy pathModelColliderComponent.hpp
File metadata and controls
57 lines (47 loc) · 1.44 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Point.hpp"
#ifndef KENGINE_BONE_NAME_MAX_LENGTH
# define KENGINE_BONE_NAME_MAX_LENGTH 64
#endif
#ifndef KENGINE_MAX_MODEL_COLLIDERS
# define KENGINE_MAX_MODEL_COLLIDERS 64
#endif
#include "string.hpp"
#include "vector.hpp"
namespace kengine {
struct ModelColliderComponent {
struct Collider {
static constexpr char stringName[] = "ModelColliderComponentString";
using string = putils::string<KENGINE_BONE_NAME_MAX_LENGTH, stringName>;
enum Shape {
Box,
Capsule,
Cone,
Cylinder,
Sphere
};
Shape shape;
string boneName;
putils::Rect3f boundingBox = { {}, { 1.f, 1.f, 1.f } };
float yaw = 0.f;
float pitch = 0.f;
float roll = 0.f;
putils_reflection_class_name(ModelColliderComponentCollider);
putils_reflection_attributes(
putils_reflection_attribute(&Collider::shape),
putils_reflection_attribute(&Collider::boneName),
putils_reflection_attribute(&Collider::boundingBox),
putils_reflection_attribute(&Collider::yaw),
putils_reflection_attribute(&Collider::pitch),
putils_reflection_attribute(&Collider::roll)
);
};
static constexpr char vectorName[] = "ModelColliderComponentVector";
using vector = putils::vector<Collider, KENGINE_MAX_MODEL_COLLIDERS, vectorName>;
vector colliders;
putils_reflection_class_name(ModelColliderComponent);
putils_reflection_attributes(
putils_reflection_attribute(&ModelColliderComponent::colliders)
);
};
}