kinsi55 / CS_BeatSaber_Camera2

Adds a lot of options / tools for creating more advanced desktop viewing experiences with multiple camera angles and much more in Beat Saber
MIT License
118 stars 13 forks source link

Unable to manually overflow the ViewPort values #69

Closed pasketi closed 2 years ago

pasketi commented 2 years ago

https://github.com/kinsi55/CS_BeatSaber_Camera2/blob/c1dbcb5893414dd308b5af60e88f01f059d05eb5/Behaviours/CamerasViewport.cs#L20

I'd like to be able to set values outside of the 0-1 range for ViewRect values, is possible. This doesn't need to be possible in-game, but I'd like the configuration to be taken as is, if negative values or values >1 are assigned to the config json manually.

The reason I want this is I want to center the first person camera view in the viewport without having black bars on one side of the screen. Just offsetting the camera location by setting the target position x-value will distort the view too much when using a perspective camera, since the camera will be physically placed on the side. I still want the camera to be directly behind the players head, but the center of the viewRect to be offset in the Viewport.

Example of a valid config:

...
  "orthographic": false,
  "viewRect": {
    "x": -0.2,
    "y": 0.0,
    "width": 1.2,
    "height": 1.0,
    "locked": true
  },
...
kinsi55 commented 2 years ago

I dont fully understand your usecase, can you provide a sample screenshot?

pasketi commented 2 years ago

image

My use case would be to offset the center of the camera view in my viewport without losing perspective. Practically this would give more space on the screen for an avatar or UI

kinsi55 commented 2 years ago

I see. Well, fwiw the code you linked isnt whats preventing you from doing it, but its rather these

https://github.com/kinsi55/CS_BeatSaber_Camera2/blob/c1dbcb5893414dd308b5af60e88f01f059d05eb5/Configuration/CameraSettings.cs#L347-L348

If you know how to / can compile a custom version, remove the Math.Min there and that should be it. Until then, I'll consider it for a future update

kinsi55 commented 2 years ago

Implemented, will be in the next update