Skip to content

Commit

Permalink
reflect changes from datatype change for vec3state (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredroy authored Dec 21, 2023
1 parent c473a66 commit ac2b415
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,15 @@ void OglTetrahedralModel<DataTypes>::drawTransparent(const core::visual::VisualP

glBindBufferARB(GL_ARRAY_BUFFER, m_vbo);

glVertexPointer(3, GL_FLOAT, 0, (char*)NULL + 0);
int gltype = GL_FLOAT;

if constexpr (std::is_same_v<typename Coord::value_type, double>)
{
gltype = GL_DOUBLE;
}

glVertexPointer(3, gltype, 0, nullptr);

glBindBufferARB(GL_ARRAY_BUFFER, 0);

glEnableClientState(GL_VERTEX_ARRAY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,14 @@ void OglVolumetricModel::drawTransparent(const core::visual::VisualParams* vpara
#ifdef GL_LINES_ADJACENCY_EXT
glBindBufferARB(GL_ARRAY_BUFFER, m_vbo);

glVertexPointer(3, GL_FLOAT, 0, (char*)NULL + 0);
int gltype = GL_FLOAT;

if constexpr (std::is_same_v<typename Coord::value_type, double>)
{
gltype = GL_DOUBLE;
}

glVertexPointer(3, gltype, 0, nullptr);
glBindBufferARB(GL_ARRAY_BUFFER, 0);

glEnableClientState(GL_VERTEX_ARRAY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class SOFA_VOLUMETRICRENDERING_API OglVolumetricModel : public core::visual::Vis

sofa::type::vector<Tetrahedron> m_hexaToTetrahedra;

sofa::type::vector<Coord> m_tetraBarycenters;
sofa::type::vector<Coord> m_hexaBarycenters;
sofa::type::vector<type::Vec3f> m_tetraBarycenters;
sofa::type::vector<type::Vec3f> m_hexaBarycenters;

public:
void init() override;
Expand Down

0 comments on commit ac2b415

Please sign in to comment.