+
+ if(vrhand[0].valid) {
+ exslot_left.node.set_position(vrhand[0].pos);
+ exslot_left.node.set_rotation(vrhand[0].rot);
+
+ // right hand takes precedence for hover
+ if(!exsel_grab_left && !exsel_hover) {
+ exsel_hover = exman->select(Sphere(vrhand[0].pos, 5));
+ }
+ }
+ if(vrhand[1].valid) {
+ exslot_right.node.set_position(vrhand[1].pos);
+ exslot_right.node.set_rotation(vrhand[1].rot);
+
+ if(!exsel_grab_right) {
+ exsel_hover = exman->select(Sphere(vrhand[1].pos, 5));
+ }
+ }
+
+ } else {
+ // check if an exhibit is hovered-over by mouse (only if we don't have one grabbed)
+ if(!exsel_grab_mouse) {
+ Ray ray = calc_pick_ray(prev_mx, prev_my);
+ exsel_hover = exman->select(ray);
+ }
+
+ // TODO do this properly
+ // set the position of the left hand at a suitable position for the exhibit UI
+ dir = rotate(Vec3(-0.46, -0.1, -1), Vec3(0, 1, 0), deg_to_rad(-avatar.body_rot));
+ exslot_left.node.set_position(avatar.pos + dir * 30); // magic: distance in front