Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-fcl
Commits
bdade023
Commit
bdade023
authored
Sep 11, 2019
by
Joseph Mirabel
Browse files
Workaround Assimp bug related to undefined symbols.
parent
9360a7c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/hpp/fcl/mesh_loader/assimp.h
View file @
bdade023
...
...
@@ -41,6 +41,9 @@
#include
<hpp/fcl/BVH/BVH_model.h>
class
aiScene
;
namespace
Assimp
{
class
Importer
;
}
namespace
hpp
{
...
...
@@ -62,7 +65,8 @@ struct Loader {
void
load
(
const
std
::
string
&
resource_path
);
aiScene
*
scene
;
Assimp
::
Importer
*
importer
;
aiScene
const
*
scene
;
};
/**
...
...
src/mesh_loader/assimp.cpp
View file @
bdade023
...
...
@@ -58,18 +58,10 @@ namespace fcl
namespace
internal
{
Loader
::
Loader
()
:
scene
(
NULL
)
{}
Loader
::~
Loader
()
Loader
::
Loader
()
:
importer
(
new
Assimp
::
Importer
())
{
if
(
scene
)
delete
scene
;
}
void
Loader
::
load
(
const
std
::
string
&
resource_path
)
{
Assimp
::
Importer
importer
;
// set list of ignored parameters (parameters used for rendering)
importer
.
SetPropertyInteger
(
AI_CONFIG_PP_RVC_FLAGS
,
importer
->
SetPropertyInteger
(
AI_CONFIG_PP_RVC_FLAGS
,
aiComponent_TANGENTS_AND_BITANGENTS
|
aiComponent_COLORS
|
aiComponent_BONEWEIGHTS
|
...
...
@@ -82,7 +74,16 @@ void Loader::load (const std::string & resource_path)
aiComponent_NORMALS
);
importer
.
ReadFile
(
resource_path
.
c_str
(),
}
Loader
::~
Loader
()
{
if
(
importer
)
delete
importer
;
}
void
Loader
::
load
(
const
std
::
string
&
resource_path
)
{
scene
=
importer
->
ReadFile
(
resource_path
.
c_str
(),
aiProcess_SortByPType
|
aiProcess_Triangulate
|
aiProcess_RemoveComponent
|
...
...
@@ -94,11 +95,10 @@ void Loader::load (const std::string & resource_path)
aiProcess_JoinIdenticalVertices
);
scene
=
importer
.
GetOrphanedScene
();
if
(
!
scene
)
{
const
std
::
string
exception_message
(
std
::
string
(
"Could not load resource "
)
+
resource_path
+
std
::
string
(
"
\n
"
)
+
importer
.
GetErrorString
()
+
std
::
string
(
"
\n
"
)
+
importer
->
GetErrorString
()
+
std
::
string
(
"
\n
"
)
+
"Hint: the mesh directory may be wrong."
);
throw
std
::
invalid_argument
(
exception_message
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment