bazarebro Posted September 12, 2018 Posted September 12, 2018 Hello, I can't seem to find a function in the documents or a post on the forum regarding controlling a player/camera via mouse control. Movement is fine I just cannot seem to find a function regarding setting camera control to mouse movement. Thanks.
silent Posted September 12, 2018 Posted September 12, 2018 Is there some specific requirements to mouse controls? Could you please give us some additional details about functionality that you are trying to achieve? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
bazarebro Posted September 12, 2018 Author Posted September 12, 2018 (edited) 3 minutes ago, silent said: Is there some specific requirements to mouse controls? Could you please give us some additional details about functionality that you are trying to achieve? Just to mimic the editor style camera in terms of mouse control. I just wish for the camera/player's ViewDirection to be moved with the mouse. i.e: when I move my mouse left the camera also looks left. Thanks, Bazarebro player = PlayerSpectator::create(); player->setFov(90.0f); player->setZNear(0.1f); player->setZFar(10000.0f); player->setViewDirection(vec3(0.0f, 1.0f, 0.0f)); player->setPosition(Math::dvec3(-3404.061, -921.754, 535.601)); player->setMinVelocity(250.0f); player->setMaxVelocity(500.0f); Game::get()->setPlayer(player->getPlayer()); player->release(); player->setControlled(0); My current player^ Edited September 12, 2018 by bazarebro
cash-metall Posted September 14, 2018 Posted September 14, 2018 to rotate the camera with the mouse you need set player->setControlled(1); If you need special camera control, you can see samples UnigineScript/Players, in c ++ it works the same way.
Recommended Posts