forked from Prof-Butts/Hook_XWACockpitLook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SharedMem.h
42 lines (36 loc) · 1.33 KB
/
SharedMem.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
37
38
39
40
41
42
#pragma once
#include <windows.h>
#include "SharedMemTemplate.h"
struct SharedMemDataCockpitLook {
// Offset added to the current POV when VR is active. This is controlled by ddraw
float POVOffsetX, POVOffsetY, POVOffsetZ;
// Euler angles, in degrees, for the current camera matrix coming from SteamVR. This is
// written by CockpitLookHook:
float Yaw, Pitch, Roll;
// Positional tracking data. Written by CockpitLookHook:
float X, Y, Z;
// Flag to indicate that the reticle needs setup, to inhibit tracking and avoid roll messing with
// the pips positions.
// Set to 0 by ddraw when the game starts a mission (in OnSizeChanged())
// Set to 1 by a hook in the SetupReticle() XWA function.
int bIsReticleSetup;
// XWA units to meters conversion factor. Set by CockpitLook. Used to apply POVOffset
float povFactor;
SharedMemDataCockpitLook() {
this->POVOffsetX = 0.0f;
this->POVOffsetY = 0.0f;
this->POVOffsetZ = 0.0f;
this->Yaw = 0.0f;
this->Pitch = 0.0f;
this->Roll = 0.0f;
this->X = 0.0f;
this->Y = 0.0f;
this->Z = 0.0f;
this->bIsReticleSetup = 0;
this->povFactor = 25.0f;
}
};
void InitSharedMem();
constexpr auto SHARED_MEM_NAME_COCKPITLOOK = L"Local\\CockpitLookHook";
extern SharedMem<SharedMemDataCockpitLook> g_SharedMem;
extern SharedMemDataCockpitLook* g_SharedData;