Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Courses
Scotty3D
Commits
11754c5c
Commit
11754c5c
authored
Oct 12, 2020
by
TheNumbat
Browse files
fix nan(ind) bug in assimp
parent
faf9e4cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
deps/assimp/include/assimp/fast_atof.h
View file @
11754c5c
...
...
@@ -269,6 +269,12 @@ const char* fast_atoreal_move(const char* c, Real& out, bool check_comma = true)
++
c
;
}
if
((
c
[
0
]
==
'N'
||
c
[
0
]
==
'n'
)
&&
ASSIMP_strincmp
(
c
,
"nan(ind)"
,
8
)
==
0
)
{
out
=
std
::
numeric_limits
<
Real
>::
quiet_NaN
();
c
+=
8
;
return
c
;
}
if
((
c
[
0
]
==
'N'
||
c
[
0
]
==
'n'
)
&&
ASSIMP_strincmp
(
c
,
"nan"
,
3
)
==
0
)
{
out
=
std
::
numeric_limits
<
Real
>::
quiet_NaN
();
c
+=
3
;
...
...
src/scene/scene.cpp
View file @
11754c5c
...
...
@@ -324,7 +324,6 @@ static void load_node(Scene &scobj, std::vector<std::string> &errors,
std
::
vector
<
std
::
vector
<
Halfedge_Mesh
::
Index
>>
polys
;
for
(
unsigned
int
j
=
0
;
j
<
mesh
->
mNumFaces
;
j
++
)
{
const
aiFace
&
face
=
mesh
->
mFaces
[
j
];
std
::
vector
<
Halfedge_Mesh
::
Index
>
poly
;
for
(
unsigned
int
k
=
0
;
k
<
face
.
mNumIndices
;
k
++
)
{
poly
.
push_back
(
face
.
mIndices
[
k
]);
...
...
@@ -404,12 +403,16 @@ static void load_node(Scene &scobj, std::vector<std::string> &errors,
for
(
unsigned
int
j
=
0
;
j
<
mesh
->
mNumVertices
;
j
++
)
{
const
aiVector3D
&
vpos
=
mesh
->
mVertices
[
j
];
const
aiVector3D
&
vnorm
=
mesh
->
mNormals
[
j
];
aiVector3D
vnorm
;
if
(
mesh
->
HasNormals
())
{
vnorm
=
mesh
->
mNormals
[
j
];
}
mesh_verts
.
push_back
({
aiVec
(
vpos
),
aiVec
(
vnorm
),
0
});
}
for
(
unsigned
int
j
=
0
;
j
<
mesh
->
mNumFaces
;
j
++
)
{
const
aiFace
&
face
=
mesh
->
mFaces
[
j
];
if
(
face
.
mNumIndices
<
3
)
continue
;
unsigned
int
start
=
face
.
mIndices
[
0
];
for
(
size_t
k
=
1
;
k
<=
face
.
mNumIndices
-
2
;
k
++
)
{
mesh_inds
.
push_back
(
start
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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