Update Assimp from 5.2.3 to 5.2.5

This commit is contained in:
Bloodknight 2022-10-02 19:02:49 +01:00
parent ea7ca63301
commit 16f3710058
379 changed files with 14469 additions and 47175 deletions

View file

@ -1616,6 +1616,7 @@ void ColladaParser::ReadIndexData(XmlNode &node, Mesh &pMesh) {
XmlParser::getValueAsString(currentNode, v);
const char *content = v.c_str();
vcount.reserve(numPrimitives);
SkipSpacesAndLineEnd(&content);
for (unsigned int a = 0; a < numPrimitives; a++) {
if (*content == 0) {
throw DeadlyImportError("Expected more values while reading <vcount> contents.");
@ -1928,7 +1929,7 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz
switch (pInput.mType) {
case IT_Position: // ignore all position streams except 0 - there can be only one position
if (pInput.mIndex == 0) {
pMesh.mPositions.push_back(aiVector3D(obj[0], obj[1], obj[2]));
pMesh.mPositions.emplace_back(obj[0], obj[1], obj[2]);
} else {
ASSIMP_LOG_ERROR("Collada: just one vertex position stream supported");
}
@ -1940,7 +1941,7 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz
// ignore all normal streams except 0 - there can be only one normal
if (pInput.mIndex == 0) {
pMesh.mNormals.push_back(aiVector3D(obj[0], obj[1], obj[2]));
pMesh.mNormals.emplace_back(obj[0], obj[1], obj[2]);
} else {
ASSIMP_LOG_ERROR("Collada: just one vertex normal stream supported");
}
@ -1952,7 +1953,7 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz
// ignore all tangent streams except 0 - there can be only one tangent
if (pInput.mIndex == 0) {
pMesh.mTangents.push_back(aiVector3D(obj[0], obj[1], obj[2]));
pMesh.mTangents.emplace_back(obj[0], obj[1], obj[2]);
} else {
ASSIMP_LOG_ERROR("Collada: just one vertex tangent stream supported");
}
@ -1965,7 +1966,7 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz
// ignore all bitangent streams except 0 - there can be only one bitangent
if (pInput.mIndex == 0) {
pMesh.mBitangents.push_back(aiVector3D(obj[0], obj[1], obj[2]));
pMesh.mBitangents.emplace_back(obj[0], obj[1], obj[2]);
} else {
ASSIMP_LOG_ERROR("Collada: just one vertex bitangent stream supported");
}
@ -1978,7 +1979,7 @@ void ColladaParser::ExtractDataObjectFromChannel(const InputChannel &pInput, siz
pMesh.mTexCoords[pInput.mIndex].insert(pMesh.mTexCoords[pInput.mIndex].end(),
pMesh.mPositions.size() - pMesh.mTexCoords[pInput.mIndex].size() - 1, aiVector3D(0, 0, 0));
pMesh.mTexCoords[pInput.mIndex].push_back(aiVector3D(obj[0], obj[1], obj[2]));
pMesh.mTexCoords[pInput.mIndex].emplace_back(obj[0], obj[1], obj[2]);
if (0 != acc.mSubOffset[2] || 0 != acc.mSubOffset[3]) {
pMesh.mNumUVComponents[pInput.mIndex] = 3;
}
@ -2057,7 +2058,7 @@ void ColladaParser::ReadSceneNode(XmlNode &node, Node *pNode) {
XmlParser::getStdStrAttribute(currentNode, "id", child->mID);
}
if (XmlParser::hasAttribute(currentNode, "sid")) {
XmlParser::getStdStrAttribute(currentNode, "id", child->mSID);
XmlParser::getStdStrAttribute(currentNode, "sid", child->mSID);
}
if (XmlParser::hasAttribute(currentNode, "name")) {
XmlParser::getStdStrAttribute(currentNode, "name", child->mName);
@ -2112,7 +2113,7 @@ void ColladaParser::ReadSceneNode(XmlNode &node, Node *pNode) {
if (s[0] != '#') {
ASSIMP_LOG_ERROR("Collada: Unresolved reference format of node");
} else {
pNode->mNodeInstances.push_back(NodeInstance());
pNode->mNodeInstances.emplace_back();
pNode->mNodeInstances.back().mNode = s.c_str() + 1;
}
}
@ -2128,7 +2129,7 @@ void ColladaParser::ReadSceneNode(XmlNode &node, Node *pNode) {
throw DeadlyImportError("Unknown reference format in <instance_light> element");
}
pNode->mLights.push_back(LightInstance());
pNode->mLights.emplace_back();
pNode->mLights.back().mLight = url.c_str() + 1;
}
} else if (currentName == "instance_camera") {
@ -2139,7 +2140,7 @@ void ColladaParser::ReadSceneNode(XmlNode &node, Node *pNode) {
if (url[0] != '#') {
throw DeadlyImportError("Unknown reference format in <instance_camera> element");
}
pNode->mCameras.push_back(CameraInstance());
pNode->mCameras.emplace_back();
pNode->mCameras.back().mCamera = url.c_str() + 1;
}
}