Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
afa4fff1
Commit
afa4fff1
authored
Mar 05, 2014
by
Janis Born
Browse files
prevent glm assertion failing when normalizing normals in loadGeometryDataFromOBJ
parent
09a70459
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ACGL/OpenGL/Data/GeometryDataLoadStoreOBJ.cc
View file @
afa4fff1
...
...
@@ -307,7 +307,9 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
glm
::
vec3
v0
=
(
glm
::
vec3
)
positionData
[
indices
[
3
*
triangleIndex
+
0
].
position
];
glm
::
vec3
v1
=
(
glm
::
vec3
)
positionData
[
indices
[
3
*
triangleIndex
+
1
].
position
];
glm
::
vec3
v2
=
(
glm
::
vec3
)
positionData
[
indices
[
3
*
triangleIndex
+
2
].
position
];
glm
::
vec3
normal
=
glm
::
normalize
(
glm
::
cross
(
v1
-
v0
,
v2
-
v0
));
glm
::
vec3
normal
=
glm
::
cross
(
v1
-
v0
,
v2
-
v0
);
if
(
normal
!=
glm
::
vec3
(
0
))
normal
=
glm
::
normalize
(
normal
);
abData
[
pos
++
]
=
normal
.
x
;
abData
[
pos
++
]
=
normal
.
y
;
abData
[
pos
++
]
=
normal
.
z
;
...
...
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