Skip to content

Commit

Permalink
Merge pull request #1029 from libigl/alecjacobson-patch-1
Browse files Browse the repository at this point in the history
Eigen Alignment issue
  • Loading branch information
alecjacobson committed Nov 27, 2018
2 parents a5a501f + 8a3c960 commit 6571c46
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/igl/opengl/ViewerData.h
Expand Up @@ -19,6 +19,14 @@
// Alec: This is a mesh class containing a variety of data types (normals,
// overlays, material colors, etc.)
//
// WARNING: Eigen data members (such as Eigen::Vector4f) should explicitly
// disable alignment (e.g. use `Eigen::Matrix<float, 4, 1, Eigen::DontAlign>`),
// in order to avoid alignment issues further down the line (esp. if the
// structure are stored in a std::vector).
//
// See this thread for a more detailed discussion:
// https://github.com/libigl/libigl/pull/1029
//
namespace igl
{

Expand Down Expand Up @@ -103,7 +111,7 @@ class ViewerData
// C #E|1 by 3 color(s)
IGL_INLINE void set_edges (const Eigen::MatrixXd& P, const Eigen::MatrixXi& E, const Eigen::MatrixXd& C);
// Alec: This is very confusing. Why does add_edges have a different API from
// set_edges?
// set_edges?
IGL_INLINE void add_edges (const Eigen::MatrixXd& P1, const Eigen::MatrixXd& P2, const Eigen::MatrixXd& C);
IGL_INLINE void add_label (const Eigen::VectorXd& P, const std::string& str);

Expand Down Expand Up @@ -189,7 +197,7 @@ class ViewerData
// Point size / line width
float point_size;
float line_width;
Eigen::Vector4f line_color;
Eigen::Matrix<float, 4, 1, Eigen::DontAlign> line_color;

// Shape material
float shininess;
Expand Down

0 comments on commit 6571c46

Please sign in to comment.