Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2013-09-20 01:59:22 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2013-09-20 01:59:22 +0400
commit1d936a107447ad70b5ee413b7b3be5e7947d9c62 (patch)
tree11222202aff27e060e8bed349724aa2f96a02551 /source/blender/collada
parent67ae8cfcf517d02bb250f1a3b6c255e61a17a58d (diff)
Ensure positions can be read for sources that have stride
defined as 2 (2D coordinates).
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/MeshImporter.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 0c46a2bd858..09d71f22a0d 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -665,7 +665,11 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData& arr, int i,
v[0] = (*values)[i++];
v[1] = (*values)[i++];
- v[2] = (*values)[i];
+ if(stride>=3) {
+ v[2] = (*values)[i];
+ } else {
+ v[2] = 0.0f;
+ }
}
break;
@@ -676,13 +680,18 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData& arr, int i,
v[0] = (float)(*values)[i++];
v[1] = (float)(*values)[i++];
- v[2] = (float)(*values)[i];
+ if(stride>=3) {
+ v[2] = (float)(*values)[i];
+ } else {
+ v[2] = 0.0f;
+ }
}
break;
default:
break;
}
}
+
bool MeshImporter::is_flat_face(unsigned int *nind, COLLADAFW::MeshVertexData& nor, int count)
{
float a[3], b[3];