From e2e1cb596783b6340d8338cb4b88cc196f5a50bf Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 18 Sep 2017 12:31:12 +0200 Subject: [PATCH] Fix float conversion at buffer filling --- .../Polyhedron/Scene_surface_mesh_item.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 9ce204700bf..43968eaae74 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -297,9 +297,9 @@ void Scene_surface_mesh_item_priv::addFlatData(Point p, EPICK::Vector_3 n, CGAL: { const qglviewer::Vec offset = static_cast(QGLViewer::QGLViewerPool().first())->offset(); - flat_vertices.push_back((cgal_gl_data)p.x()+offset[0]); - flat_vertices.push_back((cgal_gl_data)p.y()+offset[1]); - flat_vertices.push_back((cgal_gl_data)p.z()+offset[2]); + flat_vertices.push_back((cgal_gl_data)(p.x()+offset[0])); + flat_vertices.push_back((cgal_gl_data)(p.y()+offset[1])); + flat_vertices.push_back((cgal_gl_data)(p.z()+offset[2])); flat_normals.push_back((cgal_gl_data)n.x()); flat_normals.push_back((cgal_gl_data)n.y()); @@ -431,9 +431,9 @@ void Scene_surface_mesh_item_priv::compute_elements() BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, *smesh_),*smesh_)) { Point p = positions[source(hd, *smesh_)]; - flat_vertices.push_back((cgal_gl_data)p.x()+offset.x); - flat_vertices.push_back((cgal_gl_data)p.y()+offset.y); - flat_vertices.push_back((cgal_gl_data)p.z()+offset.z); + flat_vertices.push_back((cgal_gl_data)(p.x()+offset.x)); + flat_vertices.push_back((cgal_gl_data)(p.y()+offset.y)); + flat_vertices.push_back((cgal_gl_data)(p.z()+offset.z)); EPICK::Vector_3 n = fnormals[fd]; flat_normals.push_back((cgal_gl_data)n.x()); @@ -516,9 +516,9 @@ void Scene_surface_mesh_item_priv::compute_elements() BOOST_FOREACH(vertex_descriptor vd, vertices(*smesh_)) { Point p = positions[vd]; - smooth_vertices.push_back((cgal_gl_data)p.x()+offset.x); - smooth_vertices.push_back((cgal_gl_data)p.y()+offset.y); - smooth_vertices.push_back((cgal_gl_data)p.z()+offset.z); + smooth_vertices.push_back((cgal_gl_data)(p.x()+offset.x)); + smooth_vertices.push_back((cgal_gl_data)(p.y()+offset.y)); + smooth_vertices.push_back((cgal_gl_data)(p.z()+offset.z)); EPICK::Vector_3 n = vnormals[vd]; smooth_normals.push_back((cgal_gl_data)n.x());