Cogs.Core
TeleportNavigationComponent.h
1
2#include "../Core/DynamicComponent.h"
3
4#include "../../Context.h"
5#include "../../EntityDefinition.h"
6
7#include "Foundation/ComponentModel/Component.h"
8
9#include <glm/vec3.hpp>
10#include <glm/fwd.hpp>
11
12#include <vector>
13
14namespace Cogs
15{
16 namespace Core
17 {
18 class TransformComponent;
19 class CameraComponent;
20 class SceneComponent;
21
23 {
24 public:
25 static void registerType();
26 void initialize(Cogs::Core::Context * context);
27 void update();
28 void postUpdate();
29
30 std::string actionTeleport = "Teleport";
31 bool useCoordinate = false;
32 std::shared_ptr<ComponentModel::Entity> aimEntity;
33 glm::vec3 beamOffset = glm::vec3(0, 0, 0);
34 glm::vec3 teleportOffset = glm::vec3(0, 0, 0);
35 glm::quat beamRotation = glm::quat();
36
39
40 private:
41 Context * context = nullptr;
42 EntityPtr beam;
43 EntityPtr destinationMarker;
44 bool wasPressed = false;
45
46 //cache component handles:
47 Cogs::ComponentModel::ComponentHandle navigationTransform;
49 Cogs::ComponentModel::ComponentHandle destinationVisibility;
50 };
51 }
52}
53
54template<> inline Cogs::StringView getName<Cogs::Core::TeleportNavigationComponent>() { return "TeleportNavigationComponent"; }
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Base class for components implementing dynamic behavior.
float defaultPickingRadius
Default distance an object can be from a ray to be considered hit.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
std::shared_ptr< ComponentModel::Entity > EntityPtr
Smart pointer for Entity access.
Definition: EntityPtr.h:12
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Handle to a Component instance.
Definition: Component.h:67