jiangqiu Posted June 23, 2016 Share Posted June 23, 2016 I use the C++ API and create the environment by default like the follows: AppSystemLogic system_logic; AppWorldLogic world_logic; AppEditorLogic editor_logic; Unigine::EnginePtr engine(UNIGINE_VERSION, argc, argv); engine->main(&system_logic, &world_logic, &editor_logic); but when I run this application, I found that when I click the scene, the mouse disappeared, and when I print the mouse positions, I always get a same value no matter how I shake the mouse. The source code and the out put are as follows: int AppWorldLogic::update() { Unigine::Log::message("%d, %d \n", Unigine::App::get()->getMouseX(), Unigine::App::get()->getMouseY()); return 1; } Output: 853, 8 853, 8 853, 8 853, 8 853, 8 851, 9 851, 9 851, 9 851, 9 851, 9 clicked! 800, 450 800, 450 800, 450 800, 450 800, 450 800, 450 800, 450 800, 450 800, 450 800, 450 ... What surprised me is that no matter where I click the mouse, the output always 800, 450 when the cursor has disappeared. Waiting for your response, thanks! Link to comment
silent Posted June 23, 2016 Share Posted June 23, 2016 Hi, You just need to use MOUSE_SOFT define. You can pass it via engine startup command: -extern_define MOUSE_SOFT or modify system script (unigine.cpp file) and add #define MOUSE_SOFT before any includes. Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts