Skip to content

Commit

Permalink
https://github.com/KhronosGroup/glTF/issues/341
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrobinet committed Feb 17, 2015
1 parent 796d48f commit 7f787cf
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions converter/COLLADA2GLTF/GLTF/GLTFPrimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace GLTF
{
this->_allVertexAttributes = primitive._allVertexAttributes;
GLTFPrimitive *pr = const_cast<GLTFPrimitive*>(&primitive);
this->setPrimitive(pr->getPrimitive());
this->setMode(pr->getMode());
this->setMaterialID(pr->getMaterialID());
this->_materialObjectID = primitive._materialObjectID;
this->_uniqueIndices = primitive._uniqueIndices;
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions converter/COLLADA2GLTF/GLTF/GLTFPrimitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion converter/COLLADA2GLTF/GLTF/GLTFTypesAndConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion converter/COLLADA2GLTF/convert/meshConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion converter/COLLADA2GLTF/dependencies/OpenCOLLADA
Submodule OpenCOLLADA updated 104 files
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ namespace GLTF

for (unsigned int i = 0 ; i < primitivesCount ; i++) {
shared_ptr<GLTF::GLTFPrimitive> primitive = static_pointer_cast<GLTFPrimitive>(primitives[i]);
if (primitive->getPrimitive() != profile->getGLenumForString("TRIANGLES")) {
if (primitive->getMode() != profile->getGLenumForString("TRIANGLES")) {
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions converter/COLLADA2GLTF/helpers/geometryHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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++) {
Expand Down

0 comments on commit 7f787cf

Please sign in to comment.