mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 09:33:29 +02:00
Sanity check to prevent crash in Model::simulate.
This commit is contained in:
parent
1fc40f5814
commit
966f75db9b
1 changed files with 8 additions and 0 deletions
|
@ -1176,6 +1176,10 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
|
|||
// see http://stackoverflow.com/questions/13566608/loading-skinning-information-from-fbx for a discussion
|
||||
// of skinning information in FBX
|
||||
fbxCluster.jointIndex = modelIDs.indexOf(jointID);
|
||||
if (fbxCluster.jointIndex == -1) {
|
||||
qDebug() << "Joint not in model list: " << jointID << "\n";
|
||||
fbxCluster.jointIndex = 0;
|
||||
}
|
||||
fbxCluster.inverseBindMatrix = glm::inverse(cluster.transformLink) * modelTransform;
|
||||
extracted.mesh.clusters.append(fbxCluster);
|
||||
}
|
||||
|
@ -1185,6 +1189,10 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
|
|||
if (extracted.mesh.clusters.isEmpty()) {
|
||||
FBXCluster cluster;
|
||||
cluster.jointIndex = modelIDs.indexOf(modelID);
|
||||
if (cluster.jointIndex == -1) {
|
||||
qDebug() << "Model not in model list: " << modelID << "\n";
|
||||
cluster.jointIndex = 0;
|
||||
}
|
||||
extracted.mesh.clusters.append(cluster);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue