Made camera only move when application has focus
This commit is contained in:
@@ -59,6 +59,7 @@ class Application { // : public GApp {
|
||||
Tool * tool;
|
||||
void changeTool(Tool *);
|
||||
Mouse mouse;
|
||||
bool viewportHasFocus();
|
||||
private:
|
||||
bool mouseMoveState;
|
||||
RenderDevice* renderDevice;
|
||||
|
||||
@@ -143,6 +143,11 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
|
||||
|
||||
}
|
||||
|
||||
bool Application::viewportHasFocus()
|
||||
{
|
||||
return GetActiveWindow() == this->_hWndMain;
|
||||
}
|
||||
|
||||
void Application::navigateToolbox(std::string path)
|
||||
{
|
||||
int len = path.size() + 1;
|
||||
|
||||
@@ -193,6 +193,8 @@ void CameraController::update(Application* app)
|
||||
Vector3 cameraPos = g3dCamera.getCoordinateFrame().translation;
|
||||
CoordinateFrame frame = g3dCamera.getCoordinateFrame();
|
||||
bool moving=false;
|
||||
if(!app->viewportHasFocus())
|
||||
return;
|
||||
if(GetHoldKeyState('U')) {
|
||||
forwards = true;
|
||||
moving=true;
|
||||
|
||||
Reference in New Issue
Block a user