Invert DM cam if reversing (#74)

This commit is contained in:
Jason Wen
2023-05-27 23:59:18 -04:00
committed by GitHub
parent 50a96c9a92
commit 39006f7401
+4 -1
View File
@@ -62,11 +62,14 @@ const char frame_fragment_shader[] =
#endif
mat4 get_driver_view_transform(int screen_width, int screen_height, int stream_width, int stream_height) {
UIState *s = uiState();
const float driver_view_ratio = 2.0;
const float yscale = stream_height * driver_view_ratio / stream_width;
const float xscale = yscale*screen_height/screen_width*stream_width/stream_height;
float xscale_invert = (s->scene.reverse_dm_cam ? -xscale : xscale);
mat4 transform = (mat4){{
xscale, 0.0, 0.0, 0.0,
xscale_invert, 0.0, 0.0, 0.0,
0.0, yscale, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0,