mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 11:19:58 -04:00
Compare commits
1 Commits
temp
...
first-person-cam
| Author | SHA1 | Date | |
|---|---|---|---|
| c6d65de5af |
@@ -65,6 +65,9 @@ struct UserSettings {
|
|||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
ConfigVar<bool> enableTurboKeybind;
|
ConfigVar<bool> enableTurboKeybind;
|
||||||
|
|
||||||
|
// VR
|
||||||
|
ConfigVar<bool> vrCamera;
|
||||||
} game;
|
} game;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,10 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
#include "dusk/settings.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include "d/d_debug_pad.h"
|
#include "d/d_debug_pad.h"
|
||||||
#include "d/d_debug_camera.h"
|
#include "d/d_debug_camera.h"
|
||||||
@@ -1355,6 +1359,20 @@ bool dCamera_c::Run() {
|
|||||||
clrFlag(0x1000);
|
clrFlag(0x1000);
|
||||||
mTagCamTool.Clr();
|
mTagCamTool.Clr();
|
||||||
field_0x89c.Clr();
|
field_0x89c.Clr();
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.vrCamera && link != nullptr) {
|
||||||
|
MtxP headMtx = link->getHeadMtx();
|
||||||
|
cXyz headForward(headMtx[0][0], headMtx[1][0], headMtx[2][0]);
|
||||||
|
|
||||||
|
// place eye slightly in front of Link's eye position, looking forward
|
||||||
|
static constexpr f32 EYE_FORWARD_OFFSET = 20.0f;
|
||||||
|
static constexpr f32 CENTER_DISTANCE = 200.0f;
|
||||||
|
mEye = mViewCache.mEye = link->eyePos + headForward * EYE_FORWARD_OFFSET;
|
||||||
|
mCenter = mViewCache.mCenter = mEye + headForward * CENTER_DISTANCE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return sp0F;
|
return sp0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,15 @@ namespace dusk {
|
|||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginMenu("VR")) {
|
||||||
|
config::ImGuiCheckbox("VR Camera", getSettings().game.vrCamera);
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
ImGui::SetTooltip("Places the camera at Link's eyes, facing where his head points");
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ UserSettings g_userSettings = {
|
|||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
.enableTurboKeybind {"game.enableTurboKeybind", true},
|
.enableTurboKeybind {"game.enableTurboKeybind", true},
|
||||||
|
|
||||||
|
.vrCamera {"game.vrCamera", false}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -95,6 +97,7 @@ void registerSettings() {
|
|||||||
Register(g_userSettings.game.midnasLamentNonStop);
|
Register(g_userSettings.game.midnasLamentNonStop);
|
||||||
Register(g_userSettings.game.enableTurboKeybind);
|
Register(g_userSettings.game.enableTurboKeybind);
|
||||||
Register(g_userSettings.game.fastSpinner);
|
Register(g_userSettings.game.fastSpinner);
|
||||||
|
Register(g_userSettings.game.vrCamera);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transient settings
|
// Transient settings
|
||||||
|
|||||||
Reference in New Issue
Block a user