]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.cpp
Add a generic snapping interface in Object
[r2c2.git] / source / engineer / engineer.cpp
index e19c11e063707a8e7e91383a51044e9ce100f8df..b0296a192d6cbb175b9fd8c3c03e078c14425201 100644 (file)
@@ -230,11 +230,10 @@ void Engineer::tick()
                camera.apply();
                GL::MatrixStack::Push push_mat(GL::MatrixStack::modelview());
 
-               float rot = picking_track->get_endpoint_direction(picking_entry);
-               Vector pos = picking_track->get_endpoint_position(picking_entry);
+               Snap sn = picking_track->get_snap_node(picking_entry);
 
-               GL::MatrixStack::modelview() *= GL::Matrix::translation(pos.x, pos.y, pos.z+0.03);
-               GL::MatrixStack::modelview() *= GL::Matrix::rotation(rot+M_PI, 0, 0, 1);
+               GL::MatrixStack::modelview() *= GL::Matrix::translation(sn.position.x, sn.position.y, sn.position.z+0.03);
+               GL::MatrixStack::modelview() *= GL::Matrix::rotation(sn.rotation+M_PI, 0, 0, 1);
 
                arrow_mesh.draw();
        }