Selaa lähdekoodia

Merge pull request #322 from Gargaj/patch-2

Handle both types of element names
Alexander Gessler 11 vuotta sitten
vanhempi
commit
95139b3576
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      code/FBXMeshGeometry.cpp

+ 4 - 2
code/FBXMeshGeometry.cpp

@@ -466,8 +466,9 @@ void MeshGeometry::ReadVertexDataTangents(std::vector<aiVector3D>& tangents_out,
 	const std::string& MappingInformationType,
 	const std::string& MappingInformationType,
 	const std::string& ReferenceInformationType)
 	const std::string& ReferenceInformationType)
 {
 {
+	const char * str = source.Elements().count( "Tangents" ) > 0 ? "Tangents" : "Tangent";
 	ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType,
 	ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType,
-		"Tangent",
+		str,
 		"TangentIndex",
 		"TangentIndex",
 		vertices.size(),
 		vertices.size(),
 		mapping_counts,
 		mapping_counts,
@@ -481,8 +482,9 @@ void MeshGeometry::ReadVertexDataBinormals(std::vector<aiVector3D>& binormals_ou
 	const std::string& MappingInformationType,
 	const std::string& MappingInformationType,
 	const std::string& ReferenceInformationType)
 	const std::string& ReferenceInformationType)
 {
 {
+	const char * str = source.Elements().count( "Binormals" ) > 0 ? "Binormals" : "Binormal";
 	ResolveVertexDataArray(binormals_out,source,MappingInformationType,ReferenceInformationType,
 	ResolveVertexDataArray(binormals_out,source,MappingInformationType,ReferenceInformationType,
-		"Binormal",
+		str,
 		"BinormalIndex",
 		"BinormalIndex",
 		vertices.size(),
 		vertices.size(),
 		mapping_counts,
 		mapping_counts,