| 77 | } |
| 78 | |
| 79 | void ArcballControls::handleMouseButton(int button, int action, const Eigen::Vector2d& pos) { |
| 80 | switch (action) { |
| 81 | case GLFW_PRESS: |
| 82 | isDragging = true; |
| 83 | dragButton = button; |
| 84 | lastMousePos = pos; |
| 85 | startMousePos = pos; |
| 86 | // Determine operation based on mouse action |
| 87 | currentState = getOpFromAction(button, 0); |
| 88 | if (enableGizmos) |
| 89 | gizmosActive = true; |
| 90 | break; |
| 91 | |
| 92 | case GLFW_RELEASE: |
| 93 | isDragging = false; |
| 94 | dragButton = -1; |
| 95 | currentState = STATE_IDLE; |
| 96 | if (enableGizmos) |
| 97 | gizmosActive = false; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | void ArcballControls::handleMouseMove(const Eigen::Vector2d& pos) { |
| 102 | if (!isDragging) |