From 7f787cf3641ceb11f75e796d45a74b6b8e5e343e Mon Sep 17 00:00:00 2001 From: Fabrice Robinet Date: Mon, 16 Feb 2015 17:44:07 -0800 Subject: [PATCH] https://github.com/KhronosGroup/glTF/issues/341 --- converter/COLLADA2GLTF/GLTF/GLTFPrimitive.cpp | 10 +++++----- converter/COLLADA2GLTF/GLTF/GLTFPrimitive.h | 4 ++-- converter/COLLADA2GLTF/GLTF/GLTFTypesAndConstants.h | 2 +- converter/COLLADA2GLTF/convert/meshConverter.cpp | 2 +- converter/COLLADA2GLTF/dependencies/OpenCOLLADA | 2 +- .../extensions/o3dgc-compression/GLTF-Open3DGC.cpp | 2 +- converter/COLLADA2GLTF/helpers/geometryHelpers.cpp | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.cpp b/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.cpp index 3cecc322ea..959e0e5dda 100644 --- a/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.cpp +++ b/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.cpp @@ -48,7 +48,7 @@ namespace GLTF { this->_allVertexAttributes = primitive._allVertexAttributes; GLTFPrimitive *pr = const_cast(&primitive); - this->setPrimitive(pr->getPrimitive()); + this->setMode(pr->getMode()); this->setMaterialID(pr->getMaterialID()); this->_materialObjectID = primitive._materialObjectID; this->_uniqueIndices = primitive._uniqueIndices; @@ -90,12 +90,12 @@ namespace GLTF this->_allVertexAttributes.push_back(VertexAttribute); } - unsigned int GLTFPrimitive::getPrimitive() { - return this->getUnsignedInt32(kPrimitive); + unsigned int GLTFPrimitive::getMode() { + return this->getUnsignedInt32(kMode); } - void GLTFPrimitive::setPrimitive(unsigned int type) { - this->setUnsignedInt32(kPrimitive, type); + void GLTFPrimitive::setMode(unsigned int type) { + this->setUnsignedInt32(kMode, type); } std::string GLTFPrimitive::getMaterialID() { diff --git a/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.h b/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.h index 1a33203b3d..7aaa80c102 100644 --- a/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.h +++ b/converter/COLLADA2GLTF/GLTF/GLTFPrimitive.h @@ -54,8 +54,8 @@ namespace GLTF GLTFPrimitive(const GLTFPrimitive& primitive); virtual ~GLTFPrimitive(); - unsigned int getPrimitive(); - void setPrimitive(unsigned int type); + unsigned int getMode(); + void setMode(unsigned int type); std::string getMaterialID(); void setMaterialID(std::string materialID); diff --git a/converter/COLLADA2GLTF/GLTF/GLTFTypesAndConstants.h b/converter/COLLADA2GLTF/GLTF/GLTFTypesAndConstants.h index b535de2d43..b3cf39030b 100644 --- a/converter/COLLADA2GLTF/GLTF/GLTFTypesAndConstants.h +++ b/converter/COLLADA2GLTF/GLTF/GLTFTypesAndConstants.h @@ -45,7 +45,7 @@ const std::string kMax = "max"; const std::string kIndices = "indices"; const std::string kMaterial = "material"; const std::string kMaterials = "materials"; -const std::string kPrimitive = "primitive"; +const std::string kMode = "mode"; const std::string kName = "name"; const std::string kExtensions = "extensions"; const std::string kPrimitives = "primitives"; diff --git a/converter/COLLADA2GLTF/convert/meshConverter.cpp b/converter/COLLADA2GLTF/convert/meshConverter.cpp index babd96f0ff..e29df6afec 100644 --- a/converter/COLLADA2GLTF/convert/meshConverter.cpp +++ b/converter/COLLADA2GLTF/convert/meshConverter.cpp @@ -375,7 +375,7 @@ namespace GLTF } cvtPrimitive->setMaterialObjectID((unsigned int)openCOLLADAMeshPrimitive->getMaterialId()); - cvtPrimitive->setPrimitive(profile->getGLenumForString(type)); + cvtPrimitive->setMode(profile->getGLenumForString(type)); //count of indices , it must be the same for all kind of indices size_t count = openCOLLADAMeshPrimitive->getPositionIndices().getCount(); diff --git a/converter/COLLADA2GLTF/dependencies/OpenCOLLADA b/converter/COLLADA2GLTF/dependencies/OpenCOLLADA index ddf8f47ab8..4924ae326b 160000 --- a/converter/COLLADA2GLTF/dependencies/OpenCOLLADA +++ b/converter/COLLADA2GLTF/dependencies/OpenCOLLADA @@ -1 +1 @@ -Subproject commit ddf8f47ab81a7a6cc4e47f47eb680656ffb6edca +Subproject commit 4924ae326b9e5e5874ae3ce37e0ff88cfa6bee68 diff --git a/converter/COLLADA2GLTF/extensions/o3dgc-compression/GLTF-Open3DGC.cpp b/converter/COLLADA2GLTF/extensions/o3dgc-compression/GLTF-Open3DGC.cpp index dddc0f2d6d..f6f185d432 100644 --- a/converter/COLLADA2GLTF/extensions/o3dgc-compression/GLTF-Open3DGC.cpp +++ b/converter/COLLADA2GLTF/extensions/o3dgc-compression/GLTF-Open3DGC.cpp @@ -214,7 +214,7 @@ namespace GLTF for (unsigned int i = 0 ; i < primitivesCount ; i++) { shared_ptr primitive = static_pointer_cast(primitives[i]); - if (primitive->getPrimitive() != profile->getGLenumForString("TRIANGLES")) { + if (primitive->getMode() != profile->getGLenumForString("TRIANGLES")) { return false; } } diff --git a/converter/COLLADA2GLTF/helpers/geometryHelpers.cpp b/converter/COLLADA2GLTF/helpers/geometryHelpers.cpp index f9b5e29c53..0c35d04bfa 100644 --- a/converter/COLLADA2GLTF/helpers/geometryHelpers.cpp +++ b/converter/COLLADA2GLTF/helpers/geometryHelpers.cpp @@ -656,7 +656,7 @@ namespace GLTF size_t j = 0; unsigned int primitiveCount = 0; unsigned int targetIndicesCount = 0; - if (primitive->getPrimitive() == profile->getGLenumForString("TRIANGLES")) { + if (primitive->getMode() == profile->getGLenumForString("TRIANGLES")) { unsigned int indicesPerElementCount = 3; primitiveCount = (unsigned int)indices->getCount() / indicesPerElementCount; for (j = nextPrimitiveIndex ; j < primitiveCount ; j++) { @@ -682,7 +682,7 @@ namespace GLTF } } } - else if (primitive->getPrimitive() == profile->getGLenumForString("LINES")) { + else if (primitive->getMode() == profile->getGLenumForString("LINES")) { unsigned int indicesPerElementCount = 2; primitiveCount = (unsigned int)indices->getCount() / indicesPerElementCount; for (j = nextPrimitiveIndex; j < primitiveCount; j++) {