CommonLibVR
BSGamepadDevice.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSInputDevice.h"
4 #include "RE/B/BSTEvent.h"
5 
6 namespace RE
7 {
8  struct BSGamepadEvent;
9 
11  public BSInputDevice, // 00
12  public BSTEventSource<BSGamepadEvent> // 70
13  {
14  public:
15  inline static constexpr auto RTTI = RTTI_BSGamepadDevice;
16  inline static constexpr auto VTABLE = VTABLE_BSGamepadDevice;
17 
18  struct ColorParam
19  {
20  std::uint32_t r;
21  std::uint32_t g;
22  std::uint32_t b;
23  };
24 
25  ~BSGamepadDevice() override; // 00
26 
27  // override (BSInputDevice)
28  bool IsEnabled() const override; // 07 - { return connected && userIndex != -1; }
29 
30  // add
31  virtual void SetRumble(float a_lValue, float a_rValue) = 0; // 09
32  virtual void SetLEDColor(ColorParam* a_colorParam); // 0A - { return; }
33  virtual void ResetLEDColor(); // 0B - { return; }
34  virtual void IsRemoteController(void); // 0C - { return 0; }
35  virtual void NormalizeThumbstickValue(int a_thumbX, int a_thumbY, float& a_xOut, float& a_yOut); // 0D
36  virtual void DoEnableListeningMode(void); // 0E - { return; }
37 
38  // members
39  std::int32_t userIndex; // C8
40  bool connected; // CC
41  bool listeningForInput; // CD
42  std::uint16_t padCE; // CE
43 
44  protected:
46 
47  private:
48  KEEP_FOR_RE()
49  };
50  static_assert(sizeof(BSGamepadDevice) == 0xD0);
51 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BSGamepadDevice.h:13
static constexpr auto VTABLE
Definition: BSGamepadDevice.h:16
bool IsEnabled() const override
std::uint16_t padCE
Definition: BSGamepadDevice.h:42
virtual void ResetLEDColor()
bool listeningForInput
Definition: BSGamepadDevice.h:41
std::int32_t userIndex
Definition: BSGamepadDevice.h:39
virtual void DoEnableListeningMode(void)
virtual void SetRumble(float a_lValue, float a_rValue)=0
static constexpr auto RTTI
Definition: BSGamepadDevice.h:15
~BSGamepadDevice() override
virtual void IsRemoteController(void)
virtual void NormalizeThumbstickValue(int a_thumbX, int a_thumbY, float &a_xOut, float &a_yOut)
bool connected
Definition: BSGamepadDevice.h:40
virtual void SetLEDColor(ColorParam *a_colorParam)
Definition: BSInputDevice.h:11
Definition: BSTEvent.h:19
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_BSGamepadDevice(static_cast< std::uint64_t >(690309))
constexpr std::array< REL::ID, 1 > VTABLE_BSGamepadDevice
Definition: Offsets_VTABLE.h:9034
Definition: BSGamepadDevice.h:19
std::uint32_t b
Definition: BSGamepadDevice.h:22
std::uint32_t g
Definition: BSGamepadDevice.h:21
std::uint32_t r
Definition: BSGamepadDevice.h:20