You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0bc2987
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: GPU/GPUTracking/display/GPUDisplay.h
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -150,7 +150,7 @@ class GPUDisplay : public GPUDisplayInterface
150
150
};
151
151
152
152
struct animationVector { // Animation point, its time is in mCfgC.animationPoints.values
153
-
float v[8]; // Camera, depending on cfgL.animationMode (setAnimationPoint)
153
+
float v[6]; // Camera: x, y, z, pitch, yaw, roll (as mXYZ, mAngle), independent of the animation mode
154
154
GPUSettingsDisplayLight cfgL; // Settings at the point
155
155
};
156
156
@@ -205,13 +205,14 @@ class GPUDisplay : public GPUDisplayInterface
205
205
void rotateCamera(const float (&angles)[3]); // Yaw, pitch, roll in degrees relative to the view, as the keyboard
206
206
hmm_mat4 cameraRotation(const float (&angles)[3]) const; // Rotation of rotateCamera, applied to the view matrix also for keyboard / mouse
207
207
void resetAnimation();
208
-
void removeAnimationPoint(int32_t i = -1); // -1: the selected one, the last one if none is selected
209
-
void StopAnimation(); // Ends a running animation, camera and settings stay as they are; for changed settings (checkAndApplyConfigChanges), scene reset, changes of the animation points
210
-
void setCameraFromAnimationPoint(const animationVector& p); // Camera stored in the point, as the animation shows it there
211
-
void selectAnimationPoint(int32_t i); // -1: none, otherwise also loads its light settings and camera
212
-
void setAnimationPointsFromGUI(const GPUDisplayMultiSliderValue& points); // New times from the Qt GUI: reorders the points, selection
213
-
void updateAnimationPointsGUI(); // Range end of the GUI multi slider: last time + animationDelay, progress 0 without animation
214
-
void animationViewMatrix(float (&vals)[8], int32_t mode, hmm_mat4& viewMatrix) const; // Camera of interpolated / stored animation values (v[1..8]), as animateCamera
208
+
void removeAnimationPoint(int32_t i = -1); // -1: the selected one, the last one if none is selected
209
+
void StopAnimation(); // Ends a running animation, camera and settings stay as they are; for changed settings (checkAndApplyConfigChanges), scene reset, changes of the animation points
210
+
void setCameraFromAnimationPoint(const animationVector& p); // Camera stored in the point, as the animation shows it there
211
+
void selectAnimationPoint(int32_t i); // -1: none, otherwise also loads its light settings and camera
212
+
void setAnimationPointsFromGUI(const GPUDisplayMultiSliderValue& points); // New times from the Qt GUI: reorders the points, selection
213
+
void updateAnimationPointsGUI(); // Range end of the GUI multi slider: last time + animationDelay, progress 0 without animation
214
+
void animationPointValues(const animationVector& p, int32_t mode, const float* last, float (&vals)[8]); // The 8 interpolated values of the point in this animation mode, angles / quaternion continuous to the values of the previous point (last, nullptr if none)
215
+
void animationViewMatrix(float (&vals)[8], int32_t mode, hmm_mat4& viewMatrix) const; // Camera of interpolated / stored animation values (v[1..8]), as animateCamera
AddVariable(guiDarkMode, int8_t, -1) // Dark mode of the Qt GUI, -1 = not yet set: the GUI reports the system scheme when it starts
42
42
AddVariable(guiScale, float, 1.f) // Scale factor of text and elements of the Qt GUI (on top of the system scaling), Ctrl + mouse wheel / Ctrl + 0 in the GUI
43
43
AddVariable(showConsole, bool, false) // Console shown (^ key): all other keys go to the console
44
+
AddVariable(applyToAllPoints, bool, false) // A change of the animation mode is applied to all animation points
44
45
AddVariable(animationPoints, GPUDisplayMultiSliderValue, GPUDisplayMultiSliderValue()) // Times of the animation points (GPUDisplay::mAnimationVectors) and the selected one, shown in the Qt GUI
45
46
AddVariable(dummy, bool, false) // dummy value to reference for keys that do not change variables
if (mCfgC.applyToAllPoints && oldCfgL.animationMode != mCfgL.animationMode) { // Also for keys; the animation's own changes are in mOldCfg, so this is only user input
255
+
for (auto& p : mAnimationVectors) {
256
+
p.cfgL.animationMode = mCfgL.animationMode;
257
+
}
258
+
}
257
259
if (mCfgC.animationPoints.selected >= 0 && mCfgC.animationPoints.selected < (int32_t)mAnimationVectors.size()) { // Update animation settings of selected point
GUI_LAMBDA("Animation Mode", mCfgL, animationMode, GUI_DROPDOWN_NAMES(ANIMATION_MODE_NAMES_SHORT), guiAssign(val, guiVal); if (!mCfgC.guiPrintInfo) { SetInfo("Animation mode set to %s", ANIMATION_MODE_NAMES_LONG[val].c_str()); }), // clang-format off
182
+
GUI_LAMBDA("Apply to all", mCfgC, applyToAllPoints, GUI_CHECKBOX),
182
183
guiVertical{true},
183
184
GUI_LAMBDA("Points", mCfgC, animationPoints, GUI_MULTI_SLIDER(0.05), setAnimationPointsFromGUI(std::get<GPUDisplayMultiSliderValue>(guiVal));), // clang-format on
static hmm_mat4 lookAtMatrix(const float (&eye)[3], const float (&target)[3]) // HMM_LookAt with y up, z up when looking along y (the cross product with y would be 0)
} else { // Modes of the points differ: blend the cameras of both modes, position linearly, rotation as quaternion, with sin^2 for a smooth start and end
0 commit comments