Tramway SDK
player.h
Go to the documentation of this file.
1// Tramway Drifting and Dungeon Exploration Simulator SDK Runtime
2
3#ifndef TRAM_SDK_COMPONENTS_PLAYERCOMPONENT_H
4#define TRAM_SDK_COMPONENTS_PLAYERCOMPONENT_H
5
6#include <framework/ui.h>
7#include <framework/event.h>
8#include <framework/entity.h>
9
11
12#include <framework/logging.h>
13
14// this is for holding
15// re: for holding what??
16// TODO: find out
17#include <render/render.h>
18#include <framework/message.h>
19
20namespace tram {
21
23public:
24 void EventHandler (Event &event);
25 void Init();
28 void SetControllerComponent (ControllerComponent* comp) { controller = comp; }
29 void Start() {}
30 void SetNoclip(bool value);
31
32 inline quat GetLookRotation() { return look_rotation; }
33 inline vec3 GetDirectionFacing() { return direction_facing; }
34private:
35 EventListener keydown;
36 EventListener keypress;
37 EventListener mouseposition;
38
39 quat look_rotation = {1.0f, 0.0f, 0.0f, 0.0f};
40 vec3 direction_facing = {0.0f, 0.0f, -1.0f};
41
42 bool noclipping = false;
43
44 ControllerComponent* controller = nullptr;
45};
46
47}
48
49#endif // TRAM_SDK_COMPONENTS_PLAYERCOMPONENT_H
Provides an API for character controllers.
Definition: controller.h:15
Component base class.
Definition: entitycomponent.h:16
Smart wrapper class for Event listeners.
Definition: event.h:69
Translates keyboard/mouse inputs into inputs for ControllerComponent.
Definition: player.h:22
vec3 GetDirectionFacing()
Definition: player.h:33
~PlayerComponent()
Definition: player.cpp:35
void EventHandler(Event &event)
Definition: player.cpp:44
void SetControllerComponent(ControllerComponent *comp)
Definition: player.h:28
void SetNoclip(bool value)
Definition: player.cpp:39
void Start()
Definition: player.h:29
quat GetLookRotation()
Definition: player.h:32
PlayerComponent()
Definition: player.cpp:25
void Init()
Initializes an entity component.
Definition: player.cpp:29
Serialization, i.e.
glm::vec3 vec3
Definition: math.h:11
glm::quat quat
Definition: math.h:12
Event data.
Definition: event.h:24