4 Commits

Author SHA1 Message Date
41995b60bb Update README.md 2024-12-12 11:52:04 +04:00
e6f5dca6da Update README.md 2024-12-12 11:51:33 +04:00
0bc81ac5ba Fix bug in parseNodes 2022-10-01 06:35:29 +04:00
6bb760fc0a Protect against aiString being empty 2022-10-01 06:20:53 +04:00
2 changed files with 6 additions and 2 deletions

View File

@ -38,7 +38,7 @@ download from the GitHub releases page.
### Installing on Windows ### Installing on Windows
Download the **.dll** of the release you want, and place it in the **root** of your Go project. Download the **.dll** of the [release you want](https://github.com/bloeys/assimp-go/releases), and place it in the **root** of your Go project.
### Installing on MacOS ### Installing on MacOS

View File

@ -215,7 +215,7 @@ func parseNodes(cNodesIn **C.struct_aiNode, parent *Node, parentChildrenCount ui
} }
//Parse node's children //Parse node's children
nodes[i].Children = parseNodes(n.mChildren, nodes[i], parentChildrenCount) nodes[i].Children = parseNodes(n.mChildren, nodes[i], uint(n.mNumChildren))
} }
return nodes return nodes
@ -519,6 +519,10 @@ func parseVertexWeights(cWeights *C.struct_aiVertexWeight, count uint) []VertexW
} }
func parseAiString(aiString C.struct_aiString) string { func parseAiString(aiString C.struct_aiString) string {
if aiString.length == 0 {
return ""
}
return C.GoStringN(&aiString.data[0], C.int(aiString.length)) return C.GoStringN(&aiString.data[0], C.int(aiString.length))
} }