我正在尝试使用 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
(...)
}