Cogs.Core
GhostComponent.h
1#pragma once
2
3#include "EntityDefinition.h"
4
5#include "Foundation/ComponentModel/Component.h"
6
7#include <glm/vec3.hpp>
8
9#include <vector>
10
11namespace Cogs
12{
13 namespace Core
14 {
15
17 {
18 WeakEntityPtr entityB;
19 glm::vec3 worldNormalOnA;
20 glm::vec3 worldPositionOnA; // worldPositionOnB = worldPositionOnA + worldNormalOnA * distance
21 float depth;
22 };
23
25 {
26 enum {
27 ApplyImpulse
28 } type;
29 WeakEntityPtr target;
30 glm::vec3 value;
31 glm::vec3 position;
32 };
33
35 {
36 public:
38 static void registerType();
39
40
41 std::vector<GhostContact> contacts;
42 std::vector<GhostAction> actions;
43
44 };
45 }
46}
47
48template<> inline Cogs::StringView getName<Cogs::Core::GhostComponent>() { return "GhostComponent"; }
Base class for Component instances.
Definition: Component.h:143
static void registerType()
Register the type in the type system.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
std::weak_ptr< ComponentModel::Entity > WeakEntityPtr
Weak Smart pointer for Entity access.
Definition: EntityPtr.h:18
Contains all Cogs related functionality.
Definition: FieldSetter.h:23