Browse Source

Don't interact with camera when mouse is over ImGui.

Бранимир Караџић 4 years ago
parent
commit
45234794d9

+ 1 - 1
examples/13-stencil/stencil.cpp

@@ -992,7 +992,7 @@ public:
 			s_uniforms.m_time = time;
 
 			// Update camera.
-			cameraUpdate(deltaTime, m_mouseState);
+			cameraUpdate(deltaTime, m_mouseState, ImGui::MouseOverArea() );
 			cameraGetViewMtx(m_viewState.m_view);
 
 			static float lightTimeAccumulator = 0.0f;

+ 1 - 1
examples/43-denoise/denoise.cpp

@@ -406,7 +406,7 @@ public:
 			}
 
 			// Update camera
-			cameraUpdate(deltaTime*0.15f, m_mouseState);
+			cameraUpdate(deltaTime*0.15f, m_mouseState, ImGui::MouseOverArea() );
 
 			// Set up matrices for gbuffer
 			cameraGetViewMtx(m_view);

+ 1 - 1
examples/44-sss/screen_space_shadows.cpp

@@ -417,7 +417,7 @@ public:
 			m_lightModel.position[2] = bx::sin(m_lightRotation) * 3.0f;
 
 			// Update camera
-			cameraUpdate(deltaTime*0.15f, m_mouseState);
+			cameraUpdate(deltaTime*0.15f, m_mouseState, ImGui::MouseOverArea() );
 
 			// Set up matrices for gbuffer
 			cameraGetViewMtx(m_view);

+ 3 - 3
examples/45-bokeh/bokeh.cpp

@@ -391,7 +391,7 @@ public:
 			}
 
 			// Update camera
-			cameraUpdate(deltaTime*0.15f, m_mouseState);
+			cameraUpdate(deltaTime*0.15f, m_mouseState, ImGui::MouseOverArea() );
 
 			cameraGetViewMtx(m_view);
 
@@ -883,7 +883,7 @@ public:
 			return 1.0f;
 		}
 
-		// divide edge into some number of lobes 
+		// divide edge into some number of lobes
 		const float invPeriod = float(_lobeCount) / (bx::kPi2);
 		float periodFraction = bx::fract(_theta * invPeriod + _rotation);
 
@@ -907,7 +907,7 @@ public:
 		BX_ASSERT(0 < _lobeCount);
 
 		const uint32_t bokehSize = 128;
-			
+
 		const bgfx::Memory* mem = bgfx::alloc(bokehSize*bokehSize*4);
 		bx::memSet(mem->data, 0x00, bokehSize*bokehSize*4);