Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions L4D2VR/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@ DWORD WINAPI InitL4D2VR(HMODULE hModule)
int nArgs;
szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
bool insecureEnabled = false;
bool insecureIgnored = false;
for (int i = 0; i < nArgs; ++i)
{
if (wcscmp(szArglist[i], L"-insecure") == 0)
insecureEnabled = true;
}
for (int i = 0; i < nArgs; ++i)
{
if (wcscmp(szArglist[i], L"-secure_ignore") == 0)
insecureIgnored = true;
}
LocalFree(szArglist);

if (!insecureEnabled)
ExitProcess(0);
if (!insecureEnabled && !insecureIgnored)
// If not, show a warning to the user
MessageBox(NULL, "-insecure flag not set, this is not recommended.\nAdd -secure_ignore flag to hide warning", "Warning: Running in secure mode!", MB_ICONWARNING | MB_OK);
//ExitProcess(0);

g_Game = new Game();

Expand Down
2 changes: 1 addition & 1 deletion L4D2VR/sdk/sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ class C_BaseEntity : public IClientEntity
virtual void *sub_10019E10() = 0;
virtual void *sub_1001A090() = 0;
virtual void *sub_10019870() = 0;
virtual void *GetViewOffset() = 0;
virtual const Vector& GetViewOffset() = 0;
virtual void *SetViewOffset() = 0;
virtual void *GetGroundVelocityToApply() = 0;
virtual void *ShouldInterpolate() = 0;
Expand Down
6 changes: 6 additions & 0 deletions L4D2VR/vr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ VR::VR(Game *game)
m_Overlay->SetOverlayCurvature(m_MainMenuHandle, 0.15f);
m_Overlay->SetOverlayMouseScale(m_MainMenuHandle, &mouseScaleMenu);

vr::VRCompositor()->SetTrackingSpace(vr::TrackingUniverseStanding);

UpdatePosesAndActions();

m_IsInitialized = true;
Expand Down Expand Up @@ -935,6 +937,7 @@ void VR::UpdateHMDAngles() {
void VR::ResetPosition()
{
m_Center = m_HmdPose.TrackedDevicePos;
m_Center.z = 0;
}

void VR::UpdateTracking()
Expand All @@ -960,6 +963,9 @@ void VR::UpdateTracking()
UpdateHMDAngles();

m_HmdPosRelative = hmdPosCorrected * m_VRScale;
// 64 is the eye view height from the player's base position
// we subtract this here so that we place the HMD height at the actual player height if 6DOF is enabled
m_HmdPosRelative.z -= 64;

// Roomscale setup
/*Vector cameraMovingDirection = m_Center - m_SetupOriginPrev;
Expand Down