diff --git a/cpp/modmesh/view/R3DWidget.cpp b/cpp/modmesh/view/R3DWidget.cpp index 0716cd76..4471dae0 100644 --- a/cpp/modmesh/view/R3DWidget.cpp +++ b/cpp/modmesh/view/R3DWidget.cpp @@ -41,7 +41,7 @@ R3DWidget::R3DWidget(Qt3DExtras::Qt3DWindow * window, RScene * scene, QWidget * { m_view->setRootEntity(m_scene); - resetCamera(m_view->camera()); + resetCamera(); if (Toggle::instance().fixed().get_show_axis()) { @@ -99,14 +99,13 @@ void R3DWidget::resizeEvent(QResizeEvent * event) m_container->resize(event->size()); } -void R3DWidget::resetCamera(Qt3DRender::QCamera * camera, - float positionX, - float positionY, - float positionZ) +void R3DWidget::resetCamera() const { + Qt3DRender::QCamera * camera = m_view->camera(); + // Set up the camera. camera->lens()->setPerspectiveProjection(45.0f, 16.0f / 9.0f, 0.1f, 1000.0f); - camera->setPosition(QVector3D(positionX, positionY, positionZ)); + camera->setPosition(QVector3D(0.0f, 0.0f, 10.0f)); camera->setViewCenter(QVector3D(0.0f, 0.0f, 0.0f)); camera->setUpVector(QVector3D(0.f, 1.f, 0.f)); diff --git a/cpp/modmesh/view/R3DWidget.hpp b/cpp/modmesh/view/R3DWidget.hpp index c30ef8f9..8727ad4a 100644 --- a/cpp/modmesh/view/R3DWidget.hpp +++ b/cpp/modmesh/view/R3DWidget.hpp @@ -100,10 +100,7 @@ class R3DWidget Qt3DExtras::QAbstractCameraController * qtCameraController() { return m_scene->controller(); } CameraController * cameraController() { return dynamic_cast(m_scene->controller()); } - void resetCamera(Qt3DRender::QCamera * camera, - float positionX = 0.0f, - float positionY = 0.0f, - float positionZ = 10.0f); + void resetCamera() const; QPixmap grabPixmap() const { return m_view->screen()->grabWindow(m_view->winId()); } diff --git a/cpp/modmesh/view/RCameraController.cpp b/cpp/modmesh/view/RCameraController.cpp index 97a9b2f1..77774f85 100644 --- a/cpp/modmesh/view/RCameraController.cpp +++ b/cpp/modmesh/view/RCameraController.cpp @@ -56,11 +56,13 @@ RCameraInputListener::RCameraInputListener( , m_right_mouse_button_action(new Qt3DInput::QAction) , m_shift_button_action(new Qt3DInput::QAction) , m_alt_button_action(new Qt3DInput::QAction) + , m_ctrl_button_action(new Qt3DInput::QAction) , m_left_mouse_button_input(new Qt3DInput::QActionInput) , m_middle_mouse_button_input(new Qt3DInput::QActionInput) , m_right_mouse_button_input(new Qt3DInput::QActionInput) , m_shift_button_input(new Qt3DInput::QActionInput) , m_alt_button_input(new Qt3DInput::QActionInput) + , m_ctrl_button_input(new Qt3DInput::QActionInput) , m_mouse_rx_input(new Qt3DInput::QAnalogAxisInput) , m_mouse_ry_input(new Qt3DInput::QAnalogAxisInput) , m_mouse_tz_x_input(new Qt3DInput::QAnalogAxisInput) @@ -80,13 +82,14 @@ RCameraInputListener::RCameraInputListener( this, [this](const float dt) { - Qt3DExtras::QAbstractCameraController::InputState state{}; + CameraInputState state{}; + const bool isCtrlPressed = m_ctrl_button_action->isActive(); state.rxAxisValue = m_rx_axis->value(); state.ryAxisValue = m_ry_axis->value(); state.txAxisValue = m_tx_axis->value(); - state.tyAxisValue = m_ty_axis->value(); - state.tzAxisValue = m_tz_axis->value(); + state.tyAxisValue = isCtrlPressed ? 0.0f : m_ty_axis->value(); + state.tzAxisValue = (isCtrlPressed ? m_ty_axis->value() : 0.0f) + m_tz_axis->value(); state.leftMouseButtonActive = m_left_mouse_button_action->isActive(); state.middleMouseButtonActive = m_middle_mouse_button_action->isActive(); @@ -109,6 +112,7 @@ void RCameraInputListener::init() m_logical_device->addAction(m_right_mouse_button_action); m_logical_device->addAction(m_alt_button_action); m_logical_device->addAction(m_shift_button_action); + m_logical_device->addAction(m_ctrl_button_action); m_logical_device->addAxis(m_rx_axis); m_logical_device->addAxis(m_ry_axis); @@ -178,6 +182,11 @@ void RCameraInputListener::initKeyboardListeners() const m_alt_button_input->setSourceDevice(m_keyboard_device); m_alt_button_action->addInput(m_alt_button_input); + // ctrl button - On Windows Ctrl key, on Macs Cmd key + m_ctrl_button_input->setButtons(QList{Qt::Key_Control}); + m_ctrl_button_input->setSourceDevice(m_keyboard_device); + m_ctrl_button_action->addInput(m_ctrl_button_input); + // keyboard positive x translation m_keyboard_tx_pos_input->setButtons(QList{Qt::Key_D, Qt::Key_Right}); m_keyboard_tx_pos_input->setScale(1.0f); @@ -185,17 +194,11 @@ void RCameraInputListener::initKeyboardListeners() const m_tx_axis->addInput(m_keyboard_tx_pos_input); // keyboard positive y translation - m_keyboard_ty_pos_input->setButtons(QList{Qt::Key_E, Qt::Key_PageUp}); + m_keyboard_ty_pos_input->setButtons(QList{Qt::Key_W, Qt::Key_Up}); m_keyboard_ty_pos_input->setScale(1.0f); m_keyboard_ty_pos_input->setSourceDevice(m_keyboard_device); m_ty_axis->addInput(m_keyboard_ty_pos_input); - // keyboard positive z translation - m_keyboard_tz_pos_input->setButtons(QList{Qt::Key_W, Qt::Key_Up}); - m_keyboard_tz_pos_input->setScale(1.0f); - m_keyboard_tz_pos_input->setSourceDevice(m_keyboard_device); - m_tz_axis->addInput(m_keyboard_tz_pos_input); - // keyboard negative x translation m_keyboard_tx_neg_input->setButtons(QList{Qt::Key_A, Qt::Key_Left}); m_keyboard_tx_neg_input->setScale(-1.0f); @@ -203,22 +206,16 @@ void RCameraInputListener::initKeyboardListeners() const m_tx_axis->addInput(m_keyboard_tx_neg_input); // keyboard negative y translation - m_keyboard_ty_neg_input->setButtons(QList{Qt::Key_Q, Qt::Key_PageDown}); + m_keyboard_ty_neg_input->setButtons(QList{Qt::Key_S, Qt::Key_Down}); m_keyboard_ty_neg_input->setScale(-1.0f); m_keyboard_ty_neg_input->setSourceDevice(m_keyboard_device); m_ty_axis->addInput(m_keyboard_ty_neg_input); - - // keyboard negative z translation - m_keyboard_tz_neg_input->setButtons(QList{Qt::Key_S, Qt::Key_Down}); - m_keyboard_tz_neg_input->setScale(-1.0f); - m_keyboard_tz_neg_input->setSourceDevice(m_keyboard_device); - m_tz_axis->addInput(m_keyboard_tz_neg_input); } RFirstPersonCameraController::RFirstPersonCameraController(QNode * parent) : QFirstPersonCameraController(parent) { - auto callback = [this](const InputState & state, const float dt) + auto callback = [this](const CameraInputState & state, const float dt) { updateCameraPosition(state, dt); }; @@ -226,7 +223,7 @@ RFirstPersonCameraController::RFirstPersonCameraController(QNode * parent) m_listener = new RCameraInputListener(keyboardDevice(), mouseDevice(), callback, this); } -void RFirstPersonCameraController::updateCameraPosition(const InputState & input, const float dt) +void RFirstPersonCameraController::updateCameraPosition(const CameraInputState & input, const float dt) { constexpr auto positiveY = QVector3D(0.f, 1.f, 0.f); @@ -249,7 +246,7 @@ void RFirstPersonCameraController::updateCameraPosition(const InputState & input ROrbitCameraController::ROrbitCameraController(QNode * parent) : QOrbitCameraController(parent) { - auto callback = [this](const InputState & state, const float dt) + auto callback = [this](const CameraInputState & state, const float dt) { updateCameraPosition(state, dt); }; @@ -257,7 +254,7 @@ ROrbitCameraController::ROrbitCameraController(QNode * parent) m_listener = new RCameraInputListener(keyboardDevice(), mouseDevice(), callback, this); } -void ROrbitCameraController::updateCameraPosition(const InputState & input, const float dt) +void ROrbitCameraController::updateCameraPosition(const CameraInputState & input, const float dt) { if (camera() == nullptr) return; @@ -290,17 +287,17 @@ void ROrbitCameraController::updateCameraPosition(const InputState & input, cons // keyboard Input if (input.altKeyActive) { - orbit(input.txAxisValue * dt, input.tzAxisValue * dt); + orbit(input.txAxisValue * dt, input.tyAxisValue * dt); } else if (input.shiftKeyActive) { - zoom(input.tzAxisValue * linearSpeed() * dt); + zoom(input.tyAxisValue * linearSpeed() * dt); } else { - const float x = clamp(input.txAxisValue + (input.leftMouseButtonActive ? input.rxAxisValue : 0)); - const float y = clamp(input.tyAxisValue + (input.leftMouseButtonActive ? input.ryAxisValue : 0)); - const auto translation = QVector3D(x, y, input.tzAxisValue) * linearSpeed() * dt; + const auto translation = QVector3D( + input.txAxisValue, input.tyAxisValue, input.tzAxisValue) * + linearSpeed() * dt; camera()->translate(translation); } diff --git a/cpp/modmesh/view/RCameraController.hpp b/cpp/modmesh/view/RCameraController.hpp index 8c282c53..c61df707 100644 --- a/cpp/modmesh/view/RCameraController.hpp +++ b/cpp/modmesh/view/RCameraController.hpp @@ -45,12 +45,34 @@ namespace modmesh { +struct CameraInputState +{ + float rxAxisValue = 0; + float ryAxisValue = 0; + float txAxisValue = 0; + float tyAxisValue = 0; + float tzAxisValue = 0; + + bool leftMouseButtonActive = false; + bool middleMouseButtonActive = false; + bool rightMouseButtonActive = false; + + bool altKeyActive = false; + bool shiftKeyActive = false; +}; /* end struct CameraInputState */ + +enum class CameraControllerType +{ + FirstPerson, + Orbit +}; + class RCameraInputListener : public Qt3DCore::QEntity { Q_OBJECT public: - using callback_type = std::function; + using callback_type = std::function; RCameraInputListener( Qt3DInput::QKeyboardDevice * keyboardDevice, @@ -84,11 +106,13 @@ class RCameraInputListener : public Qt3DCore::QEntity Qt3DInput::QAction * m_right_mouse_button_action; Qt3DInput::QAction * m_shift_button_action; Qt3DInput::QAction * m_alt_button_action; + Qt3DInput::QAction * m_ctrl_button_action; Qt3DInput::QActionInput * m_left_mouse_button_input; Qt3DInput::QActionInput * m_middle_mouse_button_input; Qt3DInput::QActionInput * m_right_mouse_button_input; Qt3DInput::QActionInput * m_shift_button_input; Qt3DInput::QActionInput * m_alt_button_input; + Qt3DInput::QActionInput * m_ctrl_button_input; // mouse rotation input Qt3DInput::QAnalogAxisInput * m_mouse_rx_input; Qt3DInput::QAnalogAxisInput * m_mouse_ry_input; @@ -102,14 +126,14 @@ class RCameraInputListener : public Qt3DCore::QEntity Qt3DInput::QButtonAxisInput * m_keyboard_tx_neg_input; Qt3DInput::QButtonAxisInput * m_keyboard_ty_neg_input; Qt3DInput::QButtonAxisInput * m_keyboard_tz_neg_input; -}; +}; /* end class RCameraInputListener */ class CameraController { public: virtual ~CameraController() = default; - virtual void updateCameraPosition(const Qt3DExtras::QAbstractCameraController::InputState & state, float dt) = 0; + virtual void updateCameraPosition(const CameraInputState & state, float dt) = 0; virtual Qt3DRender::QCamera * getCamera() = 0; @@ -117,6 +141,8 @@ class CameraController virtual float getLookSpeed() = 0; + virtual CameraControllerType getType() = 0; + QVector3D position() { return getCamera()->position(); } QVector3D viewVector() { return getCamera()->viewVector(); } @@ -133,7 +159,7 @@ class CameraController { return dynamic_cast(this); } -}; +}; /* end class CameraController */ class RFirstPersonCameraController : public Qt3DExtras::QFirstPersonCameraController , public CameraController @@ -152,8 +178,10 @@ class RFirstPersonCameraController : public Qt3DExtras::QFirstPersonCameraContro void moveCamera(const InputState & state, float dt) override {} - void updateCameraPosition(const InputState & input, float dt) override; -}; + void updateCameraPosition(const CameraInputState & input, float dt) override; + + CameraControllerType getType() override { return CameraControllerType::FirstPerson; } +}; /* end class RFirstPersonCameraController */ class ROrbitCameraController : public Qt3DExtras::QOrbitCameraController , public CameraController @@ -170,7 +198,7 @@ class ROrbitCameraController : public Qt3DExtras::QOrbitCameraController private: void moveCamera(const InputState & state, float dt) override {} - void updateCameraPosition(const InputState & input, float dt) override; + void updateCameraPosition(const CameraInputState & input, float dt) override; void zoom(float zoomValue) const; @@ -179,7 +207,9 @@ class ROrbitCameraController : public Qt3DExtras::QOrbitCameraController static float clamp(float value); static float zoomDistanceSquared(QVector3D firstPoint, QVector3D secondPoint); -}; + + CameraControllerType getType() override { return CameraControllerType::Orbit; } +}; /* end class ROrbitCameraController */ } /* end namespace modmesh */ diff --git a/cpp/modmesh/view/RManager.cpp b/cpp/modmesh/view/RManager.cpp index 42f50e41..2516e9d7 100644 --- a/cpp/modmesh/view/RManager.cpp +++ b/cpp/modmesh/view/RManager.cpp @@ -157,87 +157,8 @@ void RManager::setUpMenu() m_viewMenu = m_mainWindow->menuBar()->addMenu(QString("View")); { - auto * use_orbit_camera = new RAction( - QString("Use Orbit Camera Controller"), - QString("Use Oribt Camera Controller"), - [this]() - { - qDebug() << "Use Orbit Camera Controller (menu demo)"; - for (auto subwin : m_mdiArea->subWindowList()) - { - try - { - R3DWidget * viewer = dynamic_cast(subwin->widget()); - viewer->scene()->setOrbitCameraController(); - viewer->scene()->controller()->setCamera(viewer->camera()); - } - catch (std::bad_cast & e) - { - std::cerr << e.what() << std::endl; - } - } - }); - - auto * use_fps_camera = new RAction( - QString("Use First Person Camera Controller"), - QString("Use First Person Camera Controller"), - [this]() - { - qDebug() << "Use First Person Camera Controller (menu demo)"; - for (auto subwin : m_mdiArea->subWindowList()) - { - try - { - R3DWidget * viewer = dynamic_cast(subwin->widget()); - viewer->scene()->setFirstPersonCameraController(); - viewer->scene()->controller()->setCamera(viewer->camera()); - } - catch (std::bad_cast & e) - { - std::cerr << e.what() << std::endl; - } - } - }); - - auto * reset_camera = new RAction( - QString("Reset (esc)"), - QString("Reset (esc)"), - [this]() - { - // implement resetting camera contorl - qDebug() << "Reset to initial status."; - for (auto subwin : m_mdiArea->subWindowList()) - { - try - { - R3DWidget * viewer = dynamic_cast(subwin->widget()); - Qt3DRender::QCamera * camera = viewer->camera(); - if (camera) - { - viewer->resetCamera(camera); - } - } - catch (std::bad_cast & e) - { - std::cerr << e.what() << std::endl; - } - } - }); - - auto * cameraGroup = new QActionGroup(m_mainWindow); - cameraGroup->addAction(use_orbit_camera); - cameraGroup->addAction(use_fps_camera); - cameraGroup->addAction(reset_camera); - - use_orbit_camera->setCheckable(true); - use_fps_camera->setCheckable(true); - use_orbit_camera->setChecked(true); - - reset_camera->setShortcut(QKeySequence(Qt::Key_Escape)); - - m_viewMenu->addAction(use_orbit_camera); - m_viewMenu->addAction(use_fps_camera); - m_viewMenu->addAction(reset_camera); + setUpCameraControllersMenuItems(); + setUpCameraMovementMenuItems(); } m_oneMenu = m_mainWindow->menuBar()->addMenu(QString("One")); @@ -281,6 +202,187 @@ void RManager::setUpMenu() []() {})); } +void RManager::setUpCameraControllersMenuItems() const +{ + auto * use_orbit_camera = new RAction( + QString("Use Orbit Camera Controller"), + QString("Use Oribt Camera Controller"), + [this]() + { + qDebug() << "Use Orbit Camera Controller (menu demo)"; + for (auto subwin : m_mdiArea->subWindowList()) + { + auto * viewer = dynamic_cast(subwin->widget()); + + if (viewer == nullptr) + continue; + + viewer->scene()->setOrbitCameraController(); + viewer->scene()->controller()->setCamera(viewer->camera()); + } + }); + + auto * use_fps_camera = new RAction( + QString("Use First Person Camera Controller"), + QString("Use First Person Camera Controller"), + [this]() + { + qDebug() << "Use First Person Camera Controller (menu demo)"; + for (auto subwin : m_mdiArea->subWindowList()) + { + auto * viewer = dynamic_cast(subwin->widget()); + + if (viewer == nullptr) + continue; + + viewer->scene()->setFirstPersonCameraController(); + viewer->scene()->controller()->setCamera(viewer->camera()); + } + }); + + auto * cameraGroup = new QActionGroup(m_mainWindow); + cameraGroup->addAction(use_orbit_camera); + cameraGroup->addAction(use_fps_camera); + + use_orbit_camera->setCheckable(true); + use_fps_camera->setCheckable(true); + use_orbit_camera->setChecked(true); + + m_viewMenu->addAction(use_orbit_camera); + m_viewMenu->addAction(use_fps_camera); +} + +void RManager::setUpCameraMovementMenuItems() const +{ + auto * reset_camera = new RAction( + QString("Reset (esc)"), + QString("Reset (esc)"), + [this]() + { + const auto * subwin = m_mdiArea->currentSubWindow(); + if (subwin == nullptr) + return; + + auto * viewer = dynamic_cast(subwin->widget()); + if (viewer == nullptr || viewer->camera() == nullptr) + return; + + viewer->resetCamera(); + }); + + auto * move_camera_up = new RAction( + QString("Move camera up (W/⬆)"), + QString("Move camera up (W/⬆)"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.tyAxisValue = 1.0; })); + + auto * move_camera_down = new RAction( + QString("Move camera down (S/⬇)"), + QString("Move camera down (S/⬇)"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.tyAxisValue = -1.0; })); + + auto * move_camera_right = new RAction( + QString("Move camera right (D/➡)"), + QString("Move camera right (D/➡)"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.txAxisValue = 1.0; })); + + auto * move_camera_left = new RAction( + QString("Move camera left (A/⬅)"), + QString("Move camera left (A/⬅)"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.txAxisValue = -1.0; })); + + auto * move_camera_forward = new RAction( + QString("Move camera forward (Ctrl+W/⬆)"), + QString("Move camera forward (Ctrl+W/⬆)"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.tzAxisValue = 1.0; })); + + auto * move_camera_backward = new RAction( + QString("Move camera backward (Ctrl+S/⬇)"), + QString("Move camera backward (Ctrl+S/⬇)"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.tzAxisValue = -1.0; })); + + auto * rotate_camera_positive_yaw = new RAction( + QString("Rotate camera positive yaw"), + QString("Rotate camera positive yaw"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.rxAxisValue = 1.0; })); + + auto * rotate_camera_negative_yaw = new RAction( + QString("Rotate camera negative yaw"), + QString("Rotate camera negative yaw"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.rxAxisValue = -1.0; })); + + auto * rotate_camera_positive_pitch = new RAction( + QString("Rotate camera positive pitch"), + QString("Rotate camera positive pitch"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.ryAxisValue = 1.0; })); + + auto * rotate_camera_negative_pitch = new RAction( + QString("Rotate camera negative pitch"), + QString("Rotate camera negative pitch"), + createCameraMovementItemHandler([](CameraInputState & input) + { input.ryAxisValue = -1.0; })); + + reset_camera->setShortcut(QKeySequence(Qt::Key_Escape)); + + auto cameraMoveSubmenu = m_viewMenu->addMenu("Camera move"); + cameraMoveSubmenu->addAction(reset_camera); + cameraMoveSubmenu->addAction(move_camera_up); + cameraMoveSubmenu->addAction(move_camera_down); + cameraMoveSubmenu->addAction(move_camera_right); + cameraMoveSubmenu->addAction(move_camera_left); + cameraMoveSubmenu->addAction(move_camera_forward); + cameraMoveSubmenu->addAction(move_camera_backward); + cameraMoveSubmenu->addAction(rotate_camera_positive_yaw); + cameraMoveSubmenu->addAction(rotate_camera_negative_yaw); + cameraMoveSubmenu->addAction(rotate_camera_positive_pitch); + cameraMoveSubmenu->addAction(rotate_camera_negative_pitch); +} + +std::function RManager::createCameraMovementItemHandler(const std::function & func) const +{ + return [this, func]() + { + const auto * subwin = m_mdiArea->currentSubWindow(); + if (subwin == nullptr) + return; + + auto * viewer = dynamic_cast(subwin->widget()); + if (viewer == nullptr || viewer->camera() == nullptr) + return; + + const auto controllerType = viewer->cameraController()->getType(); + CameraInputState input{}; + + func(input); + + if (input.rxAxisValue != 0.f || input.ryAxisValue != 0.f) + { + if (controllerType == CameraControllerType::Orbit) + { + constexpr float orbitRotationSpeed = 5.0f; + + input.rxAxisValue *= orbitRotationSpeed; + input.ryAxisValue *= orbitRotationSpeed; + input.rightMouseButtonActive = true; + } + else if (controllerType == CameraControllerType::FirstPerson) + { + input.leftMouseButtonActive = true; + } + } + + viewer->cameraController()->updateCameraPosition(input, 0.01); + }; +} + void RManager::clearApplications() { for (QAction * a : this->m_addonMenu->actions()) diff --git a/cpp/modmesh/view/RManager.hpp b/cpp/modmesh/view/RManager.hpp index 17413862..eca1f458 100644 --- a/cpp/modmesh/view/RManager.hpp +++ b/cpp/modmesh/view/RManager.hpp @@ -82,6 +82,11 @@ public slots: void setUpCentral(); void setUpMenu(); + void setUpCameraControllersMenuItems() const; + void setUpCameraMovementMenuItems() const; + + std::function createCameraMovementItemHandler(const std::function &) const; + bool m_already_setup = false; QCoreApplication * m_core = nullptr; diff --git a/cpp/modmesh/view/wrap_view.cpp b/cpp/modmesh/view/wrap_view.cpp index c5ab8ddc..2085b889 100644 --- a/cpp/modmesh/view/wrap_view.cpp +++ b/cpp/modmesh/view/wrap_view.cpp @@ -198,17 +198,10 @@ class MODMESH_PYTHON_WRAPPER_VISIBILITY WrapR3DWidget py::arg("name")) .def( "resetCamera", - [](wrapped_type & self, float const & positionX, float const & positionY, float const & positionZ) + [](wrapped_type & self) { - Qt3DRender::QCamera * camera = self.camera(); - if (camera) - { - self.resetCamera(camera, positionX, positionY, positionZ); - } - }, - py::arg("positionX") = 0.0f, - py::arg("positionY") = 0.0f, - py::arg("positionZ") = 10.0f) + self.resetCamera(); + }) .def("cameraController", &wrapped_type::cameraController); #define DECL_QVECTOR3D_PROPERTY(NAME, GETTER, SETTER) \ @@ -470,7 +463,7 @@ class MODMESH_PYTHON_WRAPPER_VISIBILITY WrapRCameraController bool shift_key, float dt) { - Qt3DExtras::QAbstractCameraController::InputState input{}; + CameraInputState input{}; input.txAxisValue = x; input.tyAxisValue = y; input.tzAxisValue = z;