feat: Add animated home button to view cube to reset camera
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
class QOpenGLShaderProgram;
|
||||
class QOpenGLTexture;
|
||||
class QPainter;
|
||||
class QSvgRenderer;
|
||||
|
||||
class ViewCube : protected QOpenGLFunctions
|
||||
{
|
||||
@@ -18,6 +20,8 @@ public:
|
||||
|
||||
void initializeGL();
|
||||
void paintGL(QOpenGLShaderProgram* simpleShader, int simpleShaderColorLoc, const QMatrix4x4& viewMatrix, int width, int height, const QPoint& mousePos);
|
||||
void paint2D(QPainter& painter, int widgetWidth, int widgetHeight);
|
||||
bool handleMousePress(const QPoint& pos, int widgetWidth, int widgetHeight);
|
||||
|
||||
private:
|
||||
void createFaceTextures();
|
||||
@@ -26,6 +30,10 @@ private:
|
||||
void drawViewCube(const QMatrix4x4& projection, const QMatrix4x4& view, float opacity);
|
||||
void drawAxes(QOpenGLShaderProgram* simpleShader, int colorLoc, const QMatrix4x4& projection, const QMatrix4x4& view);
|
||||
|
||||
bool m_isHovered = false;
|
||||
QRect m_homeButtonRect;
|
||||
QSvgRenderer* m_homeButtonRenderer = nullptr;
|
||||
|
||||
QOpenGLTexture* m_faceTextures[6];
|
||||
|
||||
QOpenGLShaderProgram* m_textureShaderProgram = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user