Skip to content
Snippets Groups Projects
Commit 46987308 authored by Nicholas Milef's avatar Nicholas Milef Committed by Alexis Girault
Browse files

ENH: Improve SurfaceMesh Tangents, Bitangents and Normals support

parent b90a7ab3
No related branches found
No related tags found
No related merge requests found
......@@ -288,12 +288,42 @@ SurfaceMesh::getTriangleNormal(size_t i) const
return m_trianglesNormals.at(i);
}
void
SurfaceMesh::setVerticesNormals(const StdVectorOfVec3d& normals)
{
m_verticesNormals = normals;
}
const StdVectorOfVec3d&
SurfaceMesh::getVerticesNormals() const
{
return m_verticesNormals;
}
void
SurfaceMesh::setVerticesTangents(const StdVectorOfVec3d& tangents)
{
m_verticesTangents = tangents;
}
const StdVectorOfVec3d&
SurfaceMesh::getVerticesTangents() const
{
return m_verticesTangents;
}
void
SurfaceMesh::setVerticesBitangents(const StdVectorOfVec3d& bitangents)
{
m_verticesBitangents = bitangents;
}
const StdVectorOfVec3d&
SurfaceMesh::getVerticesBitangents() const
{
return m_verticesBitangents;
}
const Vec3d&
SurfaceMesh::getVerticeNormal(size_t i) const
{
......
......@@ -124,10 +124,23 @@ public:
const Vec3d& getTriangleNormal(size_t i) const;
///
/// \brief Get vector of normals of all the vertices
/// \brief Set/Get vector of normals of all the vertices
///
void setVerticesNormals(const StdVectorOfVec3d& normals);
const StdVectorOfVec3d& getVerticesNormals() const;
///
/// \brief Set/Get vector of tangents of all the vertices
///
void setVerticesTangents(const StdVectorOfVec3d& tangents);
const StdVectorOfVec3d& getVerticesTangents() const;
///
/// \brief Set/Get vector of bitangents of all the vertices
///
void setVerticesBitangents(const StdVectorOfVec3d& bitangents);
const StdVectorOfVec3d& getVerticesBitangents() const;
///
/// \brief Get normal of a vertex given its index
///
......@@ -160,6 +173,8 @@ protected:
StdVectorOfVec3d m_trianglesNormals; ///> Normals to the triangles
StdVectorOfVec3d m_verticesNormals; ///> Normals of the vertices
StdVectorOfVec3d m_verticesTangents; ///> Tangents of the vertices
StdVectorOfVec3d m_verticesBitangents; ///> Bitangents of the vertices
std::string m_defaultTCoords = ""; ///> Name of the array used as default texture coordinates
std::map<std::string, std::string> m_textureMap; ///> Mapping texture coordinates to texture
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment