mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-20 01:02:07 +08:00
Invert DM cam if reversing (#74)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user