CommonLibVR
BSOpenVR.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef SKYRIMVR
4 # include "RE/B/BSTArray.h"
5 # include "RE/B/BSTHashMap.h"
6 # include "RE/B/BSVRInterface.h"
7 # include "RE/N/NiNode.h"
8 
9 namespace RE
10 {
11  class BSOpenVR : public BSVRInterface
12  {
13  public:
14  inline static constexpr auto RTTI = RTTI_BSOpenVR;
15 
16  struct Unk238
17  {
18  // members
19  std::uint64_t unk00; // 00
20  std::uint64_t unk08; // 08
21  std::uint64_t unk10; // 10
22  std::uint64_t unk18; // 18
23  std::uint64_t unk20; // 20
24  std::uint64_t unk28; // 28
25  std::uint64_t unk30; // 30
26  std::uint64_t unk38; // 38
27  };
28  static_assert(sizeof(Unk238) == 0x40);
29 
30  // override
31  void InitializeVR() override; // 00
32  void ShutdownVR() override; // 01
33  void PostPresentHandoff() override; // 02
34  void Submit(void* a_directXTextureHandle) override; // 03 - SubmitForEye, except the logic runs for both eyes
35  void SubmitForEye(vr::EVREye a_eye, void* a_directXTextureHandle) override; // 04
36  void SetTrackingSpaceAsStanding() override; // 05 - { VR_GetIVRCompositor_140C57880()->SetTrackingSpace(TrackingUniverseStanding) }
37  void SetTrackingSpaceAsSeated() override; // 06 - { VR_GetIVRCompositor_140C57880()->SetTrackingSpace(TrackingUniverseSeated) }
38  void Unk_07(void) override; // 07
39  void GetProjectionRaw(vr::EVREye a_eEye, float* a_pfLeft, float* a_pfRight, float* a_pfTop, float* a_pfBottom) override; // 08
40  NiTransform* GetEyeToHeadTransform(NiTransform& a_out, bool getRightEye) override; // 09
41  NiTransform* Unk_0A(NiTransform& a_out, bool getRightController, bool a_unk1) override; // 0A
42  void Unk_0B(void) override; // 0B - Process VR events?
43  vr::TrackedDeviceIndex_t GetTrackedDeviceIndexForHMD() override; // 0C - { return vr::k_unTrackedDeviceIndex_Hmd; }
44  vr::TrackedDeviceIndex_t GetTrackedDeviceIndexForHand(bool getRightHand) override; // 0D - { return vrSystem->GetTrackedDeviceIndexForControllerRole(isRightHand + 1); } Can return invalid role if not 0 or 1
45  void TriggerHapticPulse(bool doRightController, float duration) override; // 0E - Trigger haptics for X * 4,000 microseconds (250 = 1 second)
46  void Unk_0F(void) override; // 0F
47  void Unk_10(void) override; // 10
48  void Unk_11(void) override; // 11 - { return 0; }
49  void Unk_12(void) override; // 12
50  void Unk_13() override; // 13
51  NiPointer<NiNode>* GetControllerNode(RE::NiPointer<NiNode>& a_out, Hand a_hand) override; // 14
52  void Unk_15(void) override; // 15 - { return 0; }
53  HMDDeviceType GetHMDDeviceType() override; // 16 - { return hmdDeviceType; }
54  NiPointer<NiNode>* CreateControllerNode(RE::NiPointer<NiNode>& a_out, Hand a_hand) override; // 17
55 
56  static BSOpenVR* GetSingleton();
57 
58  static vr::IVRCompositor* GetIVRCompositor();
59  static vr::IVROverlay* GetIVROverlay(Unk190* a_unk190);
60  static vr::IVRRenderModels* GetIVRRenderModels();
61  static vr::IVRSettings* GetIVRSettings();
62  static vr::IVRSystem* GetIVRSystem();
63 
64  // members
65  vr::IVRSystem* vrSystem; // 208
66  void* unk210; // 210
67  std::uint64_t unk218; // 218
68  std::uint64_t unk220; // 220
69  std::uint64_t unk228; // 228
70  NiPointer<NiSourceTexture> unk230; // 230 - name is SIMPLE_NORMAL_MAP
71  Unk238 unk238[4]; // 238
72  std::uint64_t unk338; // 380
73  std::uint64_t unk340[9]; // 340
74  NiPointer<NiNode> controllerNodes[Hand::kTotal]; // 388 - Cloned for PlayerCharacter's LeftValveIndexControllerNode/RightValveIndexControllerNode
75  HMDDeviceType hmdDeviceType; // 398 - Set by comparing TrackedSystemName to "lighthouse", "oculus" and "holographic". Defaults to "lighthouse" if none match
76  NiTransform eyeToHeadTransform[2]; // 39C - 0 is left eye, 1 is right eye
77  private:
78  KEEP_FOR_RE()
79  };
80  static_assert(sizeof(BSOpenVR) == 0x408);
81 }
82 #endif
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: NiSmartPointer.h:9
constexpr REL::ID GetSingleton(static_cast< std::uint64_t >(10878))
Definition: AbsorbEffect.h:6
constexpr REL::Offset RTTI_BSOpenVR(0x01F5FC78)