mirror of
https://gitea.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-11-22 18:39:47 +00:00
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
33
src/platform/input/Controller.h
Executable file
33
src/platform/input/Controller.h
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef CONTROLLER_H__
|
||||
#define CONTROLLER_H__
|
||||
|
||||
#include "../log.h"
|
||||
|
||||
class Controller
|
||||
{
|
||||
public:
|
||||
static const int NUM_STICKS = 2;
|
||||
static const int STATE_TOUCH = 1;
|
||||
static const int STATE_RELEASE = 0;
|
||||
static const int STATE_MOVE =-1;
|
||||
|
||||
static bool isTouched(int stickIndex);
|
||||
|
||||
static void feed(int stickIndex, int state, float dx, float dy);
|
||||
|
||||
static float getX(int stickIndex);
|
||||
static float getY(int stickIndex);
|
||||
|
||||
static float getTransformedX(int stickIndex, float deadZone, float scale=1.0f, bool limit1=false);
|
||||
static float getTransformedY(int stickIndex, float deadZone, float scale=1.0f, bool limit1=false);
|
||||
|
||||
private:
|
||||
static bool isValidStick(int stick);
|
||||
static float linearTransform(float value, float deadZone, float scale=1.0f, bool limit1=false);
|
||||
|
||||
static float stickValuesX[NUM_STICKS];
|
||||
static float stickValuesY[NUM_STICKS];
|
||||
static bool isTouchedValues[NUM_STICKS];
|
||||
};
|
||||
|
||||
#endif /*CONTROLLER_H__*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue