
Added "Controlled" mesh classes Added Global Lighting Class Added Gamepad controls Split terrain nodes into Height and Perlin classes Fixed Splitmesh node stuff
28 lines
765 B
C++
28 lines
765 B
C++
#pragma once
|
|
#include <set>
|
|
#include "Core.h"
|
|
#include "DirectXCore.h"
|
|
#include <XInput.h>
|
|
#pragma comment(lib, "XInput.lib")
|
|
|
|
enum class ControlInputs { Forward, Back, TurnLeft, TurnRight, StrafeLeft, StrafeRight, Up, Down, Fire1, Fire2 };
|
|
|
|
class GamePadController
|
|
{
|
|
public:
|
|
GamePadController();
|
|
~GamePadController();
|
|
void ProcessGameController(set<ControlInputs>& currentInputs, bool &boostHit);
|
|
|
|
private:
|
|
XINPUT_STATE _controllerState;
|
|
DWORD _lastPacketNumber;
|
|
bool _firstTime;
|
|
|
|
// These two values are used to avoid having to calculate square roots (which are very time consuming)
|
|
// when we are checking if the movement of the left or right thumb stick is in the dead zone
|
|
DWORD _leftThumbDeadZoneSquared;
|
|
DWORD _rightThumbDeadZoneSquared;
|
|
};
|
|
|