From 2a5c038b9ffc03fe49f0c29585ec333df7ff8907 Mon Sep 17 00:00:00 2001 From: epoch Date: Sun, 16 Aug 2020 16:44:48 -0500 Subject: used a defined constant instead of a magic constant. also put an idea in a comment for middle-drag to move camera instead of just rotate. dunno --- src/mouse_x11.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mouse_x11.c b/src/mouse_x11.c index 623dd68..78926f9 100644 --- a/src/mouse_x11.c +++ b/src/mouse_x11.c @@ -99,11 +99,18 @@ int mouse_event_handler() {//this returns HVM_ key + for buttondown and - for bu //this /was/ using a 2 for the mousemap index... so 2 is "right" in hackvr. if(gra_global.mousemap[MOUSE_SECONDARY] == 1) {//if "right" click is held down gr=get_group_relative(global.user); - gr->r.x.d=gra_global.oldcamera.x.d + (gra_global.mouse.y - gra_global.dragstart[2].y); - gr->r.y.d=gra_global.oldcamera.y.d + (gra_global.mouse.x - gra_global.dragstart[2].x); + gr->r.x.d=gra_global.oldcamera.x.d + (gra_global.mouse.y - gra_global.dragstart[MOUSE_SECONDARY].y); + gr->r.y.d=gra_global.oldcamera.y.d + (gra_global.mouse.x - gra_global.dragstart[MOUSE_SECONDARY].x); //global.camera.r.x.d=gra_global.oldcamera.x.d + (gra_global.mouse.y - gra_global.dragstart[2].y); //global.camera.r.y.d=gra_global.oldcamera.y.d + (gra_global.mouse.x - gra_global.dragstart[2].x); } + /* dunno if I really want to do this. + if(gra_global.mousemap[MOUSE_TERTIARY] == 1) {//if we're holding down middle-click + //need to move forward or sideways based on + gr->r.x = gra_global.oldcmaera.gra_global.dragstart[MOUSE_TERTIARY].x// + gr->r.y = // + gr->r.z = // + }*/ //do we need to redraw on mouse movement? //probably. redrawplzkthx=1; -- cgit v1.2.3