-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputComponent.h
More file actions
38 lines (25 loc) · 891 Bytes
/
InputComponent.h
File metadata and controls
38 lines (25 loc) · 891 Bytes
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
#pragma once
#include "MoveComponent.h"
#include <cstdint>
class InputComponent : public MoveComponent
{
public:
InputComponent(class Actor* owner);
void ProcessInput(const std::uint8_t* keyState) override;
// Getters/setter for private vars
void SetMaxAngularSpeed(float speed) { mMaxAngularSpeed = speed; }
float GetMaxAngularSpeed() const { return mMaxAngularSpeed; }
void SetForwardKey(int key) { mForwardKey = key; }
int GetForwardKey() const { return mForwardKey; }
void SetClockwiseKey(int key) { mClockwiseKey = key; }
int GetClockwiseKey() const { return mClockwiseKey; }
void SetCounterClockwiseKey(int key) { mCounterClockwiseKey = key; }
int GetCounterClockwiseKey() const { return mCounterClockwiseKey; }
private:
// max speeds
float mMaxAngularSpeed;
int mForwardKey;
// keys for angular movement
int mClockwiseKey;
int mCounterClockwiseKey;
};