-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputComponent.h
36 lines (31 loc) · 1.14 KB
/
InputComponent.h
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
#pragma once
#include "MoveComponent.h"
class InputComponent : public MoveComponent
{
public:
InputComponent(class Actor* owner);
void ProcessInput(const uint8_t* keyState) override;
// Getters/setters for private variables
float GetMaxForward() const { return mMaxForwardSpeed; }
float GetMaxAngular() const { return mMaxAngularSpeed; }
int GetForwardKey() const { return mForwardKey; }
int GetBackKey() const { return mBackKey; }
int GetClockwiseKey() const { return mClockwiseKey; }
int GetCounterClockwiseKey() const { return mCounterClockwiseKey; }
void SetMaxForwardSpeed(float speed) { mMaxForwardSpeed = speed; }
void SetMaxAngularSpeed(float speed) { mMaxAngularSpeed = speed; }
void SetForwardKey(int key) { mForwardKey = key; }
void SetBackKey(int key) { mBackKey = key; }
void SetClockwiseKey(int key) { mClockwiseKey = key; }
void SetCounterClockwiseKey(int key) { mCounterClockwiseKey = key; }
private:
// The maximum forward/angular speed
float mMaxForwardSpeed;
float mMaxAngularSpeed;
// Keys for forward/back movement
int mForwardKey;
int mBackKey;
// Keys for angular movement
int mClockwiseKey;
int mCounterClockwiseKey;
};