Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scotty3D
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Courses
Scotty3D
Commits
11754c5c
There was an error fetching the commit references. Please try again later.
Commit
11754c5c
authored
4 years ago
by
TheNumbat
Browse files
Options
Downloads
Patches
Plain Diff
fix nan(ind) bug in assimp
parent
faf9e4cf
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
deps/assimp/include/assimp/fast_atof.h
+6
-0
6 additions, 0 deletions
deps/assimp/include/assimp/fast_atof.h
src/scene/scene.cpp
+5
-2
5 additions, 2 deletions
src/scene/scene.cpp
with
11 additions
and
2 deletions
deps/assimp/include/assimp/fast_atof.h
+
6
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
src/scene/scene.cpp
+
5
−
2
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment