Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced a near clip plane setting #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
10 changes: 7 additions & 3 deletions FreeCam/MainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class MainClass : ModBehaviour

private InputMode _storedMode;
private int _fov;
private ICommonCameraAPI _commonCameraAPI;
private int _nearClipPlane;
private ICommonCameraAPI _commonCameraAPI;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really sorry, I can't seem to see why the white space has gone funky :(

Is it because I'm using Windows, perhaps?

private GameObject _hud;
private static MainClass _instance;

Expand Down Expand Up @@ -62,14 +63,17 @@ void OnDestroy()
public override void Configure(IModConfig config)
{
_fov = config.GetSettingsValue<int>("FOV");
ShowPrompts = !config.GetSettingsValue<bool>("Hide Prompts");
_nearClipPlane = config.GetSettingsValue<int>("Near Clip Plane Distance");
ShowPrompts = !config.GetSettingsValue<bool>("Hide Prompts");

// If the mod is currently active we can set these immediately
if (_camera != null)
{
_camera.fieldOfView = _fov;
_owCamera.fieldOfView = _fov;
}
_camera.nearClipPlane = _nearClipPlane;
_owCamera.nearClipPlane = _nearClipPlane;
}
}

private void OnSceneLoaded(Scene scene, LoadSceneMode _)
Expand Down
9 changes: 5 additions & 4 deletions FreeCam/default-config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"enabled": true,
"settings": {
"FOV": 90,
"Hide Prompts": false
}
"settings": {
"FOV": 90,
"Near Clip Plane Distance": 1,
"Hide Prompts": false
}
}