Skip to content

Commit 3505178

Browse files
committed
GPU Display: Add option to change FOV
1 parent 1bd4d47 commit 3505178

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

GPU/GPUTracking/display/GPUDisplay.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ int GPUDisplay::DrawGLScene_internal(bool mixAnimation, float mAnimateTime)
14711471
mXadd = mZadd = 0;
14721472
mCamLookOrigin = mCamYUp = false;
14731473
mAngleRollOrigin = -1e9;
1474+
mFOV = 45.f;
14741475

14751476
mResetScene = 0;
14761477
} else {
@@ -1829,7 +1830,7 @@ int GPUDisplay::DrawGLScene_internal(bool mixAnimation, float mAnimateTime)
18291830
#endif
18301831

18311832
{
1832-
const hmm_mat4 proj = HMM_Perspective(45.0f, (GLfloat)mScreenwidth / (GLfloat)mScreenheight, 0.1f, 1000.0f);
1833+
const hmm_mat4 proj = HMM_Perspective(mFOV, (GLfloat)mScreenwidth / (GLfloat)mScreenheight, 0.1f, 1000.0f);
18331834
#ifndef GPUCA_DISPLAY_OPENGL_CORE
18341835
CHKERR(glMatrixMode(GL_PROJECTION));
18351836
CHKERR(glLoadMatrixf(&proj.Elements[0][0]));
@@ -2048,6 +2049,8 @@ int GPUDisplay::DrawGLScene_internal(bool mixAnimation, float mAnimateTime)
20482049
glColor4f(1, 1, 1, 0);
20492050
CHKERR(glDisable(GL_TEXTURE_2D));
20502051
setDepthBuffer();
2052+
#else
2053+
GPUWarning("Image mixing unsupported in OpenGL CORE profile");
20512054
#endif
20522055
}
20532056

GPU/GPUTracking/display/GPUDisplay.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ class GPUDisplay
294294
bool mCamLookOrigin = false;
295295
bool mCamYUp = false;
296296
int mCameraMode = 0;
297+
float mFOV = 45.f;
297298

298299
float mAngleRollOrigin = -1e9;
299300
float mMaxClusterZ = 0;

GPU/GPUTracking/display/GPUDisplayKeys.cxx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,25 @@ const char* HelpText[] = {
4141
"[t] / [T] Take Screenshot / Record Animation to pictures",
4242
"[Z] Change screenshot resolution (scaling factor)",
4343
"[S] / [A] / [D] Enable or disable smoothing of points / smoothing of lines / depth buffer",
44-
"[W] / [U] / [V] Toggle anti-aliasing (MSAA at raster level / change downsampling FSAA facot / toggle VSync",
44+
"[W] / [U] / [V] Toggle anti-aliasing (MSAA at raster level / change downsampling FSAA factor) / toggle VSync",
4545
"[F] / [_] / [R] Switch mFullScreen / Maximized window / FPS rate limiter",
4646
"[I] Enable / disable GL indirect draw",
4747
"[o] / [p] / [O] / [P] Save / restore current camera position / Animation path",
4848
"[h] Print Help",
4949
"[H] Show info texts",
5050
"[w] / [s] / [a] / [d] Zoom / Strafe Left and Right",
51-
"[pgup] / [pgdn] Strafe Up and Down",
52-
"[e] / [f] Rotate",
53-
"[+] / [-] Make points thicker / fainter (Hold SHIFT for lines)",
51+
"[pgup] / [pgdn] Strafe up / down",
52+
"[e] / [f] Rotate left / right",
53+
"[+] / [-] Increase / decrease point size (Hold SHIFT for lines)",
54+
"[b] Change FOV (field of view)",
5455
"[MOUSE 1] Look around",
55-
"[MOUSE 2] Shift camera",
56+
"[MOUSE 2] Strafe camera",
5657
"[MOUSE 1+2] Zoom / Rotate",
5758
"[SHIFT] Slow Zoom / Move / Rotate",
5859
"[ALT] / [CTRL] / [m] Focus camera on origin / orient y-axis upwards (combine with [SHIFT] to lock) / Cycle through modes",
5960
"[1] ... [8] / [N] Enable display of clusters, preseeds, seeds, starthits, tracklets, tracks, global tracks, merged tracks / Show assigned clusters in colors"
6061
"[F1] / [F2] Enable / disable drawing of TPC / TRD"
61-
// FREE: b
62+
// FREE: none
6263
// Test setting: # --> mHideUnmatchedClusters
6364
};
6465

@@ -175,6 +176,11 @@ void GPUDisplay::HandleKeyRelease(unsigned char key)
175176
mMarkFakeClusters ^= 1;
176177
SetInfo("Marking fake clusters: %s", mMarkFakeClusters ? "on" : "off");
177178
mUpdateDLList = true;
179+
} else if (key == 'b') {
180+
if ((mFOV += 5) > 175) {
181+
mFOV = 5;
182+
}
183+
SetInfo("Set FOV to %f", mFOV);
178184
} else if (key == 'B') {
179185
mMarkAdjacentClusters++;
180186
if (mMarkAdjacentClusters == 5) {

0 commit comments

Comments
 (0)