2

我正在尝试使用 assimp 加载动画网格(骨架),但我遇到了一些问题。

当我尝试访问 (root Node)aiNode*的名称时,程序崩溃了。在 Visual Studio 的输出中,它说它无法读取字符串字符。

(我正在关注本教程。)

void Mesh::ReadNodeHierarchy(float AnimationTime, aiScene* scene, aiNode* pNode, const aiMatrix4x4& ParentTransform) {
if (pNode == NULL) {
    std::cerr << "NODE NULL\n";
    return;
}

std::cerr << pNode->mName.length; // I tried to check the length of the string but it caused the same error

std::string NodeName(pNode->mName.data); // Throws error
(...)
}
4

1 回答 1

2

如果有人遇到同样的问题,我刚刚发现当 Assimp::Importer 类被销毁时,场景也是如此。

我的进口商类是本地的,所以它被破坏了,从而导致了错误。

于 2016-09-02T22:52:31.807 回答