Cogs.Core
ClipShapeComponent.h
1#pragma once
2
3#include "Foundation/ComponentModel/Component.h"
4#include "EntityPtr.h"
5
6#include <glm/vec3.hpp>
7
8namespace Cogs::Core {
9
11 enum struct ClipShapeType : uint32_t
12 {
13 None,
14 Cube,
16 };
17
20 {
21 public:
22 static void registerType();
23
26
28 glm::vec3 min = glm::vec3(-1.f);
29
31 glm::vec3 max = glm::vec3(1.f);
32
33 };
34
37 {
38 public:
39 static void registerType();
40
43 };
44
45}
46
47template<> inline Cogs::StringView getName<Cogs::Core::ClipShapeType>() { return "ClipShapeType"; }
48template<> inline Cogs::StringView getName<Cogs::Core::ClipShapeComponent>() { return "ClipShapeComponent"; }
49template<> inline Cogs::StringView getName<Cogs::Core::ClipShapeRefComponent>() { return "ClipShapeRefComponent"; }
Base class for Component instances.
Definition: Component.h:143
Sets up a clipping shape that can be used by multiple entities.
glm::vec3 max
The high-end corner of cube-shapes.
ClipShapeType shape
The basic shape of the clip region.
glm::vec3 min
The low-end corner of cube-shapes.
Component that attaches a ClipShape to an entity.
WeakEntityPtr clipShape
Reference to the clip shape that should clip this entity.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
ClipShapeType
Specifices what kind of shape a clip shape has.
@ InvertedCube
Clip the inside of a cube.
@ None
No clipping at all.
@ Cube
Clip the outside of a cube,.
std::weak_ptr< ComponentModel::Entity > WeakEntityPtr
Weak Smart pointer for Entity access.
Definition: EntityPtr.h:18