Skip to content
Snippets Groups Projects
Commit c9a9249b authored by Philip Trettner's avatar Philip Trettner
Browse files

made LMB and RMB handling configurable

parent 01a371b4
No related branches found
No related tags found
No related merge requests found
......@@ -197,11 +197,11 @@ bool GlfwApp::onMousePosition(double x, double y)
float ax = dx / mWindowWidth * mCameraTurnSpeed;
float ay = dy / mWindowHeight * mCameraTurnSpeed;
if (mMouseRight && !alt && !ctrl) // from cam
if (mUseDefaultCameraHandlingRight && mMouseRight && !alt && !ctrl) // from cam
{
mCamera->FPSstyleLookAround(ax, ay);
}
if (mMouseLeft && !shift && !alt && !ctrl) // around target
if (mUseDefaultCameraHandlingLeft && mMouseLeft && !shift && !alt && !ctrl) // around target
{
auto fwd = mCamera->getForwardDirection();
......@@ -252,7 +252,7 @@ bool GlfwApp::onMouseButton(double x, double y, int button, int action, int mods
onResetView();
// Double [LMB] (no mods) -> center on pos
if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS && clickCount > 1 && mods == 0)
if (mUseDefaultCameraHandlingLeft && button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS && clickCount > 1 && mods == 0)
{
glm::vec3 pos;
float depth;
......
......@@ -105,6 +105,8 @@ private:
bool mUseDefaultCamera = true; ///< if true, uses default camera
bool mUseDefaultRendering = true; ///< if true, uses default rendering pipeline setup (requires default cam)
bool mUseDefaultCameraHandling = true; ///< if true, implements default cam handling
bool mUseDefaultCameraHandlingLeft = true; ///< if true, activates left mouse button handling
bool mUseDefaultCameraHandlingRight = true; ///< if true, activates right mouse button handling
double mCurrentTime = 0.0; ///< current frame time (starts with 0)
......@@ -160,6 +162,8 @@ public:
GLOW_PROPERTY(UseDefaultCamera);
GLOW_PROPERTY(UseDefaultCameraHandling);
GLOW_PROPERTY(UseDefaultCameraHandlingLeft);
GLOW_PROPERTY(UseDefaultCameraHandlingRight);
GLOW_PROPERTY(CameraMoveSpeed);
GLOW_PROPERTY(CameraTurnSpeed);
GLOW_PROPERTY(CameraScrollSpeed);
......@@ -171,6 +175,7 @@ public:
glm::vec2 getMousePosition() const { return {mMouseX, mMouseY}; }
GLFWwindow* window() const { return mWindow; }
TwBar* tweakbar() const { return mTweakbar; }
public:
/// sets the current clipboard content
void setClipboardString(std::string const& s) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment