Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
iMSTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ruiliang Gao
iMSTK
Commits
46987308
Commit
46987308
authored
8 years ago
by
Nicholas Milef
Committed by
Alexis Girault
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Improve SurfaceMesh Tangents, Bitangents and Normals support
parent
b90a7ab3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Base/Geometry/Mesh/imstkSurfaceMesh.cpp
+30
-0
30 additions, 0 deletions
Base/Geometry/Mesh/imstkSurfaceMesh.cpp
Base/Geometry/Mesh/imstkSurfaceMesh.h
+16
-1
16 additions, 1 deletion
Base/Geometry/Mesh/imstkSurfaceMesh.h
with
46 additions
and
1 deletion
Base/Geometry/Mesh/imstkSurfaceMesh.cpp
+
30
−
0
View file @
46987308
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Base/Geometry/Mesh/imstkSurfaceMesh.h
+
16
−
1
View file @
46987308
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment